godis icon indicating copy to clipboard operation
godis copied to clipboard

Snapshot saving

Open megameganime opened this issue 1 year ago • 3 comments

Hello,

I was wondering about the way you are saving the data on dump. I am aware Redis uses AOF and snapshots to dump a database to a file. I can see in your code that you use only AOF, but maybe I am missing something. How do you deal when there are large amounts of data that have to be dumped? Do you perhaps save the database as a whole in a snapshot way as Redis does?

megameganime avatar Oct 01 '24 12:10 megameganime

Godis does support RDB. But it can only generate RDB through AOF rewriting

HDT3213 avatar Oct 03 '24 08:10 HDT3213

So if I get it right, the AOF/file always starts from 0 and then adds up on each change of some data? So after 10 years of append, will the file not be huge? And how about when you restart the database, does it have to start reading that huge file from beginning to end? Which for 10 years could take some time to start?

arberkatellari avatar Oct 03 '24 09:10 arberkatellari

Aof rewriting will delete outdated data, and godis supports aof-use-rdb-preamble to further optimize it.

https://redis.io/docs/latest/commands/bgrewriteaof/

HDT3213 avatar Oct 03 '24 09:10 HDT3213