Blog
Mert Özen's blog posts on software development, backend, frontend, and DevOps.
Redis Persistence and Memory Management: RDB, AOF, fsync, Fork Cost, maxmemory and Big/Hot Keys
The official redis:8 image takes only periodic RDB snapshots by default; if the container dies with SIGKILL everything after the last snapshot is gone, while with AOF everysec no order was lost in the measurement. With real output: fork and copy-on-write cost, turning on AOF without losing data, Redis 8.10's BACKUP command, noeviction protecting a stream, OOMKilled, UNLINK, HOTKEYS and the activedefrag threshold.
Redis Hashes: Storing Objects, Field Expiration and Memory Efficiency
A small Redis hash lives in the listpack encoding and holds the same cart in half the memory of a JSON string and well under half of separate keys; the 513th field or a single 65-byte value turns it into a hashtable and multiplies memory by 3.4. With real output: Bookstore's cart with HashEntry, choosing between a hash and JSON, a per-field price lock with HEXPIRE and HSETEX, Valkey's encoding difference, Redis 8.10's compact hashes via HIMPORT, and a 44 ms HGETALL on a huge hash.