Moderator
I'm building a real-time boat tracker.
The idea:
-
A table stores the location updates of each individual boat.
-
Another table stores an aggregated JSON document with the positions of all boats. This JSON is sent to all clients with the real-time API.
If there are, for example, 100 boats updating every second, I would end up with 100 updates per second to the aggregated JSON, which is too frequent and creates high load for both clients and server.
I want to limit the frequency of updates to the aggregated document (e.g., update it at most once per second), while still keeping all individual boat positions up-to-date. What would be the best approach to implement this?