View Source Changelog
For versions before
v1.0.0, the changes are reported in the GitHub
2.0.0 brings better concurrency, atomic transactions with arbitrary
operations, zero cost read-only snapshots, database backup, and more, all with a
simpler and more scalable internal architecture.
Refer to the upgrade guide for how to upgrade from previous versions.
- [breaking] The functions
CubDB.select/2now return directly
result, instead of a
CubDB.get_and_update_multi/4does not take an option argument anymore, making it
CubDB.get_and_update_multi/3. The only available option used to be
:timeout, which is not supported anymore.
- [breaking] Remove the
CubDB.select/2. This is part of a refactoring and improvement that moves read operations from an internally spawned
Taskto the client process. This makes the
:timeoutoption unnecessary: by stopping the process calling
CubDB, any running read operation by that process is stopped.
CubDB.select/2now returns a lazy stream that can be used with functions in
Stream. This makes the
:reduceoptions unnecessary, so those options were removed.
CubDB.release_snapshot/1to get zero cost read-only snapshots of the database. The functions in
CubDB.Snapshotallow to read from a snapshot.
CubDB.transaction/2to perform multiple write (and read) operations in a single atomic transaction. The functions in
CubDB.Txallow to read and write inside a transaction.
CubDB.back_up/2to produce a database backup. The backup process does not block readers or writers, and is isolated from concurrent writes.
CubDB.halt_compaction/1to stop any running compaction operation
CubDB.compacting?/1to check if a compaction is currently running
- Move read and write operations to the caller process as opposed to the
- Improve concurrency of read operations while writing
clear/1function to atomically delete all entries in the database
Breaking changes from v0.17.0:
- Better defaults:
auto_file_syncnow defaults to
true(slower but durable)
auto_compactnow defaults to
get_and_update_multi/4now take the timeout as an option instead of an additional argument
Other changes from v0.17.0:
- Better internal handling of timeouts that ensures cleanup of resources on the callee side
put_and_delete_multi/3to atomically put and delete entries
put_new/3to put an entry only if the key does not exist yet
- More efficient implementation of
get_multi/2does not block writers
- Fix race condition during compaction
get_and_update/3avoids unnecessary disk writes (including the transaction header) when the value is unchanged
- Remove caller timeout on
put_multi/2, consistently with the other functions.
- Remove default GenServer timeouts
- Fix process (and file descriptor) leak upon compaction
cubdb_file?/1regexp, making it stricter