Search code examples
databaserediswaltarantool

Difference between Redis AOF and Tarantool WAL log


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.


Solution

  • 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