❗ the project is still under development, and the current version is 0.0.0
- Bamboo is a simple, high-performance, and reliable open-source DB engine for key-value storage.
- Bamboo is written in Go, based on the Bitcask model, which supports Riak-KV
- Bamboo symbolizes rapid unidirectional growth, which is similar to the characteristics of a log-structured database.
- Below is a simple example of using Bamboo to store data.
package main
import (
bamboo "bamboo/db"
"fmt"
)
func main() {
opts := bamboo.DefaultOptions
opts.DataDir = "/tmp/bamboo-demo"
db, err := bamboo.CreateDB(opts)
if err != nil {
panic(err)
}
err = db.Put([]byte("name"), []byte("bamboo"))
if err != nil {
panic(err)
}
val, err := db.Get([]byte("name"))
if err != nil {
panic(err)
}
fmt.Println("val = ", string(val))
}
- Only One-Time Disk IO: Whether it is
GET
,PUT
, orDELETE
, this storage engine has at most one disk IO operation, thus ensuring high speed and predictable latency. - Multiple Indexer: Users can use different indexers to store data, such as
art-tree
andbtree
. - Quick Rebuild: Use
MMap
to quickly rebuild the index when the database is opened.
- the benchmark is based on the
Btree
indexer, and the test environment is aE5-2696v4
CPU,512G
memory, and10T
HDD.
Operation | Time (ns/op) | Memory (B/op) | Allocs (allocs/op) |
---|---|---|---|
Write | 50423 | 4673 | 11 |
Read | 1231 | 72 | 3 |
Delete | 853 | 72 | 3 |
- Support for Multiple Data Types: In the future, Bamboo will support more data types, such as
list
,set
, andhash
. - More Benchmark: In the future, Bamboo will support more benchmark tests, such as
YCSB
. - Disk IO Optimization: In the future, Bamboo will support more disk IO optimization, such as
WAL
.