github.com/coocood/badger@v1.5.1-0.20200528065104-c02ac3616d04/doc.go (about) 1 /* 2 Package badger implements an embeddable, simple and fast key-value database, 3 written in pure Go. It is designed to be highly performant for both reads and 4 writes simultaneously. Badger uses Multi-Version Concurrency Control (MVCC), and 5 supports transactions. It runs transactions concurrently, with serializable 6 snapshot isolation guarantees. 7 8 Badger uses an LSM tree along with a value log to separate keys from values, 9 hence reducing both write amplification and the size of the LSM tree. This 10 allows LSM tree to be served entirely from RAM, while the values are served 11 from SSD. 12 13 14 Usage 15 16 Badger has the following main types: DB, Txn, Item and Iterator. DB contains 17 keys that are associated with values. It must be opened with the appropriate 18 options before it can be accessed. 19 20 All operations happen inside a Txn. Txn represents a transaction, which can 21 be read-only or read-write. Read-only transactions can read values for a 22 given key (which are returned inside an Item), or iterate over a set of 23 key-value pairs using an Iterator (which are returned as Item type values as 24 well). Read-write transactions can also update and delete keys from the DB. 25 26 See the examples for more usage details. 27 */ 28 package badger