Course contentsShow
← System Design
Lesson 339 of 1,91910. NoSQL: Key-Value StoresFree lesson

Key-Value Store Operations

The three fundamental operations: GET (retrieve by key), PUT (store/update), and DELETE (remove by key).

Key-Value Store Operations

What You'll Learn

You'll learn the three fundamental operations that make key-value stores simple yet powerful: GET, PUT, and DELETE.

The Three Core Operations

Key-value stores are minimalist by design, offering just three essential operations:

PUT (Store or Update)

The PUT operation stores a value associated with a key. If the key already exists, it updates the value. Think of it like setting a variable: user:123 = {"name": "Alice"}. The key becomes the unique identifier, and the value can be any blob of data—text, JSON, binary, whatever you need.

GET (Retrieve)

The GET operation retrieves the value associated with a given key. You provide the key, and the store returns the value—or nothing if the key doesn't exist. It's like a dictionary lookup: fast, direct, and O(1) in complexity. There's no scanning, no filtering, just instant retrieval by key.

DELETE (Remove)

The DELETE operation removes a key and its associated value from the store. Once deleted, subsequent GET operations on that key will return nothing. Simple cleanup when data is no longer needed.

Why So Simple?

This minimalism is intentional. By restricting operations to these three, key-value stores can optimize for extreme speed and horizontal scalability. There's no complex query parsing, no join operations, no schema validation—just raw key-based access.

Real-World Analogy

Imagine a coat check at a restaurant. You hand over your coat (PUT), receive a numbered ticket (the key). Later, you present the ticket and instantly get your coat back (GET). If you want to cancel, they discard the ticket and coat (DELETE). No one needs to search through all coats—the ticket number gives direct access.

Key Takeaway: Key-value stores provide three atomic operations—PUT, GET, and DELETE—trading query flexibility for simplicity, speed, and massive scalability.