Redis data types
Redis isn't just a key-value store — it's a data-structure server. Instead of only storing opaque blobs, the keys hold native structures and Redis runs atomic operations on them in-process. The core set: Strings (raw bytes, up to 512MB — also used as atomic counters via INCR); Lists (linked lists, O(1) push/pop from either end — great for queues and timeline feeds); Hashes (key→field→value maps — store objects compactly, update single fields atomically); Sets (unique unordered members, set operations across keys); Sorted Sets (members with scores, O(log n) range queries by score — leaderboards, time-ordered indexes, rate limiters); Streams (append-only logs with consumer groups — a mini-Kafka). The power is in the operations being native and atomic — you don't pull data to the app, mutate, and push back; you tell Redis "increment", "push if not exists", "range by score", and it does it in place.