getditto / DittoAndroidTools

Diagnostic and Debugging Tools for Ditto Android SDK
MIT License
6 stars 1 forks source link

Android - tweaks to heartbeat collection subscription (part 1) #74

Open bplattenburg opened 4 months ago

bplattenburg commented 4 months ago

Today, we automatically subscribe any device using the hearbeat tool to the entire dittotools_devices collection, but that doesn't scale to production across multiple locations.

We either need to provide a way to disable this subscription (which has the downside of breaking multihop for a device which can't see the big peer e.g. lost LAN but still has BLE) or provide the ability to scope it to a more limited query like "devices at the same locationId as this device"

Note - we should also pair any limited query here with a matching eviction query to cover devices changing location and other edge cases

bplattenburg commented 3 months ago

In the short term, the path forward here is to use publishToDittoCollection in the heartbeat config to control whether to subscribe to the collection.

Longer term, I'll break out a story (link to be added here) to narrow the subscription to something like "devices in the same location" to allow for flooding & multihop to get data out without pulling data in from remote devices

bplattenburg commented 3 months ago

Part 2 (location-specific subscriptions) broken out into #84