antirez/redis — pull request #1185 by mpalmer (2013-07-07 05:40:03+00:00)
Title: New commands: PIPESAVE and DUMPSAVE

I can't believe I haven't submitted this before...

This patch implements a pair of commands to make RDB backups easier, without chewing up IOPS on the system unnecessarily. Both commands emit an RDB file over a socket, rather than writing them to disk. The differences are:

* `PIPESAVE` invokes a system command (as specified by the new config variable `pipesavecommand`) and writes the RDB to that command's `stdin`. Why would you want this? Well, you can implement a pipeline to compress, encrypt, and send-to-S3 an RDB file, all without it touching disk. This can, for example, reduce the time to do a backup from 3 hours to 15 minutes.
* `DUMPSAVE` writes the RDB file straight back at the client who called the command. The client should be grabbing that data and doing something with it (writing it to disk would be a good recommendation). The purpose of this command is to allow a backup server to request an RDB file, without needing to either (a) become a slave (with the associated memory usage), or (b) Have the RDB written to disk locally.