@@ -6,7 +6,7 @@ BadgerDB is an embeddable, persistent and fast key-value (KV) database
66written in pure Go. It's meant to be a performant alternative to non-Go-based
77key-value stores like [ RocksDB] ( https://github.com/facebook/rocksdb ) .
88
9- ## Project Status [ Oct 27, 2018 ]
9+ ## Project Status [ Jun 26, 2019 ]
1010
1111Badger is stable and is being used to serve data sets worth hundreds of
1212terabytes. Badger supports concurrent ACID transactions with serializable
@@ -15,14 +15,20 @@ snapshot isolation (SSI) guarantees. A Jepsen-style bank test runs nightly for
1515Badger has also been tested to work with filesystem level anomalies, to ensure
1616persistence and consistency.
1717
18- Badger v1.0 was released in Nov 2017, with a Badger v2.0 release coming up in a
19- few months. The [ Changelog] is kept fairly up-to-date.
18+ Badger v1.0 was released in Nov 2017, and the latest version that is data-compatible
19+ with v1.0 is v1.6.0.
20+
21+ Badger v2.0, a new release coming up very soon will use a new storage format which won't
22+ be compatible with all of the v1.x. The [ Changelog] is kept fairly up-to-date.
23+
24+ For more details on our version naming schema please read [ Choosing a version] ( #choosing-a-version ) .
2025
2126[ Changelog ] :https://github.com/dgraph-io/badger/blob/master/CHANGELOG.md
2227
2328## Table of Contents
2429 * [ Getting Started] ( #getting-started )
2530 + [ Installing] ( #installing )
31+ - [ Choosing a version] ( #choosing-a-version )
2632 + [ Opening a database] ( #opening-a-database )
2733 + [ Transactions] ( #transactions )
2834 - [ Read-only transactions] ( #read-only-transactions )
@@ -61,6 +67,27 @@ $ go get github.com/dgraph-io/badger/...
6167This will retrieve the library and install the ` badger ` command line
6268utility into your ` $GOBIN ` path.
6369
70+ #### Choosing a version
71+
72+ BadgerDB is a pretty special package from the point of view that the most important change we can
73+ make to it is not on its API but rather on how data is stored on disk.
74+
75+ This is why we follow a version naming schema that differs from Semantic Versioning.
76+
77+ - New major versions are released when the data format on disk changes in an incompatible way.
78+ - New minor versions are released whenever the API changes but data compatibility is maintained.
79+ Note that the changes on the API could be backward-incompatible - unlike Semantic Versioning.
80+ - New patch versions are released when there's no changes to the data format nor the API.
81+
82+ Following these rules:
83+
84+ - v1.5.0 and v1.6.0 can be used on top of the same files without any concerns, as their major
85+ version is the same, therefore the data format on disk is compatible.
86+ - v1.6.0 and v2.0.0 are data incompatible as their major version implies, so files created with
87+ v1.6.0 will need to be converted into the new format before they can be used by v2.0.0.
88+
89+ For a longer explanation on the reasons behind using a new versioning naming schema, you can read
90+ [ VERSIONING.md] ( VERSIONING.md ) .
6491
6592### Opening a database
6693The top-level object in Badger is a ` DB ` . It represents multiple files on disk
@@ -82,10 +109,7 @@ import (
82109func main () {
83110 // Open the Badger database located in the /tmp/badger directory.
84111 // It will be created if it doesn't exist.
85- opts := badger.DefaultOptions
86- opts.Dir = " /tmp/badger"
87- opts.ValueDir = " /tmp/badger"
88- db , err := badger.Open (opts)
112+ db , err := badger.Open (badger.DefaultOptions (" tmp/badger" ))
89113 if err != nil {
90114 log.Fatal (err)
91115 }
0 commit comments