Redis persistence
Redis is an in-memory database, but you can configure it to persist so you don't lose everything on restart. Two mechanisms, usually combined: RDB snapshots — a point-in-time binary dump to disk, fast to save and load, but you can lose the changes since the last snapshot on crash (configurable, e.g. "save every 5 min if 100+ keys changed"); AOF (Append-Only File) — a log of every write operation, replayed on restart, configurable fsync policy from every-write (safest, slowest) to every-second (the sweet spot — max ~1s data loss). RDB + AOF together is the default modern recommendation — RDB gives you fast reboots from a snapshot, AOF covers the window since. The question to ask yourself: is this Redis a cache (lose everything is fine, skip persistence entirely) or a primary store for this data (AOF with fsync every second)? Mixing the two — "cache that must survive restarts" — is where people trip, usually because they didn't size the persistence cost into the latency budget.