fivenines

Practice / target 80%

AOF Persistence Practice

01

A write succeeds in memory but the process crashes before fsync. How does the answer differ under `always`, `everysec`, and `no`?

intro

Scenario

You are reasoning about the durability guarantees of the append-only file under different fsync policies.

02

Why should `GET a` never appear in AOF, but `EXPIRE a 60` might?

intro

Scenario

You are deciding which commands the AOF layer should record as the server executes them.

03

During AOF rewrite, why is `SET counter 42` a valid replacement for many earlier increments?

applied

Scenario

An AOF rewrite is compacting a log that contains thousands of INCR commands against one counter key.

04

What is dangerous about replaying a relative expiration after downtime?

applied

Scenario

A server was down for two hours and is now replaying its AOF, which contains expiration commands recorded before the outage.

05

Which part of AOF persistence is about correctness, and which part is about file size?

advanced

Scenario

You are explaining to a teammate which AOF mechanisms protect data and which mechanisms only manage operational cost.