-
Notifications
You must be signed in to change notification settings - Fork 278
Backup Data
Ardb uses standard Redis command SAVE/BGSAVE to backup data store, and use extended command IMPORT to restore data store.
-
SAVE [redis|ardb|backup]
SAVE would block the current thread until all data backuped. The backup data would be saved in a file located in 'backup-dir' configured in ardb.conf.
The format argument indicates that snapshot type saved.redis
format is redis's rdb format,ardb
format is ardb's own format which is storage engine independent, while 'backup' format depends on the storage engine backend, currently only RocksDB could savebackup
format.
And about the performance,redis
is always slowest,ardb
is a little faster, while 'backup' is much faster that the others.127.0.0.1:36379> keyscount * (integer) 128410113 (132.19s) 127.0.0.1:36379> save backup OK (10.71s) 127.0.0.1:36379> save ardb OK (176.38s) 127.0.0.1:36379> save redis OK (236.21s)
-
BGSAVE [redis|ardb|backup]
BGSAVE would do the almost same thing for SAVE command except that it's executed in a background thread which does not block any thread for the client connection.
- IMPORT path
IMPORT is a command that would restore data from backup data file which generated by SAVE/BGSAVE. And like Save command, the 'backup' format data could be imported fastest.
Example:
127.0.0.1:36379> import backup/rocksdb-redis-snapshot.1464851634
OK
(381.04s)
127.0.0.1:36379> import backup/rocksdb-ardb-snapshot.1464851425
OK
(173.63s)
127.0.0.1:36379> import backup/rocksdb-backup-snapshot.1464851409
OK
(4.70s)