-
Notifications
You must be signed in to change notification settings - Fork 473
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make kvrocks dump rdb file which redis can load. #1001
Comments
cool, thanks for @ColinChamber great work. |
Hi @ColinChamber @git-hulk i don't think supporting dumping RDB in Kvrocks is a good idea. |
Yes, maybe we need a basic guide or consensus to determine what features can be merged or not. |
Search before asking
Motivation
Making Kvrocks write RDB is more straightforward than making it parse RDB.
Because Redis is backward compatible, which can load the original RDB file.
We can easily utilize the primitive RDB object types, which follow the simple
encoding pattern:
or ( consists of <key(value)>)
RDB_TYPE_STRING, RDB_TYPE_LIST, RDB_TYPE_SET, RDB_TYPE_ZSET, RDB_TYPE_HASH,
these five types follow this pattern. We ignore the RDB_TYPE_HASH_ZIPMAP,
RDB_TYPE_LIST_ZIPLIST, RDB_TYPE_SET_INTSET, and other complicated types
only implement the five simple type.
There is a mapping relationship between Redis object type and RDB object type.
But you don't have to worry about Redis using ineffective object types after loading RDB.
Redis will convert it to an efficient type automatically.
E.g
kvrocks> hmset foo foo1 bar1 foo2 bar2
kvrocks> save (use RDB_TYPE_HASH rather than RDB_TYPE_HASH_ZIPLIST)
-------- Redis loads the RDB that kvrocks dumped --------
redis> OBJECT ENCODING foo
"ziplist"
There are more detailed references to RDB.
https://github.com/sripathikrishnan/redis-rdb-tools/wiki/Redis-RDB-Dump-File-Format
https://github.com/sripathikrishnan/redis-rdb-tools/blob/master/docs/RDB_Version_History.textile
https://rdb.fnordig.de/file_format.html
Solution
#958
Are you willing to submit a PR?
The text was updated successfully, but these errors were encountered: