In this blog we’ll learn the basics required to scale an application. Lets start with how does the architecture of a small application looks like.
Basic API Architecture At the most basic level any application has following parts:
Client - which requests the API and gets back a response. Server - which processes the request and sends back the response. Database - which stores any data that the server needs to process any subsequent requests....
When designing distributed systems it’s important to know CAP(Consistency, Availability and Partition Tolerance) theorem in order to understand trade offs in designing different distributed systems.
CAP Theorem states that in a distributed system, one can choose two out of three - Consistency, Availability and Partition Tolerance.
What does these three terms mean:
Consistency - means a client sees the same data irrespective of the node it connects to....
A cache is a in-memory data structure which is designed for fast access, insertion and deletion.
All caches have memory limit which requires cache eviction policy. Whenever the memory of cache is full, we use a cache eviction policy to delete an item to make space for the new item.
Today we’re going to look at how to design a cache which uses Least Recently Used as its cache eviction policy....