{"id":25040644,"url":"https://github.com/hypermodeinc/badger","last_synced_at":"2025-05-14T07:08:02.281Z","repository":{"id":37362590,"uuid":"80087836","full_name":"hypermodeinc/badger","owner":"hypermodeinc","description":"Fast key-value DB in Go.","archived":false,"fork":false,"pushed_at":"2025-05-07T04:28:06.000Z","size":58307,"stargazers_count":14514,"open_issues_count":22,"forks_count":1217,"subscribers_count":228,"default_branch":"main","last_synced_at":"2025-05-07T06:59:38.010Z","etag":null,"topics":["database","document-database","go","golang","key-value","library","ssd"],"latest_commit_sha":null,"homepage":"https://docs.hypermode.com/badger","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hypermodeinc.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2017-01-26T05:09:49.000Z","updated_at":"2025-05-07T04:28:08.000Z","dependencies_parsed_at":"2024-01-06T10:33:02.398Z","dependency_job_id":"c00672c1-e5e2-4d99-ba42-49cbdfc11a8d","html_url":"https://github.com/hypermodeinc/badger","commit_stats":{"total_commits":1349,"total_committers":177,"mean_commits":7.621468926553672,"dds":0.7472201630837658,"last_synced_commit":"fb1b009595813ae6dabd11628281568c8537f7fd"},"previous_names":["hypermodeinc/badger","dgraph-io/badger"],"tags_count":65,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hypermodeinc%2Fbadger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hypermodeinc%2Fbadger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hypermodeinc%2Fbadger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hypermodeinc%2Fbadger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hypermodeinc","download_url":"https://codeload.github.com/hypermodeinc/badger/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254092650,"owners_count":22013290,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["database","document-database","go","golang","key-value","library","ssd"],"created_at":"2025-02-06T03:02:39.509Z","updated_at":"2025-05-14T07:08:02.272Z","avatar_url":"https://github.com/hypermodeinc.png","language":"Go","readme":"# BadgerDB\n\n[![Go Reference](https://pkg.go.dev/badge/github.com/dgraph-io/badger/v4.svg)](https://pkg.go.dev/github.com/dgraph-io/badger/v4)\n[![Go Report Card](https://goreportcard.com/badge/github.com/dgraph-io/badger/v4)](https://goreportcard.com/report/github.com/dgraph-io/badger/v4)\n[![Sourcegraph](https://sourcegraph.com/github.com/hypermodeinc/badger/-/badge.svg)](https://sourcegraph.com/github.com/hypermodeinc/badger?badge)\n[![ci-badger-tests](https://github.com/hypermodeinc/badger/actions/workflows/ci-badger-tests.yml/badge.svg)](https://github.com/hypermodeinc/badger/actions/workflows/ci-badger-tests.yml)\n[![ci-badger-bank-tests](https://github.com/hypermodeinc/badger/actions/workflows/ci-badger-bank-tests.yml/badge.svg)](https://github.com/hypermodeinc/badger/actions/workflows/ci-badger-bank-tests.yml)\n[![ci-badger-bank-tests-nightly](https://github.com/hypermodeinc/badger/actions/workflows/ci-badger-bank-tests-nightly.yml/badge.svg)](https://github.com/hypermodeinc/badger/actions/workflows/ci-badger-bank-tests-nightly.yml)\n\n![Badger mascot](images/diggy-shadow.png)\n\nBadgerDB is an embeddable, persistent and fast key-value (KV) database written in pure Go. It is the\nunderlying database for [Dgraph](https://github.com/hypermodeinc/dgraph), a fast, distributed graph database. It's meant\nto be a performant alternative to non-Go-based key-value stores like RocksDB.\n\n## Project Status\n\nBadger is stable and is being used to serve data sets worth hundreds of terabytes. Badger supports\nconcurrent ACID transactions with serializable snapshot isolation (SSI) guarantees. A Jepsen-style\nbank test runs nightly for 8h, with `--race` flag and ensures the maintenance of transactional\nguarantees. Badger has also been tested to work with filesystem level anomalies, to ensure\npersistence and consistency. Badger is being used by a number of projects which includes Dgraph,\nJaeger Tracing, UsenetExpress, and many more.\n\nThe list of projects using Badger can be found [here](#projects-using-badger).\n\nPlease consult the [Changelog] for more detailed information on releases.\n\n[Changelog]: https://github.com/hypermodeinc/badger/blob/main/CHANGELOG.md\n\n## Table of Contents\n\n- [BadgerDB](#badgerdb)\n  - [Project Status](#project-status)\n  - [Table of Contents](#table-of-contents)\n  - [Getting Started](#getting-started)\n    - [Installing](#installing)\n      - [Installing Badger Command Line Tool](#installing-badger-command-line-tool)\n      - [Choosing a version](#choosing-a-version)\n  - [Badger Documentation](#badger-documentation)\n  - [Resources](#resources)\n    - [Blog Posts](#blog-posts)\n  - [Design](#design)\n    - [Comparisons](#comparisons)\n    - [Benchmarks](#benchmarks)\n  - [Projects Using Badger](#projects-using-badger)\n  - [Contributing](#contributing)\n  - [Contact](#contact)\n\n## Getting Started\n\n### Installing\n\nTo start using Badger, install Go 1.21 or above. Badger v3 and above needs go modules. From your\nproject, run the following command\n\n```sh\ngo get github.com/dgraph-io/badger/v4\n```\n\nThis will retrieve the library.\n\n#### Installing Badger Command Line Tool\n\nBadger provides a CLI tool which can perform certain operations like offline backup/restore. To\ninstall the Badger CLI, retrieve the repository and checkout the desired version. Then run\n\n```sh\ncd badger\ngo install .\n```\n\nThis will install the badger command line utility into your $GOBIN path.\n\n## Badger Documentation\n\nBadger Documentation is available at https://docs.hypermode.com/badger\n\n## Resources\n\n### Blog Posts\n\n1. [Introducing Badger: A fast key-value store written natively in Go](https://hypermode.com/blog/badger/)\n2. [Make Badger crash resilient with ALICE](https://hypermode.com/blog/alice/)\n3. [Badger vs LMDB vs BoltDB: Benchmarking key-value databases in Go](https://hypermode.com/blog/badger-lmdb-boltdb/)\n4. [Concurrent ACID Transactions in Badger](https://hypermode.com/blog/badger-txn/)\n\n## Design\n\nBadger was written with these design goals in mind:\n\n- Write a key-value database in pure Go.\n- Use latest research to build the fastest KV database for data sets spanning terabytes.\n- Optimize for SSDs.\n\nBadger’s design is based on a paper titled _[WiscKey: Separating Keys from Values in SSD-conscious\nStorage][wisckey]_.\n\n[wisckey]: https://www.usenix.org/system/files/conference/fast16/fast16-papers-lu.pdf\n\n### Comparisons\n\n| Feature                       | Badger                                     | RocksDB                       | BoltDB    |\n| ----------------------------- | ------------------------------------------ | ----------------------------- | --------- |\n| Design                        | LSM tree with value log                    | LSM tree only                 | B+ tree   |\n| High Read throughput          | Yes                                        | No                            | Yes       |\n| High Write throughput         | Yes                                        | Yes                           | No        |\n| Designed for SSDs             | Yes (with latest research \u003csup\u003e1\u003c/sup\u003e)    | Not specifically \u003csup\u003e2\u003c/sup\u003e | No        |\n| Embeddable                    | Yes                                        | Yes                           | Yes       |\n| Sorted KV access              | Yes                                        | Yes                           | Yes       |\n| Pure Go (no Cgo)              | Yes                                        | No                            | Yes       |\n| Transactions                  | Yes, ACID, concurrent with SSI\u003csup\u003e3\u003c/sup\u003e | Yes (but non-ACID)            | Yes, ACID |\n| Snapshots                     | Yes                                        | Yes                           | Yes       |\n| TTL support                   | Yes                                        | Yes                           | No        |\n| 3D access (key-value-version) | Yes\u003csup\u003e4\u003c/sup\u003e                            | No                            | No        |\n\n\u003csup\u003e1\u003c/sup\u003e The [WISCKEY paper][wisckey] (on which Badger is based) saw big wins with separating\nvalues from keys, significantly reducing the write amplification compared to a typical LSM tree.\n\n\u003csup\u003e2\u003c/sup\u003e RocksDB is an SSD optimized version of LevelDB, which was designed specifically for\nrotating disks. As such RocksDB's design isn't aimed at SSDs.\n\n\u003csup\u003e3\u003c/sup\u003e SSI: Serializable Snapshot Isolation. For more details, see the blog post\n[Concurrent ACID Transactions in Badger](https://hypermode.com/blog/badger-txn/)\n\n\u003csup\u003e4\u003c/sup\u003e Badger provides direct access to value versions via its Iterator API. Users can also\nspecify how many versions to keep per key via Options.\n\n### Benchmarks\n\nWe have run comprehensive benchmarks against RocksDB, Bolt and LMDB. The benchmarking code, and the\ndetailed logs for the benchmarks can be found in the [badger-bench] repo. More explanation,\nincluding graphs can be found the blog posts (linked above).\n\n[badger-bench]: https://github.com/dgraph-io/badger-bench\n\n## Projects Using Badger\n\nBelow is a list of known projects that use Badger:\n\n- [Dgraph](https://github.com/hypermodeinc/dgraph) - Distributed graph database.\n- [Jaeger](https://github.com/jaegertracing/jaeger) - Distributed tracing platform.\n- [go-ipfs](https://github.com/ipfs/go-ipfs) - Go client for the InterPlanetary File System (IPFS),\n  a new hypermedia distribution protocol.\n- [Riot](https://github.com/go-ego/riot) - An open-source, distributed search engine.\n- [emitter](https://github.com/emitter-io/emitter) - Scalable, low latency, distributed pub/sub\n  broker with message storage, uses MQTT, gossip and badger.\n- [OctoSQL](https://github.com/cube2222/octosql) - Query tool that allows you to join, analyse and\n  transform data from multiple databases using SQL.\n- [Dkron](https://dkron.io/) - Distributed, fault tolerant job scheduling system.\n- [smallstep/certificates](https://github.com/smallstep/certificates) - Step-ca is an online\n  certificate authority for secure, automated certificate management.\n- [Sandglass](https://github.com/celrenheit/sandglass) - distributed, horizontally scalable,\n  persistent, time sorted message queue.\n- [TalariaDB](https://github.com/grab/talaria) - Grab's Distributed, low latency time-series\n  database.\n- [Sloop](https://github.com/salesforce/sloop) - Salesforce's Kubernetes History Visualization\n  Project.\n- [Usenet Express](https://usenetexpress.com/) - Serving over 300TB of data with Badger.\n- [gorush](https://github.com/appleboy/gorush) - A push notification server written in Go.\n- [0-stor](https://github.com/zero-os/0-stor) - Single device object store.\n- [Dispatch Protocol](https://github.com/dispatchlabs/disgo) - Blockchain protocol for distributed\n  application data analytics.\n- [GarageMQ](https://github.com/valinurovam/garagemq) - AMQP server written in Go.\n- [RedixDB](https://alash3al.github.io/redix/) - A real-time persistent key-value store with the\n  same redis protocol.\n- [BBVA](https://github.com/BBVA/raft-badger) - Raft backend implementation using BadgerDB for\n  Hashicorp raft.\n- [Fantom](https://github.com/Fantom-foundation/go-lachesis) - aBFT Consensus platform for\n  distributed applications.\n- [decred](https://github.com/decred/dcrdata) - An open, progressive, and self-funding\n  cryptocurrency with a system of community-based governance integrated into its blockchain.\n- [OpenNetSys](https://github.com/opennetsys/c3-go) - Create useful dApps in any software language.\n- [HoneyTrap](https://github.com/honeytrap/honeytrap) - An extensible and opensource system for\n  running, monitoring and managing honeypots.\n- [Insolar](https://github.com/insolar/insolar) - Enterprise-ready blockchain platform.\n- [IoTeX](https://github.com/iotexproject/iotex-core) - The next generation of the decentralized\n  network for IoT powered by scalability- and privacy-centric blockchains.\n- [go-sessions](https://github.com/kataras/go-sessions) - The sessions manager for Go net/http and\n  fasthttp.\n- [Babble](https://github.com/mosaicnetworks/babble) - BFT Consensus platform for distributed\n  applications.\n- [Tormenta](https://github.com/jpincas/tormenta) - Embedded object-persistence layer / simple JSON\n  database for Go projects.\n- [BadgerHold](https://github.com/timshannon/badgerhold) - An embeddable NoSQL store for querying Go\n  types built on Badger\n- [Goblero](https://github.com/didil/goblero) - Pure Go embedded persistent job queue backed by\n  BadgerDB\n- [Surfline](https://www.surfline.com) - Serving global wave and weather forecast data with Badger.\n- [Cete](https://github.com/mosuka/cete) - Simple and highly available distributed key-value store\n  built on Badger. Makes it easy bringing up a cluster of Badger with Raft consensus algorithm by\n  hashicorp/raft.\n- [Volument](https://volument.com/) - A new take on website analytics backed by Badger.\n- [KVdb](https://kvdb.io/) - Hosted key-value store and serverless platform built on top of Badger.\n- [Terminotes](https://gitlab.com/asad-awadia/terminotes) - Self hosted notes storage and search\n  server - storage powered by BadgerDB\n- [Pyroscope](https://github.com/pyroscope-io/pyroscope) - Open source continuous profiling platform\n  built with BadgerDB\n- [Veri](https://github.com/bgokden/veri) - A distributed feature store optimized for Search and\n  Recommendation tasks.\n- [bIter](https://github.com/MikkelHJuul/bIter) - A library and Iterator interface for working with\n  the `badger.Iterator`, simplifying from-to, and prefix mechanics.\n- [ld](https://github.com/MikkelHJuul/ld) - (Lean Database) A very simple gRPC-only key-value\n  database, exposing BadgerDB with key-range scanning semantics.\n- [Souin](https://github.com/darkweak/Souin) - A RFC compliant HTTP cache with lot of other features\n  based on Badger for the storage. Compatible with all existing reverse-proxies.\n- [Xuperchain](https://github.com/xuperchain/xupercore) - A highly flexible blockchain architecture\n  with great transaction performance.\n- [m2](https://github.com/qichengzx/m2) - A simple http key/value store based on the raft protocol.\n- [chaindb](https://github.com/ChainSafe/chaindb) - A blockchain storage layer used by\n  [Gossamer](https://chainsafe.github.io/gossamer/), a Go client for the\n  [Polkadot Network](https://polkadot.network/).\n- [vxdb](https://github.com/vitalvas/vxdb) - Simple schema-less Key-Value NoSQL database with\n  simplest API interface.\n- [Opacity](https://github.com/opacity/storage-node) - Backend implementation for the Opacity\n  storage project\n- [Vephar](https://github.com/vaccovecrana/vephar) - A minimal key/value store using hashicorp-raft\n  for cluster coordination and Badger for data storage.\n- [gowarcserver](https://github.com/nlnwa/gowarcserver) - Open-source server for warc files. Can be\n  used in conjunction with pywb\n- [flow-go](https://github.com/onflow/flow-go) - A fast, secure, and developer-friendly blockchain\n  built to support the next generation of games, apps and the digital assets that power them.\n- [Wrgl](https://www.wrgl.co) - A data version control system that works like Git but specialized to\n  store and diff CSV.\n- [Loggie](https://github.com/loggie-io/loggie) - A lightweight, cloud-native data transfer agent\n  and aggregator.\n- [raft-badger](https://github.com/rfyiamcool/raft-badger) - raft-badger implements LogStore and\n  StableStore Interface of hashcorp/raft. it is used to store raft log and metadata of\n  hashcorp/raft.\n- [DVID](https://github.com/janelia-flyem/dvid) - A dataservice for branched versioning of a variety\n  of data types. Originally created for large-scale brain reconstructions in Connectomics.\n- [KVS](https://github.com/tauraamui/kvs) - A library for making it easy to persist, load and query\n  full structs into BadgerDB, using an ownership hierarchy model.\n- [LLS](https://github.com/Boc-chi-no/LLS) - LLS is an efficient URL Shortener that can be used to\n  shorten links and track link usage. Support for BadgerDB and MongoDB. Improved performance by more\n  than 30% when using BadgerDB\n- [lakeFS](https://github.com/treeverse/lakeFS) - lakeFS is an open-source data version control that\n  transforms your object storage to Git-like repositories. lakeFS uses BadgerDB for its underlying\n  local metadata KV store implementation\n- [Goptivum](https://github.com/smegg99/Goptivum) - Goptivum is a better frontend and API for the\n  Vulcan Optivum schedule program\n- [ActionManager](https://mftlabs.io/actionmanager) - A dynamic entity manager based on rjsf schema\n  and badger db\n- [MightyMap](https://github.com/thisisdevelopment/mightymap) - Mightymap: Conveys both robustness\n  and high capability, fitting for a powerful concurrent map.\n- [FlowG](https://github.com/link-society/flowg) - A low-code log processing facility\n- [Bluefin](https://github.com/blinklabs-io/bluefin) - Bluefin is a TUNA Proof of Work miner for\n  the Fortuna smart contract on the Cardano blockchain\n- [cDNSd](https://github.com/blinklabs-io/cdnsd) - A Cardano blockchain backed DNS server daemon\n- [Dingo](https://github.com/blinklabs-io/dingo) - A Cardano blockchain data node\n\nIf you are using Badger in a project please send a pull request to add it to the list.\n\n## Contributing\n\nIf you're interested in contributing to Badger see [CONTRIBUTING](./CONTRIBUTING.md).\n\n## Contact\n\n- Please use [Github issues](https://github.com/hypermodeinc/badger/issues) for filing bugs.\n- Please use [discuss.hypermode.com](https://discuss.hypermode.com) for questions, discussions, and feature\n  requests.\n- Follow us on Twitter [@hypermodeinc](https://twitter.com/hypermodeinc).\n","funding_links":[],"categories":["Go","HarmonyOS","Database"],"sub_categories":["Windows Manager","Databases Implemented in Go"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhypermodeinc%2Fbadger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhypermodeinc%2Fbadger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhypermodeinc%2Fbadger/lists"}