I’m doing a function to calculate the number of clicks on an element on a website. I use PostgreSQL, back-end is nodejs. When a user clicks on an element, I will send a request to the server and update the number of clicks in the database. The number of simultaneous clicks will range from 100 – 200 clicks/s.
I ask you guys to give me the optimal solution. Thank you.
My solution is to use Redis to store the number of clicks. After every 24 hours, I will read the number of clicks from Redis and update it to the database. I want to ask is this solution good? And if not, what is the better solution?