> On Jul 7, 2015, at 10:29 PM, Brendan Duddridge <[email protected]> wrote:
> 
> Well I'm actually embedding the database into an NSDocument/UIDocument 
> NSFileWrapper (kind of like a UIManagedDocument) so users can share the 
> actual document files if they like

That makes me nervous for a number of reasons…

* A user can move a document at any time, but there is no support in Couchbase 
Lite for a database being moved while it’s open. I don’t know if SQLite can 
handle this without hand-holding; I know ForestDB can’t. And the CBLManager and 
the attachment store both keep absolute paths and assume they don’t change.

* Every database has a unique ID that’s used as part of storing checkpoints for 
replication. If you copy a document containing a database, you now have two 
copies of the same database, with the same UUID (which is no longer unique). 
That’s going to mess up checkpointing because both instances of the database 
will try to store the same checkpoint on the server. This isn’t fatal, but it 
will greatly slow down replication, because when it happens the replicator has 
to ignore the checkpoint and start over from scratch.

* Databases may internally store sensitive information like login session 
cookies, as part of the replicator’s saved state.

I could probably think of more problems if I thought about this longer :)

None of these are insurmountable, but they’d require significant engineering 
work inside Couchbase Lite, and no one before has ever expressed a need for 
databases-as-documents so it hasn’t come up as a potential feature.

—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/AEBF0EB3-EC4E-4021-97E9-3A3545A9200A%40couchbase.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to