Posted by sarithasi-16371 under ASP.NET on 5/30/2014 | Points: 10 | Views : 428 | Status : [Member] | Replies : 1
I have a large Database, in which updation/insertion will happen every time. I need to create a site which will show the live count of data based on the DB. For that I am calling the DB every time to get the live count but its not good every time sending DB request. Is there any better way to point out this? I am using mysql database.



Posted by: Vuyiswamb on: 6/2/2014 [Member] [MVP] [Administrator] NotApplicable | Points: 25

There is no way to get a true reflection of the data without hitting the DB. What you need is to be strategic when hitting the DB, you must decide on the interval to hit the DB and run a very low resource Query to determine if you really need to hit the DB. if i were you i will store the DB results in a static variable and update my web app from that and constantly go back to the DB to check the count if are the same as the one on the cache, if they are not , then i update the catch else i keep reporting from the Cache.

Thank you for posting at Dotnetfunda

sarithasi-16371, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response