Redis easy
Given that Redis is an in-memory database, what is the default behavior when the physical host server undergoes a sudden power failure?
- A The data is automatically synced to a globally redundant cloud backup in real-time.
- B The raw RAM data is lost unless persistence (RDB or AOF) was configured to save to disk.
- C Redis leverages an internal capacitor-based battery to flush RAM to an SSD during a crash.
- D The OS kernel preserves the Redis memory segment in the system swap file for later use.
Answer: B. The raw RAM data is lost unless persistence (RDB or AOF) was configured to save to disk.
RAM is volatile. Without persistence, data vanishes on reboot. Redis offers RDB (Snapshots) and AOF (Logs) to periodically or continuously save the state to the hard drive for durability.
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?