gpt4 book ai didi

database - Redis AOF 和 Tarantool WAL 日志的区别

转载 作者:IT王子 更新时间:2023-10-29 06:09:42 24 4
gpt4 key购买 nike

我正在读这个article关于 Tarantool,他们似乎说 AOF 和 WAL 日志的工作方式不同。

Tarantool: besides snapshots, it has a full-scale WAL (write ahead log). So it can secure data persistency after each transaction out-of-the-box. Redis: in fact, it has snapshots only. Technically, you have AOF (append-only file, where all the operations are written), but it requires manual control over it, including manual restore after reboot. Simply put, with Redis you need to manually suspend the server now and then, make snapshots and archive AOF.

有人能更清楚地解释这两种策略之间的区别以及每种策略在高层次上的工作原理吗?

我一直认为 Redis AOF 以与在 Postgresql 中实现的 SQL 数据库事务日志相同的方式工作,但我可能错了。

最佳答案

AOF 是 Redis 的主要持久化选项。只要有修改内存中数据集的写操作,该操作就会被记录下来。因此在重启期间,Redis 将重放所有操作以重建数据集。您还有 3 种不同的 fsync 配置策略可供选择(no、everysec、always)。 FWIW,如果您想要良好的数据安全级别,通常建议同时使用 AOF + RDB。这有点超出您的问题范围,但我想我会提到它。

Main Redis Persistence Docs

Redis Persistence Demystified

Tarantool 使用一种叫做“WAL writer”的东西。这将在单独的线程中运行并记录操作数据“插入和更新请求”的请求。重新启动时,Tarantool 通过读取 WAL 文件并重放每个请求来恢复。

Tarantool Persistence Docs

内部结构明显不同,但在较高层次上它们非常相似。文章中的持久性比较很奇怪,根本不正确。

有关低级别差异的更多信息,请参阅上面列出的文档。

希望对你有帮助

关于database - Redis AOF 和 Tarantool WAL 日志的区别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40939756/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com