0
I have a wordpress plugin of related posts, I have a table where I update the number of clicks and the number of views of each post! The problem is, on big sites I’m taking down servers with so many updates in the bank, since I do this every visit and every click!
This image shows the plugin updating to the database each time!
Is there a way to reduce these querys? With cache maybe, but I don’t know how to do.
You can store this information in a text block and then go up in the database at once.
– Andrei Coelho
How to implement this will depend a lot on the structure of your application and the strategy for using this data. For example, if you have how to register these clicks in an external BD, separate from your application and dedicated to it, in theory this can solve. If this is not possible you need to implement an asynchronous routine, putting these requests in queues to be executed when the server has available resources. Otherwise it’s potato that will bring down the site in a peak of hits.
– Ricardo Moraleida