Skip to content

Latest commit

 

History

History
20 lines (15 loc) · 465 Bytes

README.md

File metadata and controls

20 lines (15 loc) · 465 Bytes

Embedded Write Ahead Log

Simple multi segment write ahead log. Writes two type of files files *.index and *.store. Configurable maximum index and store file sizes.

Files stucuture:

  • Index record structure: [recordID (8 bytes)][recordOffset (8 bytes)]
  • Store record structure: [size (8 bytes)][data (variable bytes)]

Usage example

wl, _ := wal.New(".", nil)
offset, _ := wl.Append(data)
data, _ := wl.Read(offset)
wl.Close()