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

x
?
Solved

Mysql using multiple databases

Posted on 2011-04-19
3
Medium Priority
?
334 Views
Last Modified: 2012-05-11
I am looking at parts of my application to access data from two separate databases.

I am just wondering what sort of resources this uses as I am trying to understand it better.

There is only a small amount of data in the other database it needs to access.  For system performance am I better to put the table and data into the one database?  I would prefer not to double up the same data into two databases if I can, but am interested in the performance side, especially if I have a large number of users on this, as hoped.

I would appreciate advice from an expert on this.
0
Comment
Question by:debbieau1
  • 2
3 Comments
 
LVL 7

Accepted Solution

by:
DanielleFavreau earned 2000 total points
ID: 35430125
I'm not an expert on here but do run hundreds of MySQL databases in various environments and have encountered this situation several times with client sites that I work on.

A.
If separate parts of your application will access the databases independently (e.g. Page A only interacts with Database A and Page B only interacts with Database B) then you should be fine.

B.
If a single part of your application needs to simultaneously query both databases and display data from both databases then you're best to import the table(s) from Database B into Database A and use joins (if necessary) to pull that data together into your application so it only has to query a single database.

Querying two separate databases to populate a single document/page/view will take slightly more time, and it may not be noticeable initially, but may impact performance if this is a heavily queried document/page/view.
0
 
LVL 1

Author Closing Comment

by:debbieau1
ID: 35431382
Thanks
0
 
LVL 7

Expert Comment

by:DanielleFavreau
ID: 35434447
You're welcome.  Thank you for taking the time to review my answer.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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.

Question has a verified solution.

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

This article shows the steps required to install WordPress on Azure. Web Apps, Mobile Apps, API Apps, or Functions, in Azure all these run in an App Service plan. WordPress is no exception and requires an App Service Plan and Database to install
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
The viewer will learn how to count occurrences of each item in an array.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Suggested Courses
Course of the Month19 days, 1 hour left to enroll

834 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