Difference between Redis AOF and Tarantool WAL log

浪子不回头ぞ 提交于 2021-02-06 14:20:58

问题


I was reading this article about Tarantool and they seem to say that AOF and WAL log are not working the same way.

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.

Could someone explain more clearly what is the different between the 2 strategy and how each work at a high level.

I always assumed that Redis AOF was working the same way to a SQL database transaction log such as implemented in Postgresql but I might have been wrong.


回答1:


AOF is the main persistence option for Redis. Any time there's a write operation that modifies the dataset in memory, that operation is logged. So during a restart, Redis will replay all of the operations to reconstruct the dataset. You also have 3 different fsync configuration policies to choose from (no, everysec, always). FWIW, it is usually advised to use both AOF + RDB in the event you want a good level of data-safety. This is kind of outside of the scope of your question, but figured i'd mention it.

Main Redis Persistence Docs

Redis Persistence Demystified

Tarantool's uses something called a "WAL writer". This will run in a separate thread and log requests that manipulate data "insert and update requests". On restart, Tarantool recovers by reading the WAL file and replaying each of the requests.

Tarantool Persistence Docs

There's a difference in the internals obviously, but at a high level they are pretty similar. The persistence comparison in the article is pretty odd and simply not true.

For more information on the low level differences, refer to the docs listed above.

Hope that helps



来源:https://stackoverflow.com/questions/40939756/difference-between-redis-aof-and-tarantool-wal-log

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!