The entire database is 116MB (which seems a lot for the number of documents…). That is the size of the entire cblite2 directory. At present I only have one index (on the “type” property") - I’ve not really found the best practices for determining the requirement for further indexes - but that means that indexes are not taking up a lot of the space (I guess?)
When we deliver the app we have a built-in database with all of the data as per the time of building that release. So really only a few changes would replicate (when the release is new). So replication should only run for a relatively short period.
The app can run without having a user logged in and most of the data is available for all users. So when the app starts we do an anonymous replication (only the “!” channel). The built in database is a full anonymous replication. When the user logs in (and some do that “auto” when launching the app - thus skipping the anonymous replication) then we stop the anonymous replication (if started) and restart the replicator with the user logged in. The first user replication is their “channel.userxyz…” channel only - to speed up reception of the user’s private data. Once that has completed (status “Idle”) we stop and start the replicator with the “!” channel and their user channel.
But following your questions I actually made a design change so that I capture the time it takes from going Busy to going Idle - and surface that on a page in the app
The full replication cycle (idle -> busy -> idle) seem to take 30-45 seconds which I suppose is Ok? The “user only” replication is very fast (<1 sec) - so way faster than what I observed the other day… I suppose that could be due to some external factors as the production server is at a remote site…
Here is a sample output from replication. First anonymous (and before logging in there was a small network problem), and then user logged in. Sorry, it is a bit lengthy…
222,1: [DbDataStore] Start replicator: AppUtils.IsLoggedIn =False, firstUserRepl=True
223,1: [DbDataStore] Start PushAndPull Replicator: Will connect to: wss://fangstjournalen.dtu.dk/_sync/data - user: 'anonymous'
227,1: [DbDataStore] PushAndPull Replicator: 0/0, activity = Connecting
244,1: [DbDataStore] PushAndPull Replicator: 0/0, activity = Busy
281,1: [DbDataStore] PushAndPull Replicator: 0/16, activity = Busy
427,1: [DbDataStore] PushAndPull Replicator: 0/19, activity = Busy
916,1: [DbDataStore] PushAndPull Replicator: 0/20, activity = Busy
7077,1: [DbDataStore] PushAndPull Replicator: 0/21, activity = Busy
8300,1: [DbDataStore] PushAndPull Replicator: 0/27, activity = Busy
8367,1: [DbDataStore] PushAndPull Replicator: 0/28, activity = Busy
8416,1: [DbDataStore] PushAndPull Replicator: 0/30, activity = Busy
8457,1: [DbDataStore] PushAndPull Replicator: 0/32, activity = Busy
8504,1: [DbDataStore] PushAndPull Replicator: 0/33, activity = Busy
8571,1: [DbDataStore] PushAndPull Replicator: 1/36, activity = Busy
8573,1: [DbDataStore] Pull replication finished receiving 1 documents
8576,1: [DbDataStore] PushAndPull Replicator: 1/36, activity = Busy
8578,1: [DbDataStore] Doc ID: Photo:5e9ffe02d63618173404a7a2 (access removed)
8617,1: [DbDataStore] PushAndPull Replicator: 1/39, activity = Busy
8716,1: [DbDataStore] PushAndPull Replicator: 1/41, activity = Busy
8763,1: [DbDataStore] PushAndPull Replicator: 1/48, activity = Busy
8823,1: [DbDataStore] PushAndPull Replicator: 1/76, activity = Busy
8961,1: [DbDataStore] PushAndPull Replicator: 1/82, activity = Busy
9023,1: [DbDataStore] PushAndPull Replicator: 1/83, activity = Busy
9344,1: [DbDataStore] PushAndPull Replicator: 1/83, activity = Idle
9345,1: [DbDataStore] Repl. completed on: 12-06-2020 12:08:56. Duration=00:00:41.4475970, pulls=1, pushes=0
9422,1: [DbDataStore] PushAndPull Replicator: 1/83, error CouchbaseLiteException (POSIXDomain / 52): Network is unreachable., activity = Busy
9423,1: [DbDataStore] Error :: Couchbase.Lite.CouchbasePosixException: CouchbaseLiteException (POSIXDomain / 52): Network is unreachable.
9433,1: [DbDataStore] PushAndPull Replicator: 1/83, error CouchbaseLiteException (POSIXDomain / 52): Network is unreachable., activity = Offline
9434,1: [DbDataStore] Error :: Couchbase.Lite.CouchbasePosixException: CouchbaseLiteException (POSIXDomain / 52): Network is unreachable.
9439,1: [DbDataStore] Stopping replicator (going offline/to sleep)
9440,1: [DbDataStore] Stop Replicator
9442,1: [DbDataStore] PushAndPull Replicator: 0/0, activity = Stopped
9525,1: [DbDataStore] Restart replicator after user 'john@dalsgaard-data.dk' (2124DEFEC111BA8FC1257Exxxxxxxx) logged in
9526,1: [DbDataStore] Start replicator: AppUtils.IsLoggedIn =True, firstUserRepl=True
9527,1: [DbDataStore] Start PushAndPull Replicator: Will connect to: wss://fangstjournalen.dtu.dk/_sync/data - user: '2124DEFEC111BA8FC1257Exxxxxxxx'
9529,1: [DbDataStore] PushAndPull Replicator: 0/0, activity = Connecting
9546,1: [DbDataStore] PushAndPull Replicator: 0/0, activity = Busy
9576,1: [DbDataStore] PushAndPull Replicator: 0/6, activity = Busy
9633,1: [DbDataStore] Pull replication finished receiving 6 documents
9635,1: [DbDataStore] PushAndPull Replicator: 6/6, activity = Busy
9638,1: [DbDataStore] Doc ID: Photo:599eb4f105187e137b0e55f7
9639,1: [DbDataStore] Doc ID: Observation:6e30bfeffeb646019469fad0c6100c78
9640,1: [DbDataStore] Doc ID: Observation:0d696317b5ee40e787d9766f2df5ff9b
9641,1: [DbDataStore] Doc ID: Observation:1980227623d648688392896c301221e9 (deletion)
9642,1: [DbDataStore] Doc ID: Observation:90458f4003ae492a8b95fcaffeb3ad4b
9643,1: [DbDataStore] Doc ID: User:Private:2124DEFEC111BA8FC1257Exxxxxxxx
9663,1: [DbDataStore] PushAndPull Replicator: 6/6, activity = Idle
9664,1: [DbDataStore] Repl. completed on: 12-06-2020 12:52:43. Duration=00:00:06.0051690, pulls=1, pushes=0
9665,1: [DbDataStore] Replication of only user data completed - restart for all data...
9674,1: [DbDataStore] PushAndPull Replicator: 6/516, activity = Busy
9730,1: [DbDataStore] Push replication finished sending 2 documents
9731,1: [DbDataStore] Doc ID: User:Private:2124DEFEC111BA8FC1257Exxxxxxxx
9734,1: [DbDataStore] PushAndPull Replicator: 900/900, activity = Busy
9736,1: [DbDataStore] Doc ID: ActivityLog:9e4fd02e17b44fce95f453e8b44f43ce
9737,1: [DbDataStore] Purged Doc ID: ActivityLog:9e4fd02e17b44fce95f453e8b44f43ce from local database
9742,1: [DbDataStore] PushAndPull Replicator: 900/900, activity = Idle
9743,1: [DbDataStore] Repl. completed on: 12-06-2020 12:52:44. Duration=00:00:00.2973090, pulls=0, pushes=2
9746,1: [DbDataStore] Restart replicator after user 'john@dalsgaard-data.dk' (2124DEFEC111BA8FC1257Exxxxxxxx) logged in
9747,1: [DbDataStore] Stop Replicator
9748,1: [DbDataStore] Start replicator: AppUtils.IsLoggedIn =True, firstUserRepl=False
9751,1: [DbDataStore] Start PushAndPull Replicator: Will connect to: wss://fangstjournalen.dtu.dk/_sync/data - user: '2124DEFEC111BA8FC1257Exxxxxxxx'
9754,1: [DbDataStore] PushAndPull Replicator: 0/0, activity = Connecting
9780,1: [DbDataStore] PushAndPull Replicator: 0/0, activity = Busy
9819,1: [DbDataStore] PushAndPull Replicator: 0/1, activity = Busy
9883,1: [DbDataStore] Pull replication finished receiving 1 documents
9886,1: [DbDataStore] PushAndPull Replicator: 1/1, activity = Busy
9888,1: [DbDataStore] Doc ID: User:13DBD1DDA37DA6EDC1257FB60062C6B3 (access removed)
9953,1: [DbDataStore] Pull replication finished receiving 1 documents
9956,1: [DbDataStore] PushAndPull Replicator: 2/2, activity = Busy
9957,1: [DbDataStore] Doc ID: User:19F96F2A44F3A09AC12580520033C1E1 (access removed)
10135,1: [DbDataStore] PushAndPull Replicator: 2/3, activity = Busy
10193,1: [DbDataStore] Pull replication finished receiving 1 documents
10196,1: [DbDataStore] PushAndPull Replicator: 3/4, activity = Busy
10198,1: [DbDataStore] Doc ID: User:27107F725E4D537AC125842C006A33FD (access removed)
10256,1: [DbDataStore] Pull replication finished receiving 1 documents
10259,1: [DbDataStore] PushAndPull Replicator: 4/4, activity = Busy
10262,1: [DbDataStore] Doc ID: User:E4C8BDDC5DC1D844C1257F34004629E0 (access removed)
10327,1: [DbDataStore] Pull replication finished receiving 1 documents
10329,1: [DbDataStore] PushAndPull Replicator: 5/5, activity = Busy
10332,1: [DbDataStore] Doc ID: User:5588340C9EF20DB0C1258051004946C4 (access removed)
10406,1: [DbDataStore] Pull replication finished receiving 1 documents
10411,1: [DbDataStore] PushAndPull Replicator: 6/6, activity = Busy
10413,1: [DbDataStore] Doc ID: User:B8A0ED0E45D55427C125829E006C0001 (access removed)
10483,1: [DbDataStore] Pull replication finished receiving 2 documents
10486,1: [DbDataStore] PushAndPull Replicator: 8/8, activity = Busy
10488,1: [DbDataStore] Doc ID: User:1A8699C7C60CFD12C1258141006C12AD (access removed)
10491,1: [DbDataStore] Doc ID: User:BFF4CE231CB09556C125832E00193CE1 (access removed)
10553,1: [DbDataStore] Pull replication finished receiving 1 documents
10556,1: [DbDataStore] PushAndPull Replicator: 9/9, activity = Busy
10558,1: [DbDataStore] Doc ID: User:A0B70B94D81E8B1BC1257F370031521A (access removed)
10693,1: [DbDataStore] PushAndPull Replicator: 9/10, activity = Busy
10759,1: [DbDataStore] Pull replication finished receiving 1 documents
10762,1: [DbDataStore] PushAndPull Replicator: 10/10, activity = Busy
10764,1: [DbDataStore] Doc ID: User:F5D51F8E6AA72157C1257F670066865B (access removed)
10832,1: [DbDataStore] Pull replication finished receiving 2 documents
10837,1: [DbDataStore] PushAndPull Replicator: 12/13, activity = Busy
10838,1: [DbDataStore] Doc ID: User:9D5AEA94A9291965C1257F1000744793 (access removed)
10840,1: [DbDataStore] Doc ID: User:C0929848FE4AEC22C12580DF0059493F (access removed)
10896,1: [DbDataStore] Pull replication finished receiving 3 documents
10898,1: [DbDataStore] PushAndPull Replicator: 15/15, activity = Busy
10902,1: [DbDataStore] Doc ID: User:50AD4B38C46638BFC1258346005D5886 (access removed)
10908,1: [DbDataStore] Doc ID: User:41AA0661C241C70AC12580A70061E668 (access removed)
10910,1: [DbDataStore] Doc ID: User:EC0CBDCE63CB1BF1C1257F5F0038A264 (access removed)
11016,1: [DbDataStore] PushAndPull Replicator: 15/16, activity = Busy
11078,1: [DbDataStore] Pull replication finished receiving 1 documents
11081,1: [DbDataStore] PushAndPull Replicator: 16/16, activity = Busy
11082,1: [DbDataStore] Doc ID: User:0DEE3D32F242AC30C125848800666090 (access removed)
11147,1: [DbDataStore] Pull replication finished receiving 1 documents
11149,1: [DbDataStore] Doc ID: User:8318C7E8D51E6BA0C125808F0042999E (access removed)
11152,1: [DbDataStore] PushAndPull Replicator: 17/17, activity = Busy
11232,1: [DbDataStore] Pull replication finished receiving 1 documents
11235,1: [DbDataStore] PushAndPull Replicator: 18/18, activity = Busy
11236,1: [DbDataStore] Doc ID: User:4E0E05AA9D7BC38EC1257F5E005F6C33 (access removed)
11418,1: [DbDataStore] PushAndPull Replicator: 18/19, activity = Busy
11500,1: [DbDataStore] Pull replication finished receiving 3 documents
11503,1: [DbDataStore] PushAndPull Replicator: 21/21, activity = Busy
11504,1: [DbDataStore] Doc ID: User:3060D4FCEBE20DBEC12581CC00453CA4 (access removed)
11506,1: [DbDataStore] Doc ID: Photo:5d52a468a8864015c305950d (access removed)
11507,1: [DbDataStore] Doc ID: User:22D916804490D371C12584EF0034C437 (access removed)
11630,1: [DbDataStore] PushAndPull Replicator: 21/22, activity = Busy
11706,1: [DbDataStore] Pull replication finished receiving 1 documents
11709,1: [DbDataStore] PushAndPull Replicator: 22/22, activity = Busy
11711,1: [DbDataStore] Doc ID: User:6FF42B909049FDEFC12580D00052D80A (access removed)
11860,1: [DbDataStore] PushAndPull Replicator: 22/40, activity = Busy
11929,1: [DbDataStore] PushAndPull Replicator: 22/41, activity = Busy
12420,1: [DbDataStore] PushAndPull Replicator: 22/42, activity = Busy
18626,1: [DbDataStore] PushAndPull Replicator: 22/43, activity = Busy
19791,1: [DbDataStore] PushAndPull Replicator: 22/48, activity = Busy
19894,1: [DbDataStore] PushAndPull Replicator: 22/52, activity = Busy
19975,1: [DbDataStore] PushAndPull Replicator: 22/54, activity = Busy
20063,1: [DbDataStore] Pull replication finished receiving 1 documents
20065,1: [DbDataStore] Doc ID: Photo:5e9ffe02d63618173404a7a2 (access removed)
20067,1: [DbDataStore] PushAndPull Replicator: 23/58, activity = Busy
20164,1: [DbDataStore] PushAndPull Replicator: 23/61, activity = Busy
20232,1: [DbDataStore] PushAndPull Replicator: 23/98, activity = Busy
20462,1: [DbDataStore] PushAndPull Replicator: 23/104, activity = Busy
20548,1: [DbDataStore] PushAndPull Replicator: 23/105, activity = Busy
20803,1: [DbDataStore] PushAndPull Replicator: 23/105, activity = Idle
20804,1: [DbDataStore] Repl. completed on: 12-06-2020 12:53:28. Duration=00:00:43.3215690, pulls=17, pushes=0
To be able to follow what is going on (and capture time/count/etc.) I have added a ChangeListener
and a DocumentReplicationListener
(writing the “Doc ID: …” messages).
Out of curiosity: What could cause the “…(access removed)” messages AFTER a login? The same docs are in the “!” channel for “read only”… I must be doing something that I did not intend to do - but not sure where to look for it.