Một mục phía máy chủ trong kho dữ liệu GitHub của TopGit: dgraph-io/badger, 15.7k sao, nhóm Backend, Go. Fast key-value DB in Go.
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
BadgerDB is an embeddable, persistent and fast key-value (KV) database written in pure Go. It is the
underlying database for Dgraph, a fast, distributed graph
database. It's meant to be a performant alternative to non-Go-based key-value stores like RocksDB.
Project Status
Badger is stable and is being used to serve data sets worth hundreds of terabytes. Badger supports
concurrent ACID transactions with serializable snapshot isolation (SSI) guarantees. A Jepsen-style
bank test runs nightly for 8h, with --race flag and ensures the maintenance of transactional
guarantees. Badger has also been tested to work with filesystem level anomalies, to ensure
persistence and consistency. Badger is being used by a number of projects which includes Dgraph,
Jaeger Tracing, UsenetExpress, and many more.
The list of projects using Badger can be found here.
Please consult the Changelog for more detailed information on releases.
Note: Badger is built with go 1.23 and we refrain from bumping this version to minimize downstream
effects of those using Badger in applications built with older versions of Go.
Table of Contents
BadgerDB
Project Status
Table of Contents
Getting Started
Installing
Installing Badger Command Line Tool
Choosing a version
Badger Documentation
Resources
Blog Posts
Design
Comparisons
Benchmarks
Projects Using Badger
Contributing
Contact
Getting Started
Installing
To start using Badger, install Go 1.23 or above. Badger v3 and above needs go modules. From your
project, run the following command
go get github.com/dgraph-io/badger/v4
This will retrieve the library.
Installing Badger Command Line Tool
Badger provides a CLI tool which can perform certain operations like offline backup/restore. To
install the Badger CLI, retrieve the repository and checkout the desired version. Then run
cd badger
go install .
This will install the badger command line utility into your $GOBIN path.
Badger Documentation
Badger Documentation is available at https://badger.dgraph.io
Resources
Blog Posts
Introducing Badger: A fast key-value store written natively in Go
Make Badger crash resilient with ALICE
Badger vs LMDB vs BoltDB: Benchmarking key-value databases in Go
Concurrent ACID Transactions in Badger
Design
Badger was written with these design goals in mind:
Write a key-value database in pure Go.
Use latest research to build the fastest KV database for data sets spanning terabytes.
Optimize for SSDs.
Badger’s design is based on a paper titled WiscKey: Separating Keys from Values in SSD-conscious
Storage.
Comparisons
Feature
Badger
RocksDB
BoltDB
Design
LSM tree with value log
LSM tree only
B+ tree
High Read throughput
Yes
No
Yes
High Write throughput
Yes
Yes
No
Designed for SSDs
Yes (with latest research 1)
Not specifically 2
No
Embeddable
Yes
Yes
Yes
Sorted KV access
Yes
Yes
Yes
Pure Go (no Cgo)
Yes
No
Yes
Transactions
Yes, ACID, concurrent with SSI3
Yes (but non-ACID)
Yes, ACID
Snapshots
Yes
Yes
Yes
TTL support
Yes
Yes
No
3D access (key-value-version)
Yes4
No
No
1 The WISCKEY paper (on which Badger is based) saw big wins with separating
values from keys, significantly reducing the write amplification compared to a typical LSM tree.
2 RocksDB is an SSD optimized version of LevelDB, which was designed specifically for
rotating disks. As such RocksDB's design isn't aimed at SSDs.
3 SSI: Serializable Snapshot Isolation. For more details, see the blog post
Concurrent ACID Transactions in Badger
4 Badger provides direct access to value versions via its Iterator API. Users can also
specify how many versions to keep per key via Options.
Benchmarks
We have run comprehensive benchmarks against RocksDB, Bolt and LMDB. The benchmarking code, and the
detailed logs for the benchmarks can be found in the badger-bench repo. More explanation,
including graphs can be found the blog posts (linked above).
Projects Using Badger
Below is a list of known projects that use Badger:
Dgraph - Distributed graph database.
Jaeger - Distributed tracing platform.
go-ipfs - Go client for the InterPlanetary File System (IPFS),
a new hypermedia distribution protocol.
Riot - An open-source, distributed search engine.
emitter - Scalable, low latency, distributed pub/sub
broker with message storage, uses MQTT, gossip and badger.
OctoSQL - Query tool that allows you to join, analyse and
transform data from multiple databases using SQL.
Sloop - Salesforce's Kubernetes History Visualization
Project.
Usenet Express - Serving over 300TB of data with Badger.
gorush - A push notification server written in Go.
0-stor - Single device object store.
Dispatch Protocol - Blockchain protocol for distributed
application data analytics.
GarageMQ - AMQP server written in Go.
RedixDB - A real-time persistent key-value store with the
same redis protocol.
BBVA - Raft backend implementation using BadgerDB for
Hashicorp raft.
Fantom - aBFT Consensus platform for
distributed applications.
decred - An open, progressive, and self-funding
cryptocurrency with a system of community-based governance integrated into its blockchain.
OpenNetSys - Create useful dApps in any software language.
HoneyTrap - An extensible and opensource system for
running, monitoring and managing honeypots.
Insolar - Enterprise-ready blockchain platform.
IoTeX - The next generation of the decentralized
network for IoT powered by scalability- and privacy-centric blockchains.
go-sessions - The sessions manager for Go net/http and
fasthttp.
Babble - BFT Consensus platform for distributed
applications.
Tormenta - Embedded object-persistence layer / simple JSON
database for Go projects.
BadgerHold - An embeddable NoSQL store for querying Go
types built on Badger
Goblero - Pure Go embedded persistent job queue backed by
BadgerDB
Surfline - Serving global wave and weather forecast data with Badger.
Cete - Simple and highly available distributed key-value store
built on Badger. Makes it easy bringing up a cluster of Badger with Raft consensus algorithm by
hashicorp/raft.
Volument - A new take on website analytics backed by Badger.
KVdb - Hosted key-value store and serverless platform built on top of Badger.
Terminotes - Self hosted notes storage and search
server - storage powered by BadgerDB
Pyroscope - Open source continuous profiling platform
built with BadgerDB
Veri - A distributed feature store optimized for Search and
Recommendation tasks.
bIter - A library and Iterator interface for working with
the badger.Iterator, simplifying from-to, and prefix mechanics.
ld - (Lean Database) A very simple gRPC-only key-value
database, exposing BadgerDB with key-range scanning semantics.
Souin - A RFC compliant HTTP cache with lot of other features
based on Badger for the storage. Compatible with all existing reverse-proxies.
Xuperchain - A highly flexible blockchain architecture
with great transaction performance.
m2 - A simple http key/value store based on the raft protocol.
chaindb - A blockchain storage layer used by
Gossamer, a Go client for the
Polkadot Network.
vxdb - Simple schema-less Key-Value NoSQL database with
simplest API interface.
Opacity - Backend implementation for the Opacity
storage project
Vephar - A minimal key/value store using hashicorp-raft
for cluster coordination and Badger for data storage.
gowarcserver - Open-source server for warc files. Can be
used in conjunction with pywb
flow-go - A fast, secure, and developer-friendly blockchain
built to support the next generation of games, apps and the digital assets that power them.
Wrgl - A data version control system that works like Git but specialized to
store and diff CSV.
Loggie - A lightweight, cloud-native data transfer agent
and aggregator.
raft-badger - raft-badger implements LogStore and
StableStore Interface of hashcorp/raft. it is used to store raft log and metadata of
hashcorp/raft.
DVID - A dataservice for branched versioning of a variety
of data types. Originally created for large-scale brain reconstructions in Connectomics.
KVS - A library for making it easy to persist, load and query
full structs into BadgerDB, using an ownership hierarchy model.
LLS - LLS is an efficient URL Shortener that can be used to
shorten links and track link usage. Support for BadgerDB and MongoDB. Improved performance by more
than 30% when using BadgerDB
lakeFS - lakeFS is an open-source data version control that
transforms your object storage to Git-like repositories. lakeFS uses BadgerDB for its underlying
local metadata KV store implementation
Goptivum - Goptivum is a better frontend and API for the
Vulcan Optivum schedule program
ActionManager - A dynamic entity manager based on rjsf schema
and badger db
MightyMap - Mightymap: Conveys both robustness
and high capability, fitting for a powerful concurrent map.
FlowG - A low-code log processing facility
Bluefin - Bluefin is a TUNA Proof of Work miner for the
Fortuna smart contract on the Cardano blockchain
cDNSd - A Cardano blockchain backed DNS server daemon
Dingo - A Cardano blockchain data node
If you are using Badger in a project please send a pull request to add it to the list.
Platform Compatibility
Badger uses OS-specific implementations for directory locking and fsync operations. On
POSIX-compliant systems (Linux, macOS, BSD), these work as expected.
For non-POSIX platforms, be aware of potential limitations:
Platform
File
Notes
AIX
dir_aix.go
Directory fsync not supported; durability on crash may be affected
Windows
dir_windows.go
Uses different locking mechanism
Plan9
dir_plan9.go
No file locking support
WASM/JS
dir_other.go
No file locking support
If you encounter issues on these platforms, review the corresponding dir_*.go source file for
implementation details.
Contributing
If you're interested in contributing to Badger see CONTRIBUTING.
Contact
Please use Github issues for filing bugs.
Please use Discussions for questions,
discussions, and feature requests.
dgraph-io/badger thuộc nhóm Backend trên TopGit, cùng 7 topic GitHub. Trang Trending và Topics liệt kê các repo cùng số sao và cùng ngôn ngữ để so sánh.
dgraph-io/badger có bao nhiêu sao?
dgraph-io/badger có 15.7k sao GitHub — tải lại trang để xem số mới nhất, hoặc xem trực tiếp github.com/dgraph-io/badger. TopGit phản chiếu số sao của GitHub nhưng không cam kết đến từng phút.
dgraph-io/badger có những chủ đề gì?
GitHub topics của dgraph-io/badger: "database", "document-database", "go", "golang", "key-value", "library", "ssd". TopGit xếp repo vào nhóm Backend.
dgraph-io/badger có phải mã nguồn mở không?
Có — dgraph-io/badger phát hành theo license Apache-2.0, nghĩa là mã nguồn mở để đọc, fork và (tùy license) tái sử dụng. Mã: github.com/dgraph-io/badger.
dgraph-io/badger có trang demo không?
Dự án có trang chủ ở https://dgraph-io.github.io/badger/. Tab "Readme" ở trang này thường có ảnh chụp và hướng dẫn bắt đầu nhanh.
dgraph-io/badger còn đang phát triển không?
Commit gần nhất trên dgraph-io/badger là 22 ngày trước (theo timestamp GitHub). Repo có 1.3k fork — một chỉ báo về mức độ quan tâm của cộng đồng.
Đọc thêm về dgraph-io/badger ở đâu?
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/dgraph-io/badger là nguồn chính thức.
Đọc đầy đủ README ở tab phía trên.
Muốn nghe thêm một ý kiến về badger?
Hỏi một AI đọc được trang này — một cú bấm là có ngay nhận định về badger.