[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

synchronizing Database operations

Posted on 2011-04-23
11
Medium Priority
?
525 Views
Last Modified: 2013-11-13
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
0
Comment
Question by:ajayvegesna02
  • 5
  • 2
  • 2
  • +1
10 Comments
 
LVL 24

Expert Comment

by:johanntagle
ID: 35452955
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
 

Author Comment

by:ajayvegesna02
ID: 35452963
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
 
LVL 24

Accepted Solution

by:
johanntagle earned 1000 total points
ID: 35452983
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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 81

Expert Comment

by:arnold
ID: 35453086
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
 
LVL 27

Assisted Solution

by:mrcoffee365
mrcoffee365 earned 1000 total points
ID: 35457571
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
 

Author Comment

by:ajayvegesna02
ID: 35514580
Thanks for ur valuable suggestions.

Thanks,
Ajay
0
 
LVL 24

Expert Comment

by:johanntagle
ID: 35689108
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
 
LVL 24

Expert Comment

by:johanntagle
ID: 35693231
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
 
LVL 81

Expert Comment

by:arnold
ID: 35693419
I think http:#a35457571 rather than http:#a35514580 should be included in the point split as referenced in the http:#a35693231.
0
 
LVL 24

Expert Comment

by:johanntagle
ID: 35693496
Yeah, you're right arnold, wrong copy+paste on my part.
0

Featured Post

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This post looks at MongoDB and MySQL, and covers high-level MongoDB strengths, weaknesses, features, and uses from the perspective of an SQL user.
If you are a mobile app developer and especially develop hybrid mobile apps then these 4 mistakes you must avoid for hybrid app development to be the more genuine app developer.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

872 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question