HARD

Distributed Cache

Design cache layer supporting millions of QPS with high hit rate.

Estimated Time: 90 minutes
#caching#scale

Solution Overview

Redis uses in-memory hash tables with persistence via RDB snapshots or AOF logs. Skip lists provide O(log n) operations. Pub/Sub pattern for real-time messaging. Multiple data structures: strings, lists, sets, sorted sets, hashes.

Architecture Pattern

In-memory data structure store with persistence and pub/sub

Key Concepts

Hash TablesSkip ListsReplicationLua ScriptingAOF

Used By Companies

TwitterUberShopify

Learn Implementation Details

Explore a complete guide for building this system from scratch with step-by-step tutorials:

Solution Overview

Redis uses in-memory hash tables with persistence via RDB snapshots or AOF logs. Skip lists provide O(log n) operations. Pub/Sub pattern for real-time messaging. Multiple data structures: strings, lists, sets, sorted sets, hashes.

Companies
  • •Twitter
  • •Uber
  • •Shopify
Key Concepts
  • •Hash Tables
  • •Skip Lists
  • •Replication
  • •Lua Scripting
  • •AOF
Implementation Url

https://github.com/codecrafters-io/build-your-own-x#build-your-own-redis