Design a Key-Value Store
Learn to design a key-value store.
Introduction to key-value stores
Key-value stores are
Requirements
Let’s list the requirements of designing a key-value store to overcome the problems of traditional databases.
Functional requirements
The functional requirements are as follows:
Configurable service: Some applications might have a tendency to trade strong consistency for higher availability. We need to provide a configurable service so that different applications could use a range of consistency models. We need tight control over the trade-offs between availability, consistency, cost-effectiveness, and performance.
Ability to always write: The applications should always have the ability to write into the key-value storage.
Hardware heterogeneity: The system shouldn’t have distinguished nodes. Each node should be functionally able to do any task.
Non-functional requirements
The non-functional requirements are as follows:
Scalable: Key-value stores should run on tens of thousands of servers distributed across the globe. Incremental scalability is highly desirable, and the system should be able to handle a large number of users.
Available: We need to provide continuous service, so availability is very important. This property is configurable.
Fault tolerance: The key-value store should operate uninterrupted despite failures in servers or their components.
Now that you understand the functional and non-functional requirements of a key-value store, what do you think are the key differences between key-value stores and traditional databases?
In what scenarios are key-value stores particularly advantageous?
Level up your interview prep. Join Educative to access 80+ hands-on prep courses.