How to determine if two databases are perfectly in sync?

閲覧: 21 回
最初の未読メッセージにスキップ

Brendan Duddridge

未読、
2016/04/14 14:30:342016/04/14
To: Couchbase Mobile
Hi,

I'm wanting to inform the users of the progress of any sync activity that's going on currently. I don't feel the active progress is the way to go because the changes count keeps going up and up and the current change number never catches up with it until the very end.

So I'm wondering if it would be adequate to just display to the user the CBLDatabase lastSequenceNumber property? At least they could look at one database and then the other and see, oh, this one is behind that one or, I can see it's catching up. Maybe it's something I can display to the user during the replication process as the database gets updated.

Is there a better way to let people know the progress of syncing?

Thanks,

Brendan

Jens Alfke

未読、
2016/04/14 16:15:212016/04/14
To: mobile-c...@googlegroups.com
On Apr 14, 2016, at 11:30 AM, Brendan Duddridge <bren...@gmail.com> wrote:

So I'm wondering if it would be adequate to just display to the user the CBLDatabase lastSequenceNumber property? At least they could look at one database and then the other and see, oh, this one is behind that one or, I can see it's catching up.

The sequence numbers in two databases don’t have any relation to each other, though; if you sync databases A and B, their lastSequenceNumber values won’t necessarily be the same. Due to implementation details they may be fairly close if you use SQLite storage, but if you use ForestDB storage they’re usually going to be very different. Other factors like filtered replications will throw them off even more.

The answer to the question in the subject is to let the replication run till it goes idle or stops, with no errors.

I wish there were a better answer, but I’ve found that accurate progress measurement comes at the expense of performance and memory footprint. As we’ve optimized the replicator we’ve lost accuracy in tracking progress.

—Jens

Brendan Duddridge

未読、
2016/04/14 16:21:182016/04/14
To: Couchbase Mobile
Ok. Thanks for the clarification Jens. 
全員に返信
投稿者に返信
転送
新着メール 0 件