3 ms·
Salvatore, thanks for taking a look. or add this feature to redis-cli, so that it is able to translate RDB files into JSON and the other way around. Absolutel
by delano 15y ago
Salvatore, thanks for taking a look.
or add this feature to redis-cli, so that it is able to translate RDB files into JSON and the other way around.
Absolutely, that would be fantastic. I'm not a C guy so I wrote something quickly in Ruby to solve my problem.
It does do two things that aren't possible with RDB though: it can backup by database and/or a filter on the keys and it can output to STDOUT so it can be piped to other processes (I use it to encrypt the data without an intermediary file).
I use it in production but it's a proof-of-concept more than anything.
- antirez 15y agoThanks for the reply delano, actually it is possible to build both features in the RDB -> JSON dump (filter by key pattern, type, single DB, and so forth). But that would be much faster. Your approach is also interesting but IMHO the main limit is that with the current Redis API there is no robust way to iterate keys in a good way if the key space is very big, without blocking the server and using a lot of additional memory, and it is also not possible to easily get big sets in ranges. Also what happens if somebody is writing to the DB while you need the dump? It is no longer point-in-time. Btw since this is an interesting feature to have I'm adding a feature request in the github issues for a redis-cli feature able to do this work. EDIT: feature request added -> https://github.com/antirez/redis/issues/288 https://github.com/antirez/redis/issues/288
- delano 15y agoactually it is possible to build both features in the RDB -> JSON dump (filter by key pattern, type, single DB, and so forth). But that would be much faster. Absolutely, that would be awesome and definitely a lot faster. feature request added Thanks for doing that. I'll continue my reply there.