If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > When do we use different databases ?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-22-07, 11:50
keenlearner keenlearner is offline
Registered User
 
Join Date: Mar 2007
Posts: 2
When do we use different databases ?

Hi i am beginner on mysql, I am blur on when do we have to use different databases when we can just store all things with many tables on one database.

I build a user login, so I create the database 'users_data', with table 'users' that store the very general of user's information (id, username, password) that's all. Next, I want to store user's preference so I create another table called 'users_preference' . But I feel like it's more robust to separate the 'users' table to another database called 'login', because when I want to develop many more other applications other than user's preference, how true or false am I ? I also grant the privilege for SELECT and MODIFY only on 'users' table but all privileges on 'users_preference' table, I some sort of knowing that we can grant privileges for a specific tables, but is it better to separate them into different database ? but how can I make combination for result retrieved from different database ? Please evaluate and give me advice, and tell me what I am wrong ? Thank you.

I think the above situation can be thought if I want to build something like Google account, that you only sign up one account, but you can use the same account on many Google website such as Gmail, Blogger, Google personalized page, Google adwords. How does this database architecture look like, I just want to know how does the database work on associating one user account to many application ? Thank you
Reply With Quote
  #2 (permalink)  
Old 03-22-07, 13:59
guelphdad guelphdad is offline
Registered User
 
Join Date: Mar 2004
Posts: 440
you would use a single database for a login procedure. you could use that database for logging in to all of those items if you wish.

if you have a different client altogether you may want to consider a separate database.
Reply With Quote
  #3 (permalink)  
Old 03-24-07, 11:19
keenlearner keenlearner is offline
Registered User
 
Join Date: Mar 2007
Posts: 2
Thanks

Now i have not doubt in combining tables which are related into one database
Reply With Quote
  #4 (permalink)  
Old 03-26-07, 07:31
aschk aschk is offline
Registered User
 
Join Date: Mar 2007
Location: 636f6d7075746572
Posts: 770
My recommendation is to keep everything in one database, else you will be making more than 1 concurrent connection to different databases to reference data. You also have to reference them by database.tablename for select statements, which will start to get large. It's easier just to use tablename.
e.g. select * worlddb.countriestable;
better : select * from countriestable;

assuming of course your user logs into a particular database.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On