realtime icon indicating copy to clipboard operation
realtime copied to clipboard

Batch messages sent to subscribers

Open AntonOfTheWoods opened this issue 3 years ago • 1 comments

Feature request

In order to allow for efficient updates to subscribers when hundreds/thousands of db rows are inserted/updated, it would be preferable to have subscriptions capable of being fed with bulk updates, rather than a separate message for each row inserted/changed.

Is your feature request related to a problem? Please describe.

I have a bulk import feature and the changed entries need to be pushed to all devices in real time. The entries would be stored locally (via rxdb) and need to be kept in sync.

Describe the solution you'd like

The push messages for the subscriptions should be able to contain all the rows affected from a single insert/upsert/update/delete transaction.

Describe alternatives you've considered

Create a "bulk_updated" table that could receive updates with a table name, which would then cause the local store to disconnect for that particular table, download the full diff, then reconnect for realtime (single row) updates again.

AntonOfTheWoods avatar Oct 05 '22 11:10 AntonOfTheWoods

@AntonOfTheWoods thanks for this!

I think the workaround here would actually work very well.

But it would definitely be nice for Realtime to automatically batch stuff for you when needed. I updated the title to reflect this a bit better.

chasers avatar Dec 14 '22 16:12 chasers