The problem/use-case that the feature addresses
Versioning is a good feature for easy data sync, backup and recover. It also provides convenience for developers to sync data from redis to other storage (mysql, mongodb etc..) . That is a common use scenario for most of "Caching" cases.
Description of the feature
-
Once switched on, when a key has been created, modified, deleted, renamed (situations like Keyspace Notifications'), the key is recorded a strict-increasing sequence number as its version (can be generated like stream id).
-
When read a key with versioning option, the version are returned with data.
-
Better to have CAS
dump,restoreoption, which compare the versions before such operations. -
Better to have version storage. User configuration determines the max number, then the version system not only records its sequence number but also its previous data in binary format (i.e.
dumpthe key).
Alternatives you've considered
Since Redis 2.8.0, Keyspace Notifications can be used for versioning. But the pub/sub functions are not reliable ! I think the internal version record should be reliable and easy-for-use.
Also, "waste of memory" depends on the user configuration, so I think it should be ok.
Additional information
None.