cubdb v2.0.0 Release Notes
-
- [breaking] The functions
get_and_update/3
andget_and_update_multi/3
now return directlyresult
, instead of a{:ok, result}
tuple. - [breaking]
get_and_update_multi/4
does not take an option argument anymore, making itget_and_update_multi/3
. The only available option used to be:timeout
, which is not supported anymore. - [breaking] Remove the
:timeout
option onselect/2
. This is part of a refactoring and improvement that moves read operations from an internally spawned Task to the client process. This makes the:timeout
option unnecessary: by stopping the process callingCubDB
, any running read operation by that process is stopped. - Add
snapshot/2
,with_snapshot/1
andrelease_snapshot/1
to get zero cost read only snapshots of the database. - Add
back_up/2
to produce a database backup. The backup process does not block readers or writers, and is isolated from concurrent writes. - Add
halt_compaction/1
to stop any running compaction operation - Add
compacting?/1
to check if a compaction is currently running - Move read and write operations to the caller process as opposed to the
CubDB
server process. - Improve concurrency of read operations while writing
⬆️ Upgrading from v1 to v2
⬆️ Upgrading from
v1
tov2
requires a few simple code changes:- When calling
get_and_update
orget_and_update_multi
, the return value is not a{:ok, result}
tuple anymore, but justresult
. get_and_update_multi
does not take a fourth option argument anymore. The only available option was:timeout
, which was now removed. In case you want to enforce a timeout for the update function, you can use aTask
andTask.yield
like explained here.- The
select
function does not support a:timeout
option anymore, so it will be ignored if passed. In order to enforce a timeout, you can wrap theselect
in aTask
and useTask.yield
like shown here
- [breaking] The functions