Used by Popular Projects such as

See the complete list here

The Only Key-Value Store You'll Ever Need

Built for performance, Badger is everything you are looking for in a Key-Value store.

FAST

Insert data at the speed of 160 MB/s

CRASH RESILIENT

The Write Ahead Log ensures your data is safe and sound

OPTIMIZED FOR SSD

Separation of Key-Value enables faster reads

LOADED WITH BATTERIES

Supports Compression, Encryption, TTL and more

Badger is Easy To Use

Step 1. Open a new Badger instance

func main() {// Open the Badger database located in the /tmp/badger directory.// It will be created if it doesn't exist.db, err := badger.Open(badger.DefaultOptions("/tmp/badger"))if err != nil {log.Fatal(err)}defer db.Close()}

Step 2. Create a read-write transaction

err := db.Update(func(txn *badger.Txn) error {// Your code here.return nil})

Step 3. Insert a key using the Set operation

err := db.Update(func(txn *badger.Txn) error {return txn.Set([]byte("answer"), []byte("42"))})

Step 4. Fetch the inserted key using the Get operation

err := db.View(func(txn *badger.Txn) error {item, err := txn.Get([]byte("answer"))// Use item here.})

Why Choose Badger?

Speed, Speed, and More Speed

Badger was built for performance. Writing data at the speed of 160 MB/s and reading it at 80 MB/s, Badger is the fastest LSM Tree-based Key-Value Store written in Go.

Transaction and Data Guarantees

Badger supports concurrent ACID transactions with serializable snapshot isolation (SSI) guarantees. The Write Ahead Log ensures you never lose data.

Stream Framework and Managed Mode

Building systems on top of Badger is easy with the Stream framework which allows bulk reading and writing of data by leveraging the power of Goroutines. The managed mode allows systems to take control of the transactions while Badger takes care of everything else.

Batteries Included

A LRU Cache and support for Compression, Encryption, Time To Live (TTL), Badger comes with everything that you need from a Key-Value store.