Redis Advanced
This chapter covers horizontal partitioning, monitored failover, durable stream consumption, pending-message recovery, and atomic Lua operations while making each availability trade-off visible.
- Explain Redis Cluster & Sentinel by naming its input, guarantee, internal lifecycle, important failure, and proof.
- Explain Redis Streams by naming its input, guarantee, internal lifecycle, important failure, and proof.
- Explain Lua scripting by naming its input, guarantee, internal lifecycle, important failure, and proof.
- Explain Operations & testing by naming its input, guarantee, internal lifecycle, important failure, and proof.
- Trace the chapter's complete execution path and identify where memory, I/O, concurrency, persistence, or rendering cost accumulates.
How to use this chapter
For Redis Advanced, read the explanations first and predict every example before running it. Keep a learning repository containing code, tests, command output, and the short written submission. The roadmap checklist at the end audits coverage; the chapter itself follows the data learning arc appropriate to this subject.
The problem this chapter solves
This chapter covers horizontal partitioning, monitored failover, durable stream consumption, pending-message recovery, and atomic Lua operations while making each availability trade-off visible.
It offers predictable low-latency primitives for caching, coordination, counters, rate limits, ephemeral state, and real-time delivery when their failure semantics are explicitly designed.
Learning outcomes
- Explain Redis Cluster & Sentinel by naming its input, guarantee, internal lifecycle, important failure, and proof.
- Explain Redis Streams by naming its input, guarantee, internal lifecycle, important failure, and proof.
- Explain Lua scripting by naming its input, guarantee, internal lifecycle, important failure, and proof.
- Explain Operations & testing by naming its input, guarantee, internal lifecycle, important failure, and proof.
- Trace the chapter's complete execution path and identify where memory, I/O, concurrency, persistence, or rendering cost accumulates.
- Build the worked example, make one failure visible, and defend the design in a review.
Chapter progression
The order below is intentional: later sections depend on guarantees established earlier.
Runtime or system overview
Commands are executed serially by Redis's core event-loop model, while networking and persistence can use additional threads or processes. Atomicity applies to one command or a server-side transaction/script, not to an arbitrary client-side read-modify-write sequence. Expiry is enforced lazily on access and actively by periodic sampling. In Redis Advanced, use that execution model to decide where the chapter's validation, state ownership, cleanup, and evidence belong.
Execution trace
- The client borrows a bounded connection, encodes the command, and sends it to the node responsible for the key or hash slot.
- Redis executes the command atomically in its core event-loop order; transactions queue commands and Lua scripts perform one bounded server-side decision.
- Expiry, persistence, replication, eviction, and failover policy determine how long the result remains available and what loss window is possible.
- The client decodes the reply, handles redirection or timeout according to bounded retry policy, and releases the connection.
- Tests cover TTL boundaries, races, stale lease owners, failover, resharding, pending work, and memory pressure with latency and error metrics.
Memory and performance lens
Redis stores keys, metadata, and encodings in RAM; logical payload size understates actual memory use. Eviction policy, fragmentation, replication buffers, client output buffers, streams' pending entries, and copy-on-write during persistence all affect capacity. For Redis Advanced, connect those costs to the concrete operations in the topic sections rather than assuming the friendly surface syntax is cheap.
When tuning Redis Advanced, measure rows and bytes scanned, plan estimates versus actuals, buffer hits/reads, spill, lock time, cache memory, and tail latency rather than optimizing from source-code appearance.
1. Redis Cluster & Sentinel
The Redis Cluster & Sentinel unit begins with hash slots (16384) and slot assignment: Cluster shards keys across 16,384 hash slots; Sentinel monitors a primary-replica deployment and coordinates failover without sharding. Use hash tags only for deliberate multi-key colocation and test failover behavior. The rest of this section connects that guarantee to this unit's related roadmap concepts instead of treating each term as an isolated flashcard.
The data model and its guarantees: Redis Cluster & Sentinel
| Concept | Meaning | Engineering decision |
|---|---|---|
| hash slots (16384) and slot assignment | Cluster shards keys across 16,384 hash slots; Sentinel monitors a primary-replica deployment and coordinates failover without sharding. | Use hash tags only for deliberate multi-key colocation and test failover behavior. |
| CLUSTER INFO/NODES commands | Cluster shards keys across 16,384 hash slots; Sentinel monitors a primary-replica deployment and coordinates failover without sharding. | Use hash tags only for deliberate multi-key colocation and test failover behavior. |
| RedisCluster client in redis-py | Cluster shards keys across 16,384 hash slots; Sentinel monitors a primary-replica deployment and coordinates failover without sharding. | Use hash tags only for deliberate multi-key colocation and test failover behavior. |
| Sentinel quorum and automatic failover | Cluster shards keys across 16,384 hash slots; Sentinel monitors a primary-replica deployment and coordinates failover without sharding. | Use hash tags only for deliberate multi-key colocation and test failover behavior. |
Storage, planning, and execution: Redis Cluster & Sentinel
hash slots (16384) and slot assignment. Clients follow MOVED/ASK redirects in Cluster. Sentinel quorum detects failure and a majority authorization elects a new primary.
CLUSTER INFO/NODES commands. Clients follow MOVED/ASK redirects in Cluster. Sentinel quorum detects failure and a majority authorization elects a new primary.
RedisCluster client in redis-py. Clients follow MOVED/ASK redirects in Cluster. Sentinel quorum detects failure and a majority authorization elects a new primary.
Sentinel quorum and automatic failover. Clients follow MOVED/ASK redirects in Cluster. Sentinel quorum detects failure and a majority authorization elects a new primary.
Read these as one system: hash slots (16384) and slot assignment establishes the starting contract, CLUSTER INFO/NODES commands changes how that contract is executed or represented, and Sentinel quorum and automatic failover exposes a later boundary or failure condition. A local optimization is useful only when the combined behavior stays correct and observable.
Query or command in context: Redis Cluster & Sentinel
1async with redis.pipeline(transaction=True) as pipe:2 pipe.hset(f"hash_slots_16384_and_slot_assignment:{entity_id}", mapping=payload)3 pipe.expire(f"hash_slots_16384_and_slot_assignment:{entity_id}", ttl_seconds)4 await pipe.execute()This Redis Cluster & Sentinel slice makes hash slots (16384) and slot assignment observable. Read it from the boundary inward: identify the input, the validation point, the state or operation, and the value that proves the result. Before extending it toward Sentinel quorum and automatic failover, predict its behavior for empty, invalid, repeated, and large input.
Correctness and performance traps: Redis Cluster & Sentinel
| Risk | Why it matters |
|---|---|
| hash slots (16384) and slot assignment | Asynchronous replication can lose acknowledged writes during failover. |
| CLUSTER INFO/NODES commands | Asynchronous replication can lose acknowledged writes during failover. |
| RedisCluster client in redis-py | Asynchronous replication can lose acknowledged writes during failover. |
| Sentinel quorum and automatic failover | Asynchronous replication can lose acknowledged writes during failover. |
Data investigation: Redis Cluster & Sentinel
- Foundation: implement or demonstrate hash slots (16384) and slot assignment with one valid input and one invalid input. Record the exact output or failure.
- Integration: combine hash slots (16384) and slot assignment with CLUSTER INFO/NODES commands. Explain which component owns validation and cleanup.
- Production: design a test or experiment that exposes the failure described for Sentinel quorum and automatic failover. State the metric, assertion, or query plan that proves the correction.
What a strong checkpoint answer contains
- A precise boundary and typed or validated input.
- One named guarantee, not only a library call.
- A negative case that fails for the intended reason.
- Cleanup, transaction, retry, or cancellation behavior where applicable.
- Evidence: assertion, command output, plan, trace, metric, or accessible UI state.
2. Redis Streams
The Redis Streams unit begins with XADD/XREAD/XREADGROUP/XACK: Redis Streams are retained, ordered entry logs whose consumer groups track delivery and pending ownership independently for each group. Bound retention, monitor pending age, make handlers idempotent, and recover pending entries before reading only new ones. The rest of this section connects that guarantee to this unit's related roadmap concepts instead of treating each term as an isolated flashcard.
The data model and its guarantees: Redis Streams
| Concept | Meaning | Engineering decision |
|---|---|---|
| XADD/XREAD/XREADGROUP/XACK | Redis Streams are retained, ordered entry logs whose consumer groups track delivery and pending ownership independently for each group. | Bound retention, monitor pending age, make handlers idempotent, and recover pending entries before reading only new ones. |
| consumer groups in Streams (vs Pub/Sub) | Redis Streams are retained, ordered entry logs whose consumer groups track delivery and pending ownership independently for each group. | Bound retention, monitor pending age, make handlers idempotent, and recover pending entries before reading only new ones. |
| Pending Entry List (PEL) for at-least-once | Redis Streams are retained, ordered entry logs whose consumer groups track delivery and pending ownership independently for each group. | Bound retention, monitor pending age, make handlers idempotent, and recover pending entries before reading only new ones. |
| XAUTOCLAIM for stale messages | Redis Streams are retained, ordered entry logs whose consumer groups track delivery and pending ownership independently for each group. | Bound retention, monitor pending age, make handlers idempotent, and recover pending entries before reading only new ones. |
Storage, planning, and execution: Redis Streams
XADD/XREAD/XREADGROUP/XACK. XREADGROUP assigns entries, the pending entries list records unacknowledged work, XACK completes it, and XAUTOCLAIM transfers sufficiently idle work after a consumer failure.
consumer groups in Streams (vs Pub/Sub). XREADGROUP assigns entries, the pending entries list records unacknowledged work, XACK completes it, and XAUTOCLAIM transfers sufficiently idle work after a consumer failure.
Pending Entry List (PEL) for at-least-once. XREADGROUP assigns entries, the pending entries list records unacknowledged work, XACK completes it, and XAUTOCLAIM transfers sufficiently idle work after a consumer failure.
XAUTOCLAIM for stale messages. XREADGROUP assigns entries, the pending entries list records unacknowledged work, XACK completes it, and XAUTOCLAIM transfers sufficiently idle work after a consumer failure.
Read these as one system: XADD/XREAD/XREADGROUP/XACK establishes the starting contract, consumer groups in Streams (vs Pub/Sub) changes how that contract is executed or represented, and XAUTOCLAIM for stale messages exposes a later boundary or failure condition. A local optimization is useful only when the combined behavior stays correct and observable.
Query or command in context: Redis Streams
1XREADGROUP GROUP workers worker-1 BLOCK 5000 COUNT 20 STREAMS jobs >This Redis Streams slice makes XADD/XREAD/XREADGROUP/XACK observable. Read it from the boundary inward: identify the input, the validation point, the state or operation, and the value that proves the result. Before extending it toward XAUTOCLAIM for stale messages, predict its behavior for empty, invalid, repeated, and large input.
Correctness and performance traps: Redis Streams
| Risk | Why it matters |
|---|---|
| XADD/XREAD/XREADGROUP/XACK | Redis Stream consumer groups are not Kafka partition groups: several consumers can own different entry IDs without persistent partition ownership. |
| consumer groups in Streams (vs Pub/Sub) | Redis Stream consumer groups are not Kafka partition groups: several consumers can own different entry IDs without persistent partition ownership. |
| Pending Entry List (PEL) for at-least-once | Redis Stream consumer groups are not Kafka partition groups: several consumers can own different entry IDs without persistent partition ownership. |
| XAUTOCLAIM for stale messages | Redis Stream consumer groups are not Kafka partition groups: several consumers can own different entry IDs without persistent partition ownership. |
Data investigation: Redis Streams
- Foundation: implement or demonstrate XADD/XREAD/XREADGROUP/XACK with one valid input and one invalid input. Record the exact output or failure.
- Integration: combine XADD/XREAD/XREADGROUP/XACK with consumer groups in Streams (vs Pub/Sub). Explain which component owns validation and cleanup.
- Production: design a test or experiment that exposes the failure described for XAUTOCLAIM for stale messages. State the metric, assertion, or query plan that proves the correction.
What a strong checkpoint answer contains
- A precise boundary and typed or validated input.
- One named guarantee, not only a library call.
- A negative case that fails for the intended reason.
- Cleanup, transaction, retry, or cancellation behavior where applicable.
- Evidence: assertion, command output, plan, trace, metric, or accessible UI state.
3. Lua scripting
The Lua scripting unit begins with EVAL and EVALSHA: Redis Lua executes a multi-command decision atomically on the server. Keep scripts deterministic, small, key-declared, and bounded. The rest of this section connects that guarantee to this unit's related roadmap concepts instead of treating each term as an isolated flashcard.
The data model and its guarantees: Lua scripting
| Concept | Meaning | Engineering decision |
|---|---|---|
| EVAL and EVALSHA | Redis Lua executes a multi-command decision atomically on the server. | Keep scripts deterministic, small, key-declared, and bounded. |
| why Lua scripts are atomic | Redis Lua executes a multi-command decision atomically on the server. | Keep scripts deterministic, small, key-declared, and bounded. |
| SCRIPT LOAD for caching | Redis Lua executes a multi-command decision atomically on the server. | Keep scripts deterministic, small, key-declared, and bounded. |
| atomic rate limiter in Lua | Throttling bounds request rate; pagination bounds response and query work. Cursor pagination advances from a stable ordering key rather than a row offset. | Use deterministic unique ordering and return retry metadata. |
Storage, planning, and execution: Lua scripting
EVAL and EVALSHA. The script blocks other command execution until it finishes; EVALSHA reuses a cached script body and clients recover from NOSCRIPT.
why Lua scripts are atomic. The script blocks other command execution until it finishes; EVALSHA reuses a cached script body and clients recover from NOSCRIPT.
SCRIPT LOAD for caching. The script blocks other command execution until it finishes; EVALSHA reuses a cached script body and clients recover from NOSCRIPT.
atomic rate limiter in Lua. Distributed limits use atomic counters or scripts. A cursor encodes ordering position and tie-breaker; Relay exposes edges, nodes, cursors, and pageInfo.
Read these as one system: EVAL and EVALSHA establishes the starting contract, why Lua scripts are atomic changes how that contract is executed or represented, and atomic rate limiter in Lua exposes a later boundary or failure condition. A local optimization is useful only when the combined behavior stays correct and observable.
Query or command in context: Lua scripting
1async with redis.pipeline(transaction=True) as pipe:2 pipe.hset(f"eval_and_evalsha:{entity_id}", mapping=payload)3 pipe.expire(f"eval_and_evalsha:{entity_id}", ttl_seconds)4 await pipe.execute()This Lua scripting slice makes EVAL and EVALSHA observable. Read it from the boundary inward: identify the input, the validation point, the state or operation, and the value that proves the result. Before extending it toward atomic rate limiter in Lua, predict its behavior for empty, invalid, repeated, and large input.
Correctness and performance traps: Lua scripting
| Risk | Why it matters |
|---|---|
| EVAL and EVALSHA | Long loops block Redis, and Cluster scripts can access only colocated keys. |
| why Lua scripts are atomic | Long loops block Redis, and Cluster scripts can access only colocated keys. |
| SCRIPT LOAD for caching | Long loops block Redis, and Cluster scripts can access only colocated keys. |
| atomic rate limiter in Lua | Application throttles are not a substitute for edge protection, and offset pagination drifts under concurrent writes. |
Data investigation: Lua scripting
- Foundation: implement or demonstrate EVAL and EVALSHA with one valid input and one invalid input. Record the exact output or failure.
- Integration: combine EVAL and EVALSHA with why Lua scripts are atomic. Explain which component owns validation and cleanup.
- Production: design a test or experiment that exposes the failure described for atomic rate limiter in Lua. State the metric, assertion, or query plan that proves the correction.
What a strong checkpoint answer contains
- A precise boundary and typed or validated input.
- One named guarantee, not only a library call.
- A negative case that fails for the intended reason.
- Cleanup, transaction, retry, or cancellation behavior where applicable.
- Evidence: assertion, command output, plan, trace, metric, or accessible UI state.
4. Operations & testing
The Operations & testing unit begins with online cluster resharding and slot migration: Redis operational work proves failover, resharding, memory policy, client redirection, and recovery behavior against a real server topology. Test topology changes with production-compatible clients, assert timeouts and retry bounds, and distinguish fast unit fakes from real integration behavior. The rest of this section connects that guarantee to this unit's related roadmap concepts instead of treating each term as an isolated flashcard.
The data model and its guarantees: Operations & testing
| Concept | Meaning | Engineering decision |
|---|---|---|
| online cluster resharding and slot migration | Redis operational work proves failover, resharding, memory policy, client redirection, and recovery behavior against a real server topology. | Test topology changes with production-compatible clients, assert timeouts and retry bounds, and distinguish fast unit fakes from real integration behavior. |
| Lua atomic stock deduction with non-negative invariant | Redis operational work proves failover, resharding, memory policy, client redirection, and recovery behavior against a real server topology. | Test topology changes with production-compatible clients, assert timeouts and retry bounds, and distinguish fast unit fakes from real integration behavior. |
| redis-py asyncio lifecycle | Redis operational work proves failover, resharding, memory policy, client redirection, and recovery behavior against a real server topology. | Test topology changes with production-compatible clients, assert timeouts and retry bounds, and distinguish fast unit fakes from real integration behavior. |
| fakeredis unit tests vs real Redis integration tests | Redis operational work proves failover, resharding, memory policy, client redirection, and recovery behavior against a real server topology. | Test topology changes with production-compatible clients, assert timeouts and retry bounds, and distinguish fast unit fakes from real integration behavior. |
Storage, planning, and execution: Operations & testing
online cluster resharding and slot migration. Cluster resharding migrates hash slots while clients follow MOVED or ASK responses; Sentinel promotes a replica after quorum and majority authorization; persistence and replication influence acknowledged-write recovery.
Lua atomic stock deduction with non-negative invariant. Cluster resharding migrates hash slots while clients follow MOVED or ASK responses; Sentinel promotes a replica after quorum and majority authorization; persistence and replication influence acknowledged-write recovery.
redis-py asyncio lifecycle. Cluster resharding migrates hash slots while clients follow MOVED or ASK responses; Sentinel promotes a replica after quorum and majority authorization; persistence and replication influence acknowledged-write recovery.
fakeredis unit tests vs real Redis integration tests. Cluster resharding migrates hash slots while clients follow MOVED or ASK responses; Sentinel promotes a replica after quorum and majority authorization; persistence and replication influence acknowledged-write recovery.
Read these as one system: online cluster resharding and slot migration establishes the starting contract, Lua atomic stock deduction with non-negative invariant changes how that contract is executed or represented, and fakeredis unit tests vs real Redis integration tests exposes a later boundary or failure condition. A local optimization is useful only when the combined behavior stays correct and observable.
Query or command in context: Operations & testing
1async with redis.pipeline(transaction=True) as pipe:2 pipe.hset(f"online_cluster_resharding_and_slot_migrati:{entity_id}", mapping=payload)3 pipe.expire(f"online_cluster_resharding_and_slot_migrati:{entity_id}", ttl_seconds)4 await pipe.execute()This Operations & testing slice makes online cluster resharding and slot migration observable. Read it from the boundary inward: identify the input, the validation point, the state or operation, and the value that proves the result. Before extending it toward fakeredis unit tests vs real Redis integration tests, predict its behavior for empty, invalid, repeated, and large input.
Correctness and performance traps: Operations & testing
| Risk | Why it matters |
|---|---|
| online cluster resharding and slot migration | The word migration here means moving Redis slots or topology state, not a Django schema migration. |
| Lua atomic stock deduction with non-negative invariant | The word migration here means moving Redis slots or topology state, not a Django schema migration. |
| redis-py asyncio lifecycle | The word migration here means moving Redis slots or topology state, not a Django schema migration. |
| fakeredis unit tests vs real Redis integration tests | The word migration here means moving Redis slots or topology state, not a Django schema migration. |
Data investigation: Operations & testing
- Foundation: implement or demonstrate online cluster resharding and slot migration with one valid input and one invalid input. Record the exact output or failure.
- Integration: combine online cluster resharding and slot migration with Lua atomic stock deduction with non-negative invariant. Explain which component owns validation and cleanup.
- Production: design a test or experiment that exposes the failure described for fakeredis unit tests vs real Redis integration tests. State the metric, assertion, or query plan that proves the correction.
What a strong checkpoint answer contains
- A precise boundary and typed or validated input.
- One named guarantee, not only a library call.
- A negative case that fails for the intended reason.
- Cleanup, transaction, retry, or cancellation behavior where applicable.
- Evidence: assertion, command output, plan, trace, metric, or accessible UI state.
Complete worked example
This example integrates the chapter rather than demonstrating an isolated method.
1-- Atomic fixed-window limit; KEYS[1] is already hash-slot safe.2local current = redis.call('INCR', KEYS[1])3if current == 1 then4 redis.call('PEXPIRE', KEYS[1], ARGV[1])5end6if current > tonumber(ARGV[2]) then7 return {0, current, redis.call('PTTL', KEYS[1])}8end9return {1, current, redis.call('PTTL', KEYS[1])}Expected result
1Returns allowed flag, observed count, and remaining window TTL as one atomic result.Line-by-line reading
| Line | Code | Explanation |
|---|---|---|
| 1 | -- Atomic fixed-window limit; KEYS[1] is already hash-slot safe. | Implements the next lua statement in the example's data flow. |
| 2 | local current = redis.call('INCR', KEYS[1]) | Computes or receives a value and binds it for the next step; the referenced object remains separate from the name. |
| 3 | if current == 1 then | Evaluates the condition and enters this branch only when it is truthy. |
| 4 | redis.call('PEXPIRE', KEYS[1], ARGV[1]) | Implements the next lua statement in the example's data flow. |
| 5 | end | Implements the next lua statement in the example's data flow. |
| 6 | if current > tonumber(ARGV[2]) then | Evaluates the condition and enters this branch only when it is truthy. |
| 7 | return {0, current, redis.call('PTTL', KEYS[1])} | Returns the observable result to the caller and ends this invocation. |
| 8 | end | Implements the next lua statement in the example's data flow. |
| 9 | return {1, current, redis.call('PTTL', KEYS[1])} | Returns the observable result to the caller and ends this invocation. |
Step-by-step execution
- The client borrows a bounded connection, encodes the command, and sends it to the node responsible for the key or hash slot.
- Redis executes the command atomically in its core event-loop order; transactions queue commands and Lua scripts perform one bounded server-side decision.
- Expiry, persistence, replication, eviction, and failover policy determine how long the result remains available and what loss window is possible.
- The client decodes the reply, handles redirection or timeout according to bounded retry policy, and releases the connection.
- Tests cover TTL boundaries, races, stale lease owners, failover, resharding, pending work, and memory pressure with latency and error metrics.
Common mistakes and professional corrections
| Area | Common failure | Better engineering choice |
|---|---|---|
| Redis Cluster & Sentinel | Asynchronous replication can lose acknowledged writes during failover. | Use hash tags only for deliberate multi-key colocation and test failover behavior. |
| Redis Streams | Redis Stream consumer groups are not Kafka partition groups: several consumers can own different entry IDs without persistent partition ownership. | Bound retention, monitor pending age, make handlers idempotent, and recover pending entries before reading only new ones. |
| Lua scripting | Long loops block Redis, and Cluster scripts can access only colocated keys. | Keep scripts deterministic, small, key-declared, and bounded. |
| Operations & testing | The word migration here means moving Redis slots or topology state, not a Django schema migration. | Test topology changes with production-compatible clients, assert timeouts and retry bounds, and distinguish fast unit fakes from real integration behavior. |
Interview and review notes
- Define the central abstraction without naming a library function.
- Trace one request, call, query, message, render, or state transition from input to observable result.
- Compare two alternatives from this chapter by guarantee, cost, and failure behavior.
- Explain the most likely production bug and the test or metric that reveals it.
- State what remains authoritative after process loss, retry, reconnect, or deployment.
Practice set
Easy
- Define every bold term in the concept tables in one precise sentence.
- Reproduce the focused examples and annotate the value or state after each important line.
- Explain the chapter progression diagram aloud in two minutes.
Medium
- Replace one convenient default with an explicit policy for validation, timeout, ordering, pagination, cleanup, or error handling.
- Write a negative test for each topic group.
- Compare the measured behavior before and after one justified change.
Hard
- Combine all topic groups into one thin vertical slice.
- Inject a realistic failure at the most important external boundary and prove recovery.
- Write a one-page design note covering ownership, trade-offs, security, observability, and rollback.
Chapter submission
Submit:
- source code or reproducible commands;
- automated tests plus one deliberately failing-before-fix test;
- captured output, query plan, trace, screenshot, or metric;
- a 300–500 word explanation of the execution flow and one rejected alternative;
- a short README with setup, versions, limitations, and cleanup steps.
- Continue with the Order System + Redis Streams project workshop.
Self-review rubric
| Dimension | Beginning | Competent | Professional |
|---|---|---|---|
| Explanation | Names APIs | Explains behavior | Connects guarantees, internals, and trade-offs |
| Implementation | Happy path only | Validated and tested | Clear ownership, failure recovery, and cleanup |
| Evidence | Manual claim | Repeatable output | Tests plus meaningful measurement or inspection |
| Communication | Steps missing | Reproducible README | Decisions, limits, and alternatives are explicit |
Roadmap coverage checklist
- To do: Redis Cluster & Sentinel: hash slots (16384) and slot assignment
- To do: Redis Cluster & Sentinel: CLUSTER INFO/NODES commands
- To do: Redis Cluster & Sentinel: RedisCluster client in redis-py
- To do: Redis Cluster & Sentinel: Sentinel quorum and automatic failover
- To do: Redis Streams: XADD/XREAD/XREADGROUP/XACK
- To do: Redis Streams: consumer groups in Streams (vs Pub/Sub)
- To do: Redis Streams: Pending Entry List (PEL) for at-least-once
- To do: Redis Streams: XAUTOCLAIM for stale messages
- To do: Lua scripting: EVAL and EVALSHA
- To do: Lua scripting: why Lua scripts are atomic
- To do: Lua scripting: SCRIPT LOAD for caching
- To do: Lua scripting: atomic rate limiter in Lua
- To do: Operations & testing: online cluster resharding and slot migration
- To do: Operations & testing: Lua atomic stock deduction with non-negative invariant
- To do: Operations & testing: redis-py asyncio lifecycle
- To do: Operations & testing: fakeredis unit tests vs real Redis integration tests
Quick revision
- Redis Cluster & Sentinel: connect the surface API to its guarantee, lifecycle, failure boundary, and evidence.
- Redis Streams: connect the surface API to its guarantee, lifecycle, failure boundary, and evidence.
- Lua scripting: connect the surface API to its guarantee, lifecycle, failure boundary, and evidence.
- Operations & testing: connect the surface API to its guarantee, lifecycle, failure boundary, and evidence.
- Re-read the worked-example execution trace instead of memorizing isolated syntax.
- If you cannot name the owner of state and cleanup, the design is not yet complete.
Mastery check
How well can you recall this?
Finished this lesson?