Concept Flow - AOF rewrite process
Start AOF Rewrite
Fork Child Process
Child: Create New AOF File
Parent: Continue Accepting Commands
Parent: Buffer New Commands
Child: Write Current DB State to New AOF
Child: Finish Writing New AOF
Child: Notify Parent
Parent: Append Buffered Commands to New AOF
Parent: Replace Old AOF with New AOF
End AOF Rewrite
The AOF rewrite process forks a child to create a compacted AOF file while the parent continues to serve clients, then merges buffered commands and replaces the old AOF.