Jump to content

Multiple Databases


guitarclap

Recommended Posts

Two questions:

1. Does the # of tables in a db affect the performance?
2. Is it possible to "replicate" or "link" tables from 1 db to another?...

[table]
[tr]
[td][b]DB: core[/b][/td]
[td][b]DB: app1[/b][/td]
[td][b]DB: app2[/b][/td]
[/tr]
[tr]
[td]Table: users (id,username)[/td]
[td]Table: albums (id,user_id,name)[/td]
[td]Table: messages (id,user_id,name)[/td]
[/tr]
[/table]

Is there any way to setup mysql to "link" from core.users so the table is also available in app1 and app2 db?  I see there is replication but I am not sure that is what I want and that takes a lot of configuration.

USE app1;
SELECT * FROM albums LEFT JOIN users ON (users.id=albums.user_id)

or will it always have to be

SELECT * FROM app1.albums LEFT JOIN core.users ON (core.users.id=app1.albums.user_id)
Link to comment
https://forums.phpfreaks.com/topic/27637-multiple-databases/
Share on other sites

Well we want to create 4 completely different sites but all need to feed off of the same user/profiles/accounts/etc tables.  I asked #1 question how many tables can 1 db have before performance starts being an issue?  My first option was to just prefix the tables to help with organization but I wonder if say 200 tables is better than 4 databases with 50 each.



Link to comment
https://forums.phpfreaks.com/topic/27637-multiple-databases/#findComment-126435
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.