> On Jul 8, 2015, at 10:56 PM, Brendan Duddridge <[email protected]> wrote:
> 
> In my app I allow users to make a backup copy of their database from one 
> device and restore it to another if they wish. My app just makes a zip file 
> of the sqlite file and any file attachments. I'd like to do the same with 
> Couchbase Lite. The user can make a backup file on iOS and restore to Mac or 
> vice versa. I'd like to be able to keep that functionality.

Hm. Why not just use replication? As an example, I don’t need a feature to back 
up my Dropbox (or my Kindle library) from one computer and restore it to 
another; that’s just what those services do automatically.

> There's a replaceUUIDs method on CBLDatabase that seems like it would be 
> perfect for this scenario.

Yes, except it’s not public. But of course we can’t stop you from calling it ;) 
I agree that it’s a good workaround for the copying-a-database problem 
until/unless we work out something better.

It’s best to call -compact on the database before you copy it, to keep the file 
size down.

> Although what would happen on the server side if the client databases 
> suddenly had different UUIDs? Does the server keep track of the UUIDs for 
> each device?

Sort of, although passively. Every client stores a local document on the server 
that stores the checkpoint data. The ID of the document is derived from the 
local database UUID and the replication settings. The server doesn’t care what 
this is; as far as it’s concerned, a client is just using the /db/_local/ 
endpoint to store an opaque bit of data.

You’re right that this does potentially leak storage on the server if a client 
goes away, but it’s only a few hundred bytes per client.

—Jens

-- 
You received this message because you are subscribed to the Google Groups 
"Couchbase Mobile" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mobile-couchbase/5A9D4E10-AA20-41F9-8D13-18091011BADF%40couchbase.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to