Podcast
Questions and Answers
What is a key-value store, also referred to as?
What is a key-value store, also referred to as?
What is a requirement for a key in a key-value pair?
What is a requirement for a key in a key-value pair?
What is the purpose of using a short key in a key-value store?
What is the purpose of using a short key in a key-value store?
What type of data can a value in a key-value pair be?
What type of data can a value in a key-value pair be?
Signup and view all the answers
What is the purpose of the put operation in a key-value store?
What is the purpose of the put operation in a key-value store?
Signup and view all the answers
What is a characteristic of the key-value store designed in this chapter?
What is a characteristic of the key-value store designed in this chapter?
Signup and view all the answers
What is an advantage of using a hash table to store key-value pairs in a single server key-value store?
What is an advantage of using a hash table to store key-value pairs in a single server key-value store?
Signup and view all the answers
What is a tradeoff that must be made when designing a key-value store?
What is a tradeoff that must be made when designing a key-value store?
Signup and view all the answers
What is a major limitation of memory access?
What is a major limitation of memory access?
Signup and view all the answers
What is a common technique used to fit more data in a single server?
What is a common technique used to fit more data in a single server?
Signup and view all the answers
What is another name for a distributed key-value store?
What is another name for a distributed key-value store?
Signup and view all the answers
What does the CAP theorem state?
What does the CAP theorem state?
Signup and view all the answers
What does consistency mean in the context of the CAP theorem?
What does consistency mean in the context of the CAP theorem?
Signup and view all the answers
What is an AP key-value store?
What is an AP key-value store?
Signup and view all the answers
What is a partition in the context of the CAP theorem?
What is a partition in the context of the CAP theorem?
Signup and view all the answers
What is a CA key-value store?
What is a CA key-value store?
Signup and view all the answers
Study Notes
Key-Value Stores
- A key-value store is a non-relational database that stores unique identifiers as keys with their associated values.
- Each key-value pair consists of a unique key and a value that can be accessed through the key.
- Keys can be plain text or hashed values, and shorter keys are preferred for performance reasons.
Key-Value Pair Examples
- Plain text key: “last_logged_in_at”
- Hashed key: 253DDEC4
- Values can be strings, lists, objects, etc.
Key-Value Store Operations
- put(key, value): inserts “value” associated with “key”
- get(key): gets “value” associated with “key”
Design Requirements
- Small key-value pair size: less than 10 KB
- Ability to store big data
- High availability: system responds quickly, even during failures
- High scalability: system can be scaled to support large data sets
- Automatic scaling: addition/deletion of servers should be automatic based on traffic
- Tunable consistency
- Low latency
Single Server Key-Value Store
- Storing key-value pairs in a hash table, keeping everything in memory
- Optimizations:
- Data compression
- Store only frequently used data in memory and the rest on disk
Distributed Key-Value Store
- Also called a distributed hash table, distributing key-value pairs across many servers
- CAP theorem: it is impossible for a distributed system to simultaneously provide more than two of the three guarantees: consistency, availability, and partition tolerance
CAP Theorem Definitions
- Consistency: all clients see the same data at the same time no matter which node they connect to
- Availability: any client which requests data gets a response even if some of the nodes are down
- Partition Tolerance: system continues to operate despite network partitions
CAP Theorem Classification
- CP (consistency and partition tolerance) systems: sacrifice availability
- AP (availability and partition tolerance) systems: sacrifice consistency
- CA (consistency and availability) systems: sacrifice partition tolerance
Studying That Suits You
Use AI to generate personalized quizzes and flashcards to suit your learning preferences.
Description
Learn about key-value stores, a type of non-relational database that uses unique identifiers as keys to access associated values. Understand the properties of keys and values in this data pairing.