I am working on a system where users can subscribe to places and places can see these users in their CMS. But now I want to create statistics for the places.
Some o
Unlike most traditional SQL databases, Firebase's Realtime Database is not well suited for ad-hoc aggregation queries. You will have to know up front what stats you want to track and update them as the data streams into/through your system.
Doing this client-side is certainly possible, but indeed not ideal. This is a perfect use-case for using the just-released Cloud Functions for Firebase. It falls closest to the use-case of sanitizing incoming messages:
A good, simple example of an aggregation function is this child counter.