Continuous Pull / LiveQuery on mobile clients

Hi all,

we are fairly new to CB transiting (conceptually for now) from MongoDB and we have a scenario, where we can use a best practise suggestion.

Scenario:
We are designing an event app for 100-200K users that pulls content around a festival.
Within that data we have content that may get updated in a low frequency (correction to the event program) and content that has high frequency (e.g. parking lot occupancy).
Each content type is displayed in its own view, respectively activity.

Now, I came to following strategy:

(1) start app: Create an DBManager and database instance.
create pull one-shot replication for data on all channels to populate the app or refresh all content.
(2) onStop/onDisappear (view is overlayed by another one): stop replication (unless not required as a one-shot pull)
(2) go into parking view: create another replication instance and start a continuous pull for channel ‘parking’,
(3) leave parking view: stop replication
(4) same as (2, 3) for the program view just on another channel

That way we hope to reduce traffic for users that don’t look at the parking view.
We were also looking at liveQuery for filtering. But, since it works on top of the continuous replication, we need to filter the content on replication level using channels.

I appreciate any comment like “yes, you got it right” :slight_smile: or "“no, do it like this” :).

Thanks for your help,
Ulf

Most of the time an app will make its main replication continuous, and leave it running except when the app itself is backgrounded. This ensures that app content stays up to date. (But there’s no rule that you have to do that.)

Creating a secondary replication for data you only need in one view is reasonable. Presumably you’d exclude that channel from the main replication so it’s not always being fetched.