Skip to main content

Module aof

Module aof 

Source
Expand description

Append-only file for recording mutations.

Each shard writes its own AOF file (shard-{id}.aof). Records are written after successful mutations. The binary format uses a simple tag + payload + CRC32 structure for each record.

File layout:

[EAOF magic: 4B][version: 1B]
[record]*

Record layout:

[tag: 1B][payload...][crc32: 4B]

The CRC32 covers the tag + payload bytes.

Structs§

AofReader
Reader for iterating over AOF records.
AofWriter
Buffered writer for appending AOF records to a file.

Enums§

AofRecord
A single mutation record stored in the AOF.
FsyncPolicy
Configurable fsync policy for the AOF writer.

Functions§

aof_path
Returns the AOF file path for a given shard in a data directory.