|
|
||||||
|
#1
|
|
|
|
|
I'm developing a website with six products. The DBMS is MySQL. I want
to design seven databases on one DBMS,namely, MySQL, one for each, and the 7th database is a common database shared among the six products.There is a problem, I often need cross- database operations. I want to create some stored procedures/routines and some of them need cross-database operations and I don't know how to do it.It is MySQL. Is it a good idea to design only one database (the parameter in mysql_select_db()) with many many tables? What are the advantages and disadvantages? For example, on the website of yahoo.com, there are so many web products, Yahoo! answers is one of them. On the website of google.com, there are so many products,say,Google Web search, Google shopping, Google maps, gmail, etc. There is one website(one domain) with many subdomains,say,google.com is a domain, and images.google.com is a subdomain. One owner will own the entire website. I was surprised the concept "database" in phpMyadmin is the same as the concept "schema", which is the very parameter in mysql_select_db (). So what do you mean by "database" or "schema"? |
|
|
|
#2
|
|
|
|
|
Phper schreef:
> I'm developing a website with six products. The DBMS is MySQL. I want > to design seven databases on one DBMS,namely, MySQL, one for each, and > the 7th database is a common database shared among the six > products.There is a problem, I often need cross- > database operations. I want to create some stored procedures/routines > and some of them need cross-database operations and I don't know how > to do it.It is MySQL. Is it a good idea to design only one database > (the parameter in mysql_select_db()) with many many tables? What are > the advantages and disadvantages? If the products in the database are related, why not stuff them all into one and the same database? However, if there are six different costumers, you better use 6 databases. > > For example, on the website of yahoo.com, there are so many web > products, Yahoo! answers is one of them. On the website of google.com, > there are so many products,say,Google Web search, Google shopping, > Google maps, gmail, etc. There is one website(one domain) with many > subdomains,say,google.com is a domain, and images.google.com is a > subdomain. One owner will own the entire website. You can easily connect from the same PHP script to many different databases, even different brands. Simply make more connections. > > I was surprised the concept "database" in phpMyadmin is the same as > the concept "schema", which is the very parameter in mysql_select_db > (). So what do you mean by "database" or "schema"? Database is the general word describing the whole thing. A schema means (in Postgresql at least) the structure and relations inside one database. So you say: I use database MySQL, and this particular instance has its schema defined here and here. So the schema says how the tables are named, what colums they hold, what relation certain columns have to other tables (foreign keys), etc, etc. In casual writing they are interchangable. Regards, Erwin Moller |
|
#3
|
|
|
|
|
Phper wrote:
[..] > For example, on the website of yahoo.com, there are so many web > products, Yahoo! answers is one of them. On the website of google.com, > there are so many products,say,Google Web search, Google shopping, > Google maps, gmail, etc. There is one website(one domain) with many > subdomains,say,google.com is a domain, and images.google.com is a > subdomain. One owner will own the entire website. > > I was surprised the concept "database" in phpMyadmin is the same as > the concept "schema", which is the very parameter in mysql_select_db > (). So what do you mean by "database" or "schema"? Database design is best asked in a database newsgroup - such as comp.databases.mysql in your case. You'll find the database experts there with better answers to your questions. |
|
#4
|
|
|
|
|
Erwin Moller wrote:
> Phper schreef: > > If the products in the database are related, why not stuff them all into > one and the same database? > However, if there are six different costumers, you better use 6 databases. >> > You can easily connect from the same PHP script to many different > databases, even different brands. Strictly, you don't make a new connection: Just use mysql_select_db However cross database joins are not possible. |
|
#5
|
|
|
|
|
The Natural Philosopher wrote:
> Erwin Moller wrote: > > Strictly, you don't make a new connection: Just use mysql_select_db > > However cross database joins are not possible. Incorrect. |
|
#6
|
|
|
|
|
Jerry Stuckle wrote:
> The Natural Philosopher wrote: > > Incorrect. > Example in Mysql.? |
|
#7
|
|
|
|
|
The Natural Philosopher schreef:
> Jerry Stuckle wrote: > Example in Mysql.? Go to google: type: cross database joins mysql follow first link. ;-) http://www.shawnhogan.com/2005/12/cr...ith-mysql.html Regards, Erwin Moller |
|
#8
|
|
|
|
|
The Natural Philosopher wrote:
> Jerry Stuckle wrote: > Example in Mysql.? It's off-topic in a PHP newsgroup. Learn to use Google - or read the doc. |
|
#9
|
|
|
|
|
On 1 May, 16:20, Phper <histeven> wrote:
[..] > For example, on the website of yahoo.com, there are so many web > products, Yahoo! answers is one of them. On the website of google.com, > there are so many products,say,Google Web search, Google shopping, > Google maps, gmail, etc. There is one website(one domain) with many > subdomains,say,google.com is a domain, and images.google.com is a > subdomain. One owner will own the entire website. > > I was surprised the concept "database" in phpMyadmin is the same as > the concept "schema", which is the very parameter in mysql_select_db > (). So what do you mean by "database" or "schema"? This is rather off-topic here, and your terminology is very confusing - based on the examples you provided you seem to be describing 6 services or applications - not products. Without doing a lot of analysis work on your website (no, that was not an invitation) its hard to say for sure, but splitting the applications into dedicated databases may simplify a lot of the management of the site - the key thing is to identify if you have any joins across the applications and see how practical it would be to eliminate them. Also read up on MySQL replication. C. |
|
|
| Similar Threads | |
| Database design many to many relationships I need to come up with a good design for a database addressing client payment discrepancies. The main goals that I have are to track the number of issues generated along... |
|
| Tables design for many-to-many relationship I've inherited a database for tracking chemical standard inventory and want to expand it. Right now, we log all our pure standards (PS) into it. Each PS may be used to... |
|
| DESIGN DATABASE AND MANY TO MANY RALATIONSHIPS PLease help me with designing the tables and setting the relationships as i am unable to work with subforms. The databse has to be designed for interschool competions where... |
|
| Database Design Q: Many Rows or Many Tables? Hi there I'm in the planning stages of creating a database, and I have two options here. Which makes more sense, and/or provides better performance for queries - a single... |
|
|
All times are GMT. The time now is 07:09 PM. | Privacy Policy
|