synchronizing Database operations

Hi,

I have developed the web application using struts 2.0 as front end and mysql as back end.

many users accessing web site , so i want to synchronize the database operations either in mysql or sending the queries synchronously to mysql db in java.

How can i achieve this functionality???

Thanks,
Ajay
ajayvegesna02Asked:
Who is Participating?
 
johanntagleConnect With a Mentor Commented:
First thing you need to focus on is determine where your bottleneck is.  How do you know it's the database - is the cpu consumption high?  Anyway, if it is the database, I will always start on your database schema - is your design optimal?  Do you have the right indexes in place?  Are your queries efficient?  No amount of server tuning will be enough if you don't have those questions addressed first.

You may want to sign up for services like newrelic.com (http://newrelic.com/java-app-performance.html) - you can try their Gold plan for 7 days - in our case we found the performance bottlenecks on our site (badly formed queries) within 2 days.
0
 
johanntagleCommented:
Don't quite understand your question.  You said your application already uses mysql as back end.  To me that means you're already able to save, edit, delete and read from the database.  What other operations do you want "synchronized"?
0
 
ajayvegesna02Author Commented:
hi


I have many users accessing the web site ..  so i am getting large impact on the database.. so how can i reduce the burden on db?

Thanks,
ajay
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
arnoldCommented:
If you have access to phpmyadmin use it to see whether the issue is with the mysql database under (process)/status phpmyadmin provides information on where items need to be corrected. i.e. not enough tmp table size, etc.

Do you have separate web and database servers?
Are you looking to setup a master/master replication?
Each server is both the master and the slave to the other server.
http://www.howtoforge.com/mysql_master_master_replication
This way if you have two web server they can each query and get data from the local with the other as a failover.  This way you can distribute the load.

Note that you MUST make sure to monitor the replication (mysql slave status) as soon as the replication breaks, you need to correct it.  If too much time is allowed to pass, the faster corrective method will be to reestablish the replication on the node where the error occured.
0
 
mrcoffee365Connect With a Mentor Commented:
In a Web application using a database, the database access is almost always the performance bottleneck.

However, architects almost never solve that problem by not making the reads and updates at the time the users request them.   Even MySQL is designed to handle large numbers of reads, and less large numbers of writes.  So unless you're doing 1000s of reads at the same time (in the same second, say), you are not in a situation where the database access needs to be blocked.  That sort of activity would typically be seen if you have 1 million users per hour.  If you have that sort of activity, someone at your company knows how to handle this situation.

As previous posters here have said, you need to figure out what is slow with your database application, and fix that.  

If you insist on collecting user requests for database reads and/or writes, then the way you do that is collect the requests and send them to a batch process for read/write.  Poor design for almost all purposes, but that is the way it would be done.

Don't try replication -- it sounds as if you are too new to db management to do that successfully.  It's difficult, with even more caveats than the previous poster listed.
0
 
ajayvegesna02Author Commented:
Thanks for ur valuable suggestions.

Thanks,
Ajay
0
 
johanntagleCommented:
Ajayvegesna02, I don't mind not getting any points myself, but I think you should give credit to those who took time to help.  You yourself have said you received valuable suggestions, so why not just close the question the usual way?
0
 
johanntagleCommented:
I vote for #3 and just spread the points to 35452983, 35453086, 35514580.  The author gave a very general question, and all of the suggestions were technically sound, so all just spread the points evenly.
0
 
arnoldCommented:
I think http:#a35457571 rather than http:#a35514580 should be included in the point split as referenced in the http:#a35693231.
0
 
johanntagleCommented:
Yeah, you're right arnold, wrong copy+paste on my part.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.