Course contents
On this page
Lesson plan

Lesson plan 45: Redis and memory-oriented designs

Explain how in-memory representation and short execution paths can reduce ordinary request cost.

Placement: Part 8: Architectural case studies and synthesis.

Prerequisites: Lesson 44: RocksDB and Cassandra, plus the earlier dependency chain.

Learning outcomes

  • Explain how in-memory representation and short execution paths can reduce ordinary request cost.
  • Distinguish command execution from networking, persistence, replication, and background work.
  • Evaluate memory capacity, hot-key occupancy, large commands, and acknowledgment contracts.
  • Separate a general mechanism, a documented implementation choice, and an illustrative numerical assumption.

Teaching sequence

  1. Establish the motivating situation: An application treats an evictable cache as the only record of ownership.
  2. Introduce the vocabulary and the correctness obligation before an optimization. Define memory-first execution, command costs, persistence.
  3. Develop the mechanism: Trace cache and authoritative configurations separately, including restart, fork, expiration, and failover.
  4. Follow the complete worked example: 100 million values at 64 bytes each need 6.4 GB for payload alone. Explain the assumptions, intermediate units, and limiting interpretation.
  5. Extend the scenario to changed load, skew, or failure, explaining eviction, clustering, hot keys.
  6. Connect the mechanism to a documented implementation and an alternative with a different workload fit. Close by stating the remaining cost and the next lesson dependency.

Required chapter material

Use a complete execution trace or worked calculation, supported by an annotated static diagram or table. Include language-neutral pseudocode or labeled SQL when it clarifies the mechanism. State preconditions, ownership, visibility, and failure boundaries for algorithms. Describe operational costs as well as the normal path. All questions raised in the narrative must be resolved in the text.

Visual explanation

A command lifecycle timeline separates queue, execution, reply, persistence, and replica progress; a memory budget includes value bytes and structural overhead. The accompanying prose explains the arrows, state changes, or table entries so the lesson remains understandable in a plain Markdown reader.

Editorial checks

Confirm that the numerical example agrees with its units and assumptions. Check that a faster path preserves the stated contract, or explicitly identify the changed guarantee. Keep hypothetical figures separate from product measurements. Explain both an appropriate use and a limitation of the case design. Check terminology against the glossary and links against the course index.

Primary source set

Read the lesson · Curriculum