Redis
Definition
In-memory data structure store used as a database, cache, and message broker, known for its high performance and support for various data types.
Use Cases
- GitHub: Caching and background job coordination to keep web requests fast and offload work asynchronously — GitHub has publicly discussed using Redis in its architecture, including using Redis as part of its caching and job/queue patterns (commonly via Redis-backed libraries) to reduce database load and coordinate background processing. (Lower latency for frequently accessed data and improved throughput by moving non-interactive work to background processing, helping the application remain responsive under high traffic.)
- Shopify: Caching hot data and supporting high-throughput application components during traffic spikes (e.g., flash sales) — Shopify has publicly referenced using Redis in its stack for performance-sensitive workloads, commonly as a cache layer to reduce repeated database reads and speed up request handling. (Faster page and API responses and reduced pressure on primary databases during peak load, improving customer experience and platform stability.)
Provider Equivalents
- AWS: Amazon ElastiCache for Redis
- Azure: Azure Cache for Redis
- GCP: Memorystore for Redis
- OCI: OCI Cache with Redis
Frequently Asked Questions
- What's the difference between Redis and Memcached?
- Memcached is a simple in-memory key-value cache (mostly strings) focused on caching only. Redis is an in-memory data structure store that supports richer data types (strings, hashes, lists, sets, sorted sets, streams), persistence options (saving to disk), replication, and features like pub/sub. If you only need basic caching, Memcached can be enough; if you need more capabilities (sessions, counters, queues, rate limiting, leaderboards), Redis is often a better fit.
- When should I use Redis?
- Use Redis when you need very fast reads/writes and can benefit from keeping data in memory. Common cases include caching database query results, storing user sessions, rate limiting (e.g., login attempts per minute), real-time counters and leaderboards, distributed locks, and lightweight queues/streams for background work. Avoid using Redis as the only system of record for critical data unless you design for persistence, backups, and failure scenarios.
- How much does Redis cost?
- Cost depends on how you run it. Self-managed Redis on a VM mainly costs compute, storage (if persistence is enabled), and operations time. Managed services (Amazon ElastiCache for Redis, Azure Cache for Redis, Google Memorystore for Redis, OCI Cache with Redis) are typically priced by node size (memory/CPU), number of nodes/replicas, region, network traffic, and optional features like clustering, high availability, backups, and reserved capacity/commitment discounts. The biggest cost drivers are required memory size, high availability (replicas across zones), and throughput needs.
Category: data
Difficulty: intermediate
Related Terms
See Also