2 ms·
[edit: sorry, I replied here, because it wouldn't let me reply to your other answer first and I thought it was because we've reached some kind of maximum depth]
by DeepDuh 14y ago
[edit: sorry, I replied here, because it wouldn't let me reply to your other answer first and I thought it was because we've reached some kind of maximum depth]
Thanks, I see. Ok, if it's just string or binary based it will work from a correctness standpoint. I'd expect big performance problems with ad-hoc views (if they even exist here), but these shouldn't be used in production anyways. Also, I'd expect replication to take quite a bit longer because it needs to map every document with changes, so there's going to be a tradeoff between initialization time and replication time between the two approaches.
I'm thinking it's going to be beneficial for larger databases to have a TouchDB 'server' somewhere, which constantly replicates with CouchDB and sends the devices a complete snapshot sqlite file for the initial setup. After that, they can talk to CouchDB directly. Otherwise it could take like half an hour to initialize a 50MB DB on a device, which is not really feasible.
- greendestiny 14y agoIn fact for a while you could only have adhoc views, but my knowledge is 6 months out of date. Yes definitely do that. I bundle the sqlite in the app store updates and then mount that as an external db and pull from itself - its a bit awkward but it worked. I had to write the external db stuff, but it was pretty easy.