1) Pre-sync all data and query the local database
PowerSync currently performs well with syncing up to 1,000,000 rows per client. This means that in many cases, you can sync a sufficient amount of data to let a user keep scrolling a list or feed that basically feels “infinite” to them.2) Control data sync using subscription parameters
Use subscription parameters to subscribe to specific data on demand. For example, a client can subscribe to a specific “page” of data when the user scrolls to it. Each subscription is independent, so multiple tabs or views can subscribe with different parameters at the same time. Subscription parameters come from the client, so use them to select data, not for access control. Keep filtering by auth parameters such asauth.user_id().
Usage example: To lazy-load/lazy-sync data for infinite scrolling, you could split your data into ‘pages’ and use a subscription parameter to specify which pages to sync to a user.