In-memory data store — caching, sessions, pub/sub, real-time features
Redis is the default choice for caching at every Indian tech company at scale. Used for: API response caching (reduces database load), session storage (faster than database), pub/sub messaging (real-time features), rate limiting, leaderboards, and real-time analytics. Open-source and free to self-host. Managed services (Redis Cloud, AWS ElastiCache) start at ₹600/month. If you're scaling beyond a single database, you'll need Redis. Non-negotiable for any production system handling high traffic.
Redis (Remote Dictionary Server) is an open-source, in-memory data store developed in 2009. It stores data as key-value pairs in RAM, making reads/writes extremely fast (sub-millisecond latency). Redis supports various data structures: strings, hashes, lists, sets, sorted sets, and streams.
Redis is used for: (1) Caching API responses and database queries, (2) Session storage, (3) Pub/Sub messaging, (4) Real-time leaderboards, (5) Rate limiting, (6) Distributed locking, (7) Real-time analytics. It's the most widely used cache globally — 50,000+ GitHub stars, used by virtually every tech company above 1000 users.
Quick facts: Open-source (BSD license) · In-memory · Sub-millisecond latency · Data structures beyond strings · Persistence options (RDB, AOF) · Pub/Sub messaging · Cluster for scaling · Sentinel for HA
Cache expensive database queries or API calls in Redis. Return cached results in milliseconds instead of hitting the database every time. Massive reduction in database load.
Store user sessions in Redis instead of database. Much faster session lookup on every request. Standard pattern for web applications.
Real-time message broadcasting for chat, notifications, live feeds. Publishers send messages to channels, subscribers receive instantly.
Sorted sets in Redis make leaderboard queries instant. Update rankings, fetch top 10 users, get user rank — all in milliseconds.
Track request counts per user/IP in Redis. Implement rate limits (1000 requests/hour) without querying database.
Use Redis Streams for event logging. Count page views, track user actions, build real-time dashboards without complex data pipelines.
Redis is free open-source. Managed services vary.