Pick the fix
You store user sessions in Redis. Losing about a second of session updates on a crash is fine. Persistence setting?
Hint 1 of 1
How much loss is acceptable?
Choose an answer, then open Show answer below to check it.
Show answer
Answer: A AOF with appendfsync everysec (plus RDB for backups)
Correct. Bounded loss of about a second at modest cost.
With appendfsync everysec, Redis fsyncs the append-only file about once a second, so a crash loses at most about a second of writes. That matches what sessions can tolerate without paying for an fsync per write.
Why not the others?
- B appendfsync always. Much slower for a guarantee sessions don't need.
- C No persistence. A restart logs everyone out.
- D RDB every hour only. Could lose an hour of sessions.