Cbbackupmgr Tool usage

I plan to take backup by cbbackupmgr periodically ( Let’s say once a day) and hourly
insert/update documents in the Couchbase bucket from csv files in a file system.

I am thinking about a recovery scenario in case of deleting a bucket by mistake.
My steps of recovery as follows:

  1. recover the bucket from the backup taken by cbbackupmgr.
  2. run batches again by csv files has been applied after the backup.

If the last backup started 0:00 AM 1st Nov, 2016, is it enough to apply files after generated
0:00 AM ? I am worrying about documents are not persisted (exist on RAM cache but not on disk).

I would like to guarantee the at least once semantics that means no data lost but same updates
are acceptable.

Thanks,

There are additional questions related the topic.

  1. Is there any way to flush un-persisted documents into disk ?
  2. I’d like to know how Couchbase Server writes documents on memory into disk.

Thanks,

  1. cbbackupmgr will backup all documents that exist in the cluster at the time the backup is started even if some items are only in memory and have not yet been written to disk.

  2. One way you could do this is by writing an item to each vbucket and using the “persist to” option for each item. After you did this you could be sure that all items are written to disk. But as I mentioned you do not need to do this for your use case.

  3. When you write an item to Couchbase it is written into a memory cache and queued for persistence and replication. Couchbase has background tasks for replication and persistence and these tasks are always running so there is no set delay in replication or persistence. These tasks will grab the queued items and write them to disk or replicate them as quickly as possible. As a result the delay in persistence will vary from cluster to cluster depending on the write workload, type of disks being used, size of the cluster, etc. You can get an idea of the items in the disk write queue by looking at the “Disk Write Queue” stat in the Administration Console.

Hi miew,

Thank you for your reply.

  1. cbbackupmgr will backup all documents that exist in the cluster at the time the backup is started
    even if some items are only in memory and have not yet been written to disk.

This behavior is I wanted to expect.

Thank you for 2nd and 3rd answers !