redb 0.4.0: 2x faster commits with 1PC+C instead of 2PC

60 points cberner

Repository: https://github.com/cberner/redb

redb 0.4.0 adds support for a single phase commit strategy (1PC+C) that is lower latency than two phase commit (2PC). This enables the first use case (small transactions) where it is convincingly faster than the well-known lmdb!

redb uses a copy-on-write storage layer, and originally it only supported the classic 2 phase commit approach, where data is copied & modified, then fsync'ed, then promoted to the primary copy, and fsync'ed a second time.

The new commit strategy eliminates one of those fsyncs, which are the primary bottleneck in committing small or medium size transactions, by adding a checksum to detect a partially applied commit. For more details, see the links in the release notes