Skip to content

Commit d8e8324

Browse files
Ibrahim Jarifvardhanapoorv
andauthored
Add docs for badger (#1431)
* Add docs for badger This is based on the PR #1424. Saurabh wasn't able to sign the CLA and that's why I'm raising this PR. added docs added gitignore file updated readme file updated README.md * Add missing newlines * deleted unused file removed runnable code files (cherry picked from commit 2f152d80182adb16913111319591e32714af76ec) * remove ds_store file * Added build script and nginx config Co-authored-by: Apoorv Vardhan <vardhanapoorv@gmail.com>
1 parent a979274 commit d8e8324

File tree

112 files changed

+6678
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

112 files changed

+6678
-0
lines changed

docs/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/public
2+

docs/README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Badger Docs
2+
3+
If you are looking for Badger documentation, you might find http://dgraph-badger.geekydev.com/ much more readable.
4+
5+
## Contributing
6+
7+
We use [Hugo](https://gohugo.io/) for our documentation.
8+
9+
### Running locally
10+
11+
Download and install the latest patch of hugo version v0.69.x from [here](https://github.com/gohugoio/hugo/releases/).
12+
13+
From within the docs folder, run the command below to get the theme.
14+
15+
cd themes && git clone https://github.com/dgraph-io/hugo-docs
16+
17+
Run hugo server within the docs folder and visit http://localhost:1313 to see the documentation site.
18+

docs/archetypes/default.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
title: "{{ replace .Name "-" " " | title }}"
3+
date: {{ .Date }}
4+
draft: true
5+
---
6+

docs/config.toml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
languageCode = "en-us"
2+
theme = "hugo-docs"
3+
canonifyURLs = true
4+
5+
[markup.goldmark.renderer]
6+
unsafe = true
7+
8+
[markup.highlight]
9+
noClasses = false
10+
[[menu.main]]
11+
name = "Home"
12+
url = "/"
13+
identifier = "home"
14+
weight = -1
15+
16+
[[menu.main]]
17+
name = "Getting Started"
18+
url = "/get-started/"
19+
identifier = "get-started"
20+
weight = 1
21+
[[menu.main]]
22+
name = "Resources"
23+
url = "/resources/"
24+
identifier = "resources"
25+
weight = 2
26+
27+
[[menu.main]]
28+
name = "Design"
29+
url = "/design/"
30+
identifier = "design"
31+
weight = 3
32+
33+
[[menu.main]]
34+
name = "Project Using Badger"
35+
url = "/project-using-badger/"
36+
identifier = "project-using-badger"
37+
weight = 4
38+
39+
[[menu.main]]
40+
name = "Frequently Asked Questions"
41+
url = "/faq/"
42+
identifier = "faq"
43+
weight = 5

docs/content/_index.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
title: "BadgerDB Documentation"
3+
date: 2020-07-06T17:43:29+05:30
4+
draft: false
5+
---
6+
7+
![Badger mascot](images/diggy-shadow.png)
8+
9+
BadgerDB is an embeddable, persistent and fast key-value (KV) database written
10+
in pure Go. It is the underlying database for [Dgraph](https://dgraph.io), a
11+
fast, distributed graph database. It's meant to be a performant alternative to
12+
non-Go-based key-value stores like RocksDB.
13+
14+
## Project Status [March 24, 2020]
15+
16+
Badger is stable and is being used to serve data sets worth hundreds of
17+
terabytes. Badger supports concurrent ACID transactions with serializable
18+
snapshot isolation (SSI) guarantees. A Jepsen-style bank test runs nightly for
19+
8h, with `--race` flag and ensures the maintenance of transactional guarantees.
20+
Badger has also been tested to work with filesystem level anomalies, to ensure
21+
persistence and consistency. Badger is being used by a number of projects which
22+
includes Dgraph, Jaeger Tracing, UsenetExpress, and many more.
23+
24+
The list of projects using Badger can be found [here](#projects-using-badger).
25+
26+
Badger v1.0 was released in Nov 2017, and the latest version that is data-compatible
27+
with v1.0 is v1.6.0.
28+
29+
Badger v2.0 was released in Nov 2019 with a new storage format which won't
30+
be compatible with all of the v1.x. Badger v2.0 supports compression, encryption and uses a cache to speed up lookup.
31+
32+
The [Changelog] is kept fairly up-to-date.
33+
34+
For more details on our version naming schema please read [Choosing a version](#choosing-a-version).
35+
36+
[Changelog]:https://github.com/dgraph-io/badger/blob/master/CHANGELOG.md

docs/content/contact/_index.md

Whitespace-only changes.

docs/content/contact/index.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
+++
2+
title = "Contact"
3+
aliases = ["/contact"]
4+
+++
5+
6+
- Please use [discuss.dgraph.io](https://discuss.dgraph.io) for questions, feature requests and discussions.
7+
- Please use [Github issue tracker](https://github.com/dgraph-io/badger/issues) for filing bugs or feature requests.
8+
- Follow us on Twitter [@dgraphlabs](https://twitter.com/dgraphlabs).

docs/content/design/_index.md

Whitespace-only changes.

docs/content/design/index.md

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

docs/content/faq/_index.md

Whitespace-only changes.

0 commit comments

Comments
 (0)