Header (12 bytes):
- Magic: "VCDBMBT\0" (8 bytes)
- Type: 1 byte
- Version: 1 byte
- Reserved: 2 bytes
Records:
- Type: 1 byte (Upsert/Remove/SetAttrs)
- Reserved: 1 byte
- ID: 8 bytes
- AttrsLen: 4 bytes
- VectorLen: 4 bytes
- Attrs: JSON UTF-8
- Vector: Float32 array
Footer (8 bytes, optional):
- Magic: "WCRC" (4 bytes)
- CRC32: 4 byteslet writer = WalWriter::new()
writer.write_upsert(id, vector, attrs)
let bytes = writer.finalize()pub struct AsyncWalRuntime[S] {
storage : S
path : String
kind : StorageKind
data : Bytes
record_count : Int
loaded : Bool
}async fn[S : AsyncStorage] AsyncWalRuntime::append(self : AsyncWalRuntime[S], records : Array[WalRecord]) -> Unitasync fn[S : AsyncStorage] AsyncWalRuntime::replay_into(self : AsyncWalRuntime[S], store : CoreStore) -> Intpub struct WalRecord {
record_type : WalRecordType
id : VectorId
attrs : Attrs?
vector : Array[Double]?
timestamp : Int64
} derive(Debug)impl Show for WalRecordTypefn encode_wal_footer(body : Bytes) -> Bytesfn max_wal_timestamp(data : Bytes) -> Int64fn merge_wal(existing : Bytes, new_segment : Bytes) -> Bytesfn verify_wal_checksum(data : Bytes) -> Boollet wal_footer_magic : UIntHigh-performance vector database with multiple ANN algorithms
Dependencies