This is a simple key value store following the basic ideas described in Designing Data-Intensive Applications and articles I read.
This is an educational project, and has no other purpose. It will evolve it to use other techniques as I learn more about the theory.
The starting design is the one used by Bitcask (default storage engine in Riak) (paper). Check the original design for trade-offs.
- CRC is not used
- Locking of the directory
- It creates a new append file in each startup, no matter if the previous closed RO file is small. Hopefully compaction will take care of that
- go 1.15 or later is required
store, err := NewStore()
defer store.Close()
err = store.Set([]byte("Key1"), []byte("Value 1"))
if err != nil {
log.Println(err)
}
Get a value:
value, err := store.Get([]byte("Key1"))
if err != nil {
log.Println(err)
}
- Duncan Mac-Vicar P.
- MIT