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?
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?