LSM-Tree based storage engine used by FOIVER system.
go get -u github.com/B1NARY-GR0UP/originium
package main
import (
"log"
"github.com/B1NARY-GR0UP/originium"
)
func main() {
// Use originium.Config to customize your db behavior
db, err := originium.Open("your-dir", originium.DefaultConfig)
if err != nil {
log.Fatal(err)
}
defer db.Close()
// ...
}
ORIGINIUM supports concurrent ACID transactions with Serializable Snapshot Isolation (SSI) guarantees.
- Read-only transaction
err := db.View(func(txn *originium.Txn) error {
// ...
res, ok := txn.Get("hello")
if !ok {
// key not found
}
// ...
return nil
})
- Read-write transaction
err := db.Update(func(txn *originium.Txn) error {
// ...
if err := txn.Set("hello", []byte("originium")); err != nil {
return err
}
// ...
return nil
})
- Manually
// start a read-write transaction manually
txn := db.Begin(true)
defer txn.Discard()
// ...
if err := txn.Delete("hello"); err != nil {
return err
}
// ...
if err := txn.Commit(); err != nil {
return err
}
- How to Implement Serializable Snapshot Isolation for Transactions
- Building an LSM-Tree Storage Engine from Scratch
Sincere appreciation to the following repositories that made the development of ORIGINIUM possible.
ORIGINIUM is distributed under the Apache License 2.0. The licenses of third party dependencies of ORIGINIUM are explained here.
ORIGINIUM is Part of PROJECT: FOIVER