mirror of
https://github.com/luxfi/zapdb.git
synced 2026-10-30 15:12:20 +00:00
The module has been github.com/luxfi/zapdb for a while, but the package inside it still declared itself badger, so every consumer had to write zapdb "github.com/luxfi/zapdb" // package badger and the alias existed only to paper over the mismatch. 56 root files and the 134 qualified references inside the repo now say zapdb. Backward compatible in both directions: an existing consumer with the alias keeps compiling (the alias is now merely redundant), and one without it starts compiling instead of failing on an undefined zapdb. Directory badger/ and its cmd package are untouched — that is the CLI, and its binary is named badger. Build and vet clean; suite green except TestZRestore, which wants a /tmp/zb/src benchmark fixture and fails identically without this change. Co-authored-by: Hanzo Dev <[email protected]>
28 lines
1.2 KiB
Go
28 lines
1.2 KiB
Go
/*
|
|
Package badger implements an embeddable, simple and fast key-value database,
|
|
written in pure Go. It is designed to be highly performant for both reads and
|
|
writes simultaneously. Badger uses Multi-Version Concurrency Control (MVCC), and
|
|
supports transactions. It runs transactions concurrently, with serializable
|
|
snapshot isolation guarantees.
|
|
|
|
Badger uses an LSM tree along with a value log to separate keys from values,
|
|
hence reducing both write amplification and the size of the LSM tree. This
|
|
allows LSM tree to be served entirely from RAM, while the values are served
|
|
from SSD.
|
|
|
|
# Usage
|
|
|
|
Badger has the following main types: DB, Txn, Item and Iterator. DB contains
|
|
keys that are associated with values. It must be opened with the appropriate
|
|
options before it can be accessed.
|
|
|
|
All operations happen inside a Txn. Txn represents a transaction, which can
|
|
be read-only or read-write. Read-only transactions can read values for a
|
|
given key (which are returned inside an Item), or iterate over a set of
|
|
key-value pairs using an Iterator (which are returned as Item type values as
|
|
well). Read-write transactions can also update and delete keys from the DB.
|
|
|
|
See the examples for more usage details.
|
|
*/
|
|
package zapdb
|