Redis medium
An application requires high durability for its Redis data, minimizing loss during a crash. Which persistence configuration is most appropriate?
- A RDB (Redis Database File): Periodic Point-in-Time snapshots of the entire dataset at specified intervals.
- B AOF (Append Only File): Logging every write operation and using `fsync` every second for safety.
- C Memory Only: Disabling all persistence to maximize raw throughput for ephemeral session data.
- D Standard Replication: Relying solely on asynchronous replica nodes to maintain a copy of the RAM state.
Answer: B. AOF (Append Only File): Logging every write operation and using `fsync` every second for safety.
RDB is a snapshot (e.g., every 5 minutes), risking 5 minutes of data loss. AOF logs every write. Fsyncing every second is the standard compromise, providing high durability with manageable performance overhead.
One system design question a day, with spaced repetition so the ones you miss come back.
Get the appRelated questions
- If the Redis memory limit is reached, what specific behavior is exhibited by the `allkeys-lru` eviction policy?
- What is the defining characteristic of a Redis 'Set' data type compared to a standard Redis 'List'?
- In the context of Redis messaging, what is the functional definition of the 'Pub/Sub' feature?
- How does the Redis background snapshotting process (`BGSAVE`) leverage the operating system's `fork()` mechanism to minimize memory overhead?
- Why does Redis proactively disconnect a Pub/Sub client that exhibits high 'output buffer' usage relative to its ingestion rate?
- How does a 'Sorted Set' (ZSET) manage its internal membership and ordering differently from a plain Set?