3 ms·
Small snippet to dump and restore all data from/to redis
- itamarhaber 9y agoNo disrespect Matthew, but you're doing it very very wrong. Very #1: do not use `KEYS`, use `SCAN` instead. Your script is not only blocking the server, it also consumes a lot of RAM just for holding them while iterating. Very #2: do not use JSON to encode, and no need for the conditional-read-by-type - just use Redis' `DUMP` P.S. there may be more wrongness ;)