简体   繁体   English

没有明确交易的东京内阁行为

[英]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, ie in "implicit transaction" mode.我想知道当我不显式启动/提交事务时,即在“隐式事务”模式下,TC 的可靠性和并发性如何。

I need to write only one record per transaction, ie no batch writes.每个事务我只需要写一条记录,即没有批量写入。 But I want that record be written reliably to disk before writer function returns.但是我希望在 writer 函数返回之前将该记录可靠地写入磁盘。 Still, I'd like to avoid WAL files if possible.不过,如果可能的话,我想避免使用 WAL 文件。

Interested in Hash DB, B+ Tree DB, Fixed-Length DB.对 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.但我不确定“没有损坏”是否意味着数据是 ACIDly 写入的。

  2. Functions ...dbopen() for all DB types take flag HDBOTSYNC, "which means every transaction synchronizes updated contents with the device".所有 DB 类型的函数 ...dbopen() 都采用标志 HDBOTSYNC,“这意味着每个事务都将更新的内容与设备同步”。 Will this flag still work if I don't start transaction explicitly?如果我没有明确开始交易,这个标志是否仍然有效?

// BTW, are there worthy alternatives to TC? // 顺便说一句,有没有有价值的 TC 替代品? I mean embedded C/C++ libraries with same functionality and speed.我的意思是具有相同功能和速度的嵌入式 C/C++ 库。 KyotoCabinet is no way: it's GPL;京都内阁是不可能的:它是 GPL; https://fallabs.com/license/ is 404, and my email about that 404 was not answered; https://fallabs.com/license/是 404,我关于那个 404 的邮件没有回复; not to mention they removed Fixed-Length DB from KC.更不用说他们从 KC 中删除了 Fixed-Length DB。

Got an answer on a forum:在论坛上得到了答案:

  1. To be sure data is written completely and consistently, one must use BOTH explicit transactions and HDBOTSYNC.为了确保数据被完整和一致地写入,必须同时使用显式事务和 HDBOTSYNC。

  2. Was advised to take a look at https://github.com/erthink/libmdbx (including https://github.com/erthink/libfpta ).建议查看https://github.com/erthink/libmdbx (包括https://github.com/erthink/libfpta )。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM