Skip to content

Commit 012b3aa

Browse files
authored
docs: migrate Badger docs (#90)
* docs: migrate Badger docs * repo links * .
1 parent c0ad524 commit 012b3aa

File tree

9 files changed

+1003
-12
lines changed

9 files changed

+1003
-12
lines changed

.trunk/trunk.yaml

+7-7
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
version: 0.1
33

44
cli:
5-
version: 1.22.9
5+
version: 1.22.10
66

77
plugins:
88
sources:
@@ -18,20 +18,20 @@ runtimes:
1818

1919
lint:
2020
enabled:
21-
- renovate@39.149.0
21+
- renovate@39.164.1
2222
23-
23+
2424
25-
25+
2626
- git-diff-check
2727
2828
29-
- prettier@3.4.2:
29+
- prettier@3.5.0:
3030
packages:
3131
- "@mintlify/[email protected]"
3232
33-
34-
33+
34+
3535
3636
ignore:
3737
- linters: [ALL]

README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ documentation for the open source projects that Hypermode leads:
88

99
- [Modus](https://github.com/hypermodeinc/modus) - serverless framework for
1010
building functions and APIs, powered by WebAssembly
11-
- [Dgraph](https://github.com/dgraph-io/dgraph) - distributed, transactional
11+
- [Dgraph](https://github.com/hypermodeinc/dgraph) - distributed, transactional
1212
graph database for real-time use cases
13-
- [Badger](https://github.com/dgraph-io/badger) - embeddable key-value store in
14-
Go
15-
- [Ristretto](https://github.com/dgraph-io/ristretto) - embeddable memory-bound
16-
cache in Go
13+
- [Badger](https://github.com/hypermodeinc/badger) - embeddable key-value store
14+
in Go
15+
- [Ristretto](https://github.com/hypermodeinc/ristretto) - embeddable
16+
memory-bound cache in Go
1717

1818
## Found an issue?
1919

badger/design.mdx

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

badger/overview.mdx

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
title: Overview
3+
description: Welcome to the Badger docs!
4+
mode: "wide"
5+
"og:title": "Overview - Badger"
6+
---
7+
8+
## What is Badger? {/* <!-- vale Google.Contractions = NO --> */}
9+
10+
BadgerDB is an embeddable, persistent, and fast key-value (KV) database written
11+
in pure Go. It's the underlying database for [Dgraph](https://dgraph.io), a
12+
fast, distributed graph database. It's meant to be an efficient alternative to
13+
non-Go-based key-value stores like RocksDB.
14+
15+
## Changelog
16+
17+
We keep the
18+
[repo Changelog](https://github.com/hypermodeinc/badger/blob/main/CHANGELOG.md)
19+
up to date with each release.

0 commit comments

Comments
 (0)