couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paolo Negri <>
Subject Re: Replication and sequence id question
Date Tue, 16 Apr 2013 13:13:28 GMT
Replications would be initiated from touchdb, typical case being a
mobile application ships with a primed database or with an empty
database, then when a connection is available the mobile application
would then connect to the server in order to synchronize the database
and receive updated data from the server.


On Tue, Apr 16, 2013 at 3:00 PM, Robert Newson <> wrote:
> Yes. The couchdb replicator stores the checkpoint at both source and
> target. I don't know touchdb beyond its goal of being
> couchdb-on-mobile, so I will defer to Jens as to whether the
> replicator in touchdb also does this. Are you initiating replication
> on couchdb or touchdb?
> B.
> On 16 April 2013 13:48, Paolo Negri <> wrote:
>> Thanks again for the answer, I'm now confused by the role of the
>> checkpoint and its storage, let's say that I have a mobile app that
>> has been downloaded on 100k devices and I'm using touchdb to sync my
>> db to the devices, does this mean that each device will need to store
>> a checkpoint on my server side database, so that I'd end up with 100k
>> local documents in the database each one belonging to one of the
>> clients?
>> Paolo
>> On Tue, Apr 16, 2013 at 1:23 PM, Robert Newson <> wrote:
>>> Hi Paolo,
>>> The checkpoint is stored in the database at source and target, so
>>> couchdb will fail to find that document on server B and so it will
>>> start from update sequence 0.
>>> B.
>>> On 16 April 2013 10:06, Paolo Negri <> wrote:
>>>> Hi Robert
>>>> On Tue, Apr 16, 2013 at 10:05 AM, Robert Newson <>
>>>>> Hi Paolo,
>>>>> No, couchdb (and touchdb) will be just fine if you fail over to a
>>>>> different server. What will happen is that the replication from server
>>>>> B to your mobile client will start from update sequence 0 (as you will
>>>>> have no previous checkpoint).
>>>> I'm wondering what happens if the fallback is not explicit to the
>>>> client let's say I have the database exposed under
>>>> and under this url usually respond
>>>> server A but after the failover requests are instead forwarded
>>>> internally to server B won't the mobile client be looking for the
>>>> checkpoint of server A and be confused about the fact of being talking
>>>> with server B instead?
>>>>> The replication process will then check
>>>>> whether each update on server B is on your client already. If the A to
>>>>> B replication is still running, then the majority of updates you get
>>>>> from server B will already be present on your mobile device. Any that
>>>>> are missing will be replicated.
>>>>> You can freely replicate from multiple servers to your mobile client,
it works.
>>>>> B.
>>>>> On 16 April 2013 08:43, Paolo Negri <> wrote:
>>>>>> Dear list
>>>>>> I have a question related to couchdb replication, let me walk you
>>>>>> through the scenario
>>>>>> I have 2 servers server A and server B
>>>>>> on both A and B I'm running couchdb
>>>>>> B is configured to replicate all dbs from A
>>>>>> I also have one mobile client that uses touchdb to sync data with
>>>>>> database on server A
>>>>>> At some point server A breaks and then the mobile client can't reach
>>>>>> and then will fallback to B
>>>>>> What happens in terms of syncing? will the mobile client be confused
>>>>>> by the fact that the database on server B doesn't share sequence
>>>>>> numbers with the same database in A?
>>>>>> Thanks for your help,
>>>>>> Paolo

View raw message