Skip to content
yinqiwen edited this page Jun 2, 2016 · 3 revisions

#Overview Ardb use standard redis command SAVE/BGSAVE to backup data store, and use extended command IMPORT to restore data store.

#Backup

  • SAVE [redis|ardb|backup]

    SAVE would block current thread until all data backuped. The backup data would be saved in file located in 'backup-dir' configured in ardb.conf.
    The format argument indicate 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 is depends on the storage engine backend, currently only rocksdb could save 'backup' 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 client connection. #Restore

  • 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)
    
Clone this wiki locally