Skip to content

Commit 5e2ced7

Browse files
move docs pages in the repo (#2232)
Get the doc with the repo.
1 parent 3492312 commit 5e2ced7

File tree

5 files changed

+914
-1
lines changed

5 files changed

+914
-1
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# CODEOWNERS info: https://help.github.com/en/articles/about-code-owners
22
# Owners are automatically requested for review for PRs that changes code
33
# that they own.
4-
* @hypermodeinc/database
4+
* @dgraph-io/maintainers

docs/design.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Design
2+
3+
We wrote Badger with these design goals in mind:
4+
5+
- Write a key-value database in pure Go
6+
- Use latest research to build the fastest KV database for data sets spanning terabytes
7+
- Optimize for modern storage devices
8+
9+
Badger’s design is based on a paper titled
10+
[WiscKey: Separating Keys from Values in SSD-conscious Storage](https://www.usenix.org/system/files/conference/fast16/fast16-papers-lu.pdf).
11+
12+
## References
13+
14+
The following blog posts are a great starting point for learning more about Badger and the
15+
underlying design principles:
16+
17+
- [Introducing Badger: A fast key-value store written natively in Go](https://hypermode.com/blog/badger/)
18+
- [Make Badger crash resilient with ALICE](https://hypermode.com/blog/alice/)
19+
- [Badger vs LMDB vs BoltDB: Benchmarking key-value databases in Go](https://hypermode.com/blog/badger-lmdb-boltdb/)
20+
- [Concurrent ACID Transactions in Badger](https://hypermode.com/blog/badger-txn/)
21+
22+
## Comparisons
23+
24+
| Feature | Badger | RocksDB | BoltDB |
25+
| ----------------------------- | -------------------------------------- | ---------------------------- | ------- |
26+
| Design | LSM tree with value log | LSM tree only | B+ tree |
27+
| High Read throughput | Yes | No | Yes |
28+
| High Write throughput | Yes | Yes | No |
29+
| Designed for SSDs | Yes (with latest research<sup>1</sup>) | Not specifically<sup>2</sup> | No |
30+
| Embeddable | Yes | Yes | Yes |
31+
| Sorted KV access | Yes | Yes | Yes |
32+
| Pure Go (no Cgo) | Yes | No | Yes |
33+
| Transactions | Yes | Yes | Yes |
34+
| ACID-compliant | Yes, concurrent with SSI<sup>3</sup> | No | Yes |
35+
| Snapshots | Yes | Yes | Yes |
36+
| TTL support | Yes | Yes | No |
37+
| 3D access (key-value-version) | Yes<sup>4</sup> | No | No |
38+
39+
<sup>1</sup> The WiscKey paper (on which Badger is based) saw big wins with separating values from
40+
keys, significantly reducing the write amplification compared to a typical LSM tree.
41+
42+
<sup>2</sup> RocksDB is an SSD-optimized version of LevelDB, which was designed specifically for
43+
rotating disks. As such RocksDB's design isn't aimed at SSDs.
44+
45+
<sup>3</sup> SSI: Serializable Snapshot Isolation. For more details, see the blog post
46+
[Concurrent ACID Transactions in Badger](https://hypermode.com/blog/badger-txn/)
47+
48+
<sup>4</sup> Badger provides direct access to value versions via its Iterator API. Users can also
49+
specify how many versions to keep per key via Options.
50+
51+
## Benchmarks
52+
53+
We've run comprehensive benchmarks against RocksDB, BoltDB, and LMDB. The benchmarking code with
54+
detailed logs are in the [badger-bench](https://github.com/dgraph-io/badger-bench) repo.

docs/index.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Badger
2+
3+
## What is Badger?
4+
5+
BadgerDB is an embeddable, persistent, and fast key-value (KV) database written in pure Go. It is
6+
the underlying database for [Dgraph](https://github.com/dgraph-io/dgraph), a fast, distributed graph
7+
database. It is meant to be an efficient alternative to non-Go-based key-value stores like RocksDB.
8+
9+
## Changelog
10+
11+
We keep the [repo Changelog](https://github.com/dgraph-io/badger/blob/main/CHANGELOG.md) up to date
12+
with each release.
13+
14+
[Quickstart](quickstart.md)
15+
16+
[Design](design.md)
17+
18+
[Troubleshooting](troubleshooting.md)

0 commit comments

Comments
 (0)