High-level Design of a Distributed Cache
Learn how we can develop a high-level design of a distributed cache.
In this lesson, we’ll learn to design a distributed cache. We’ll also discuss the trade-offs and design choices that can occur while we progress in our journey towards developing a solution.
Requirements
Let us start by understanding the requirements of our solution.
Functional
The following are the functional requirements:
- Insert data: The user of a distributed cache system must be able to insert an entry to the cache.
- Retrieve data: The user should be able to retrieve data corresponding to a specific key.
Non-functional requirements
We’ll consider the following non-functional requirements:
-
High performance: The primary reason for the cache is to enable fast retrieval of data. Therefore, both the
insert
andretrieve
operations must be fast. -
Scalability: The cache system should scale horizontally with no bottlenecks on an increasing number of requests.
-
High availability: The unavailability of the cache will put an extra burden on the database servers, which can also go down at peak load intervals. We also require our system to survive occasional failures of components and network, as well as power outages.
-
Consistency: Data stored on the cache servers should be consistent. For example, ...