1

Here's the scenario:

I'm working on decision-support system which is being developed as windows forms client and MySQL database server. There are sources which update data in real-time in the MySQL database and my application is supposed to read and refresh the latest data every second and present them to user in graphically rich forms of presentations like graphs, bars, grids etc.

Now, we are facing problems and have performance bottlenecks. We found reading directly from database is a main problem and we want to boost this transaction. I came across memcached but I'm not sure if I can use this in this scenario. Can you please help me in removing this bottleneck? Can memcahced be used in this scenario? What are the different alternatives that can come to help in this situation?

Preferably, I would want to perform everything in memory and keep taking the database snapshots every 15 minutes to the disk. Is there a way I can do this?

Răzvan Flavius Panda
  • 21,730
  • 17
  • 111
  • 169
this. __curious_geek
  • 42,787
  • 22
  • 113
  • 137
  • Are you experiencing performance bottleneck when you read data from db? You have too many reads? – TheBoyan Jan 04 '12 at 14:23
  • Specifically what part of "reading the database" is the bottleneck? Network? Memory caching won't help much. DB server memory/disk? Upgrade the server. Do you plan to cache the data in memory on the server or on the client? IMHO you'll get a lot more bang for your buck narrowing down the bottleneck even more and addressing that problem directly. – D Stanley Jan 04 '12 at 14:24
  • If you prefer taking snapshots every 15min so why not to read data to memory and refresh it every 15min instead of reading every second(caching is in my mind)? or Iam missing something here? – Renatas M. Jan 04 '12 at 14:47
  • How best to solve this depends largely on how big your database is, how fast the network is, and how up-to-date you want your client to be. One option might be to set up triggers in the MySQL database to write changes to a change-history table - this would be a lot less data to poll continuously and would then allow you to go through the list and update only the changed fields rather than pull the entire database for every query. Oracle uses Database Change Notifications (events pushed from the DB) but I don't think you can do this easily with MySQL without writing most of it yourself. – J... Jan 04 '12 at 19:07

0 Answers0