Key-Value Store Flashcards

(23 cards)

1
Q

What is a key-value store?

A

A distributed data store that supports two core operations: put(key, value) and get(key), optimized for speed, scalability, and simplicity.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Core functional operations of a key-value store?

A

Put: Store a value for a given key
Get: Retrieve the value associated with a key

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What does configurable service mean in a key-value store?

A

The system allows applications to choose different consistency models (e.g., strong vs eventual) at store creation time, balancing consistency, availability, cost, and performance.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Can consistency configuration change at runtime?

A

❌ No. Consistency settings are fixed when a key-value store instance is created.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What does “ability to always write” mean?

A

The system accepts write operations at all times, even during failures or network partitions, prioritizing availability over consistency.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Which CAP property does “always write” favor?

A

Availability (A) over Consistency (C).

The CAP theorem states that a distributed system can only guarantee two out of three properties simultaneously: Consistency, Availability, and Partition tolerance.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Why is “always write” sometimes a functional requirement?

A

In applications like shopping carts, writes must succeed for correct behavior (e.g., users must always add items), as seen in systems inspired by Amazon.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is hardware heterogeneity?

A

The ability to add servers with different capacities without upgrading existing ones, while still balancing load correctly.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What architecture supports hardware heterogeneity?

A

A peer-to-peer architecture with no distinguished nodes.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Key non-functional requirements of a key-value store?

A

Scalability
Fault tolerance

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What does scalability mean in this context?

A

Operate on tens of thousands of servers
Support incremental scaling
Add/remove nodes with minimal service disruption

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What does fault tolerance mean?

A

The system continues operating despite server or component failures.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Key differences between key-value stores and traditional databases?

A

-Limited queries (no joins or filters)
-Optimized for speed and scale
-Often eventually consistent
-Handle unstructured data

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

When are key-value stores most advantageous?

A

-Caching
-Session management
-Shopping carts
-Real-time analytics
-Massive, fast lookups

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Why not run a key-value store on a single server?

A

Limited scalability
Single point of failure
Poor availability

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Basic assumptions in this design?

A

Trusted data centers
Auth handled externally
Communication over HTTPS

17
Q

What does the get(key) API do?

A

Retrieves the value(s) associated with a key. Under weak consistency, multiple versions may be returned.

18
Q

What does the put(key, value) API do?

A

Stores the value for a key. The system decides data placement and maintains metadata (e.g., versions).

19
Q

Why store metadata with values?

A

To support versioning, replication, and conflict resolution.

20
Q

When should hashes be generated for data integrity checks?

A

After compression, before encryption
➡️ Compress → Hash → Encrypt

21
Q

Why not hash encrypted data?

A

Encryption introduces randomness (IVs/salts), making hashes unreliable for integrity checks.

22
Q

What data types do key-value stores support?

A

Key: Unique identifier (often hashed)
Value: Arbitrary binary data

23
Q

How does Dynamo-style systems assign data to nodes?

A

By hashing the key (e.g., MD5) to produce an identifier used for data partitioning across nodes.