Open Source
10 items
10 items
The Swiss Army knife of caching, messaging, and real-time data that powers Twitter, GitHub, and Stack Overflow
Redis is an in-memory data structure server that supports strings, hashes, lists, sets, sorted sets, streams, and more. Its single-threaded architecture eliminates locking overhead, achieving millions of operations per second. Beyond caching, Redis serves as a message broker, real-time leaderboard, session store, and rate limiter. The key insight: by keeping data in memory and using efficient data structures, Redis achieves microsecond latency that disk-based databases cannot match.
Redis processes commands in a single thread, eliminating lock contention and context switching. This makes reasoning about atomicity trivial -each command executes completely before the next begins. The bottleneck is usually network I/O, not CPU.
Unlike simple caches, Redis provides rich data structures (lists, sets, sorted sets, streams) with O(1) and O(log n) operations. You can LPUSH/RPOP for queues, ZADD/ZRANGE for leaderboards, and XADD/XREAD for event streams -all atomically.
Redis automatically switches between memory-efficient encodings based on data size. Small hashes use ziplists (contiguous memory), large ones use hash tables. This optimization happens transparently, saving 10x memory for small objects.
Redis (Remote Dictionary Server) was created by Salvatore Sanfilippo in 2009 to solve a specific problem: his real-time web analytics startup needed to handle high-velocity writes that MySQL couldn't keep up with.
The core insight was simple: memory is fast, disk is slow. By keeping all data in RAM and using efficient data structures, Redis achieves latency measured in microseconds -1000x faster than disk-based databases.
But Redis isn't just a cache. It's a data structure server. Where Memcached only stores strings, Redis provides:
Common use cases: