Optimize updates synchronization to client apps
What? The Management service sends updates to the connected client apps on every change of the network. E.g. once a new peer has been added (joined the network) all other peers will receive an update. Support periodic updates (batching) instead of sending a message to peers on every change. +Only send updates to the clients in case there were any. Why? It is not really necessary to send messages on every change, especially when it comes to the "burst" of new peers (e.g. deployment on infrastructure via ansible/terraform). Peers are added with a few millis difference causing numerous events sent to the clients while it is just fine to send an update every N seconds (e.g. 5 sec) in case some changes have been detected.
Example (now):
- 200 peers are being provisioned
- they all call the registration endpoint of the management service each generating a new change to the network
- for every new registration there will be an update sent to other peers
- if these registrations are happening simultaneously there will be 200 events produced within a very short amount of time (seconds)
It is juts better and more efficient to collect those events over a few seconds and send a batch update.
How?