transactionstokyo-cabinet

Tokyo Cabinet behaviour without explicit transactions


Haven't found anything on subject in docs. I wonder how reliable and concurrent TC is when I don't start/commit transactions explicitly, i.e. in "implicit transaction" mode.

I need to write only one record per transaction, i.e. no batch writes. But I want that record be written reliably to disk before writer function returns. Still, I'd like to avoid WAL files if possible.

Interested in Hash DB, B+ Tree DB, Fixed-Length DB.

EDIT. To be explicit:

  1. Docs say that "database file is not corrupted even under catastrophic situation". But I'm not sure "no corruption" does mean that data is ACIDly written.

  2. Functions ...dbopen() for all DB types take flag HDBOTSYNC, "which means every transaction synchronizes updated contents with the device". Will this flag still work if I don't start transaction explicitly?

// BTW, are there worthy alternatives to TC? I mean embedded C/C++ libraries with same functionality and speed. KyotoCabinet is no way: it's GPL; https://fallabs.com/license/ is 404, and my email about that 404 was not answered; not to mention they removed Fixed-Length DB from KC.


Solution

  • Got an answer on a forum:

    1. To be sure data is written completely and consistently, one must use BOTH explicit transactions and HDBOTSYNC.

    2. Was advised to take a look at https://github.com/erthink/libmdbx (including https://github.com/erthink/libfpta).