All this means that every time a new response is created, these backend workflows take care of updating the required metric server side.
It’s then stored in your database as a static figure you can use for whatever you want. Put it in your UI, in an email or wherever you want. It will always be up to date and calculated for you to use.
Recurring Event Analytics
If your app has a lot of data, and multiple metrics you want to be able to track every day it may make sense for you to use a recurring event to calculate it.
This means there is a job that runs on your server at the same time every day which calculates metrics and stores them to your database.
For example, I use this in my application to make a daily count of all the feedback a user has received.
How many are positive, how many are negative, what was the total revenue for the day etc.
I then store all this data in a table called ‘analytics’ linked to the user’s company.
This means I’m able to show it on graphs and it will load lightning fast, as all the processing is already done every night at midnight and stored as simple numbers in my database.
The alternative would be to run extremely heavy and slow searches from my front end to populate charts which would result in a poor user experience.
There’s also the added benefit of having all these metrics easily accessible if you want to include them in a weekly summary email to your users for example.