Thanks Chris, that's really helpful. The corollary followup question would be this:
What happens if a device is disconnected for some absurd amount of time and then reconnects to find all of it's revisions are gone from the DB? Even if the revs_limit param is quite high, it's possible someone could be hundreds or thousands of revisions behind if they disconnect their device for long enough. On Wednesday, July 2, 2014 3:25:11 PM UTC-4, Chris Anderson wrote: > > It sounds like the revs_limit parameter is what you are looking for. I > couldn't find it in the docs but you can see it in the code here: > https://github.com/couchbase/sync_gateway/blob/master/src/github.com/couchbaselabs/sync_gateway/rest/config.go#L79 > > You might find more people working on this stuff in the mobile group: > https://groups.google.com/forum/#!forum/mobile-couchbase > > Note that the metadata is tracked so that when a mobile device that has > been disconnected for a while reconnects, it can agree with everyone about > where it's changes fit in the history. Setting rev stemming to a small > value is fine when you know you won't have documents changed on more than > one device. By default we ship with a large revs_limit parameter to err on > the side of robustness. > > Chris > > > On Wed, Jul 2, 2014 at 10:52 AM, Chris Fuentes <[email protected] > <javascript:>> wrote: > >> To be honest, I'm not sure what portion of the Couchbase stack it is most >> directly related to: >> >> CBL (mobile)/REST API is what generates and updates the documents, but as >> I understand it the sync_gateway is responsible for handling >> revisions/history. I would have expected the old revisions and the old >> metadata to be deleted during the compaction cycle that we run on the >> sync_gateway every 24 hours. While this does delete the old revisions of >> the documents, the metadata pertaining to the old documents is still >> present in the current revisions. >> >> So I'm not really sure which service (couchbase server, sync_gateway, or >> CBL) is most responsible for the excessive bloating of metadata in the >> server. That's really what I'm trying to figure out. I was hoping there was >> just some configurable field somewhere on the Couchbase server or sync >> gateway that would stop keeping track of this old data, like >> "maintain_sync_history: false" or something. >> >> >> >> On Wednesday, July 2, 2014 1:44:29 PM UTC-4, Matt Ingenthron wrote: >> >>> By the way, on re-reading that, I’m not 100% certain this is SyncGateway >>> related, but I believe it is from your last message. If you could >>> clarify >>> Chris, that’d be great. >>> >>> Thanks, >>> >>> Matt >>> >>> On 7/2/14, 10:42 AM, "Matt Ingenthron" <[email protected]> wrote: >>> >>> >Hi Chris, >>> > >>> >(cc¹ing some other folks) >>> > >>> >On 7/1/14, 9:28 PM, "Chris Fuentes" <[email protected]> wrote: >>> > >>> >>The problem is not with CouchBaseLite to my knowledge - I'm talking >>> about >>> >>in the actual CouchBase database, there are excessive metadata auto >>> >>generated as a result of using the CBL API. >>> > >>> >This is true, however it¹s really part-and-parcel of the Couchbase >>> Mobile >>> >team, including Couchbase Lite and SyncGateway. That¹s what provides >>> the >>> >REST interface you mention. >>> > >>> >> >>> >>Even if there is some constant in the app settings that I can change, >>> >>this wouldn't resolve the issue for using the http REST api to modify >>> >>documents. >>> > >>> >Hopefully Jens and JChris can help address how they expect to handle >>> this >>> >with SyncGatway on Couchbase Server. >>> > >>> >Thanks, >>> > >>> >Matt >>> > >>> >-- >>> >Matt Ingenthron >>> >Couchbase, Inc. >>> > >>> >>> >>> -- >>> Matt Ingenthron >>> Couchbase, Inc. >>> >>> >>> >>> >>> > > > -- > — > Chris Anderson @jchris > http://www.couchbase.com > -- You received this message because you are subscribed to the Google Groups "Couchbase" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
