Optionally allow encoded-output in AOF rewrite. #1031

antirez opened this Issue Apr 2, 2013 · 4 comments


None yet

2 participants


Using RESTORE instead of other commands to re-create data when rewriting the AOF it is possible, at the cost of exposing the internal RDB encoding (exposed anyway with DUMP / RESTORE), to improve the space efficiency, CPU usage, and write speed of the AOF in a significant way.

Probably this should be optional so that it is simple to turn it off (even with CONFIG) in order to create a more cross-version compatible or simpler to parse AOF.

I'm assigning this to myself as I prefer to write this core stuff myself.

Note however that RESTORE includes the RDB version inside the encoded data, so we don't have just this opaque blog of data. Redis versions not capable of loading encoded data will perform properly. Moreover we'll always make sure that the next version of Redis will be able to read the previous RDB file version (we always did it this way).

When to use RESTORE

Ideally we should use RESTORE all the times data is stored in a specially-encoded way, that is, we already have data encoded in binary form without additional work to do. This is the case of small hashes, sets, sorted sets, and lists.

@antirez antirez was assigned Apr 2, 2013

p.s. an even more opaque, but yet more efficient way to handle that, would be to simply allow an RDB file as a preamble for an AOF file.


Moved to 3.0


Closing, we are going to implement this by RDB bulk prefix to AOF files.

@antirez antirez closed this Oct 15, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment