doc.go 1.2 KB

12345678910111213141516171819202122232425262728
  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. Badger uses an LSM tree along with a value log to separate keys from values,
  8. hence reducing both write amplification and the size of the LSM tree. This
  9. allows LSM tree to be served entirely from RAM, while the values are served
  10. from SSD.
  11. Usage
  12. Badger has the following main types: DB, Txn, Item and Iterator. DB contains
  13. keys that are associated with values. It must be opened with the appropriate
  14. options before it can be accessed.
  15. All operations happen inside a Txn. Txn represents a transaction, which can
  16. be read-only or read-write. Read-only transactions can read values for a
  17. given key (which are returned inside an Item), or iterate over a set of
  18. key-value pairs using an Iterator (which are returned as Item type values as
  19. well). Read-write transactions can also update and delete keys from the DB.
  20. See the examples for more usage details.
  21. */
  22. package badger