3 ms·
> I pushed a quick fix to the issue by freezing the data being sent to the client, thereby halting the rapid growth in data consumption. What do you mean by "f
by boberoni 5y ago
> I pushed a quick fix to the issue by freezing the data being sent to the client, thereby halting the rapid growth in data consumption.
What do you mean by "freezing the data"?
Regarding the excessive download problem, my first instinct is to periodically (for example, every hour) compute summary statistics for the bar chart and store that in Firebase. This, of course, would require an additional script/service to perform these periodic jobs.
I'm not sure if that's what you ended up doing and I'm curious what your solution is.
- malfist 5y agoProbably (and I'm guessing, not the author here) took a snapshot of the data and hardcoded that to be sent to the client instead of live data.
- noahtallen 5y ago> This, of course, would require an additional script/service to perform these periodic jobs. Also worth noting that Firebase has built-in “cloud functions” which have access to the database API. It would be pretty easy to run one on a schedule.
- bocytron 5y ago> What do you mean by "freezing the data"? https://github.com/JinayJain/just-a-minute/blob/master/app.js#L119 https://github.com/JinayJain/just-a-minute/blob/master/app.j...
- jinay 5y agoAs others have mentioned, my solution in the moment was to download the JSON file from Firebase, compute histogram statistics manually, and hardcode the histogram into the JS itself. Obviously not a scalable solution, and I think I would have done something very similar to the periodic updates like you mentioned (if I had more experience with cloud functions etc.)