cubdb v2.0.0 Release Notes

    • [breaking] The functions get_and_update/3 and get_and_update_multi/3 now return directly result, instead of a {:ok, result} tuple.
    • [breaking] get_and_update_multi/4 does not take an option argument anymore, making it get_and_update_multi/3. The only available option used to be :timeout, which is not supported anymore.
    • [breaking] Remove the :timeout option on select/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 calling CubDB, any running read operation by that process is stopped.
    • Add snapshot/2, with_snapshot/1 and release_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 to v2 requires a few simple code changes:

    1. When calling get_and_update or get_and_update_multi, the return value is not a {:ok, result} tuple anymore, but just result.
    2. 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 a Task and Task.yield like explained here.
    3. 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 the select in a Task and use Task.yield like shown here