No disrespect Matthew, but you're doing it very very wrong.<p>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.<p>Very #2: do not use JSON to encode, and no need for the conditional-read-by-type - just use Redis' `DUMP`<p>P.S. there may be more wrongness ;)