469,890 Members | 2,121 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,890 developers. It's quick & easy.

Best practice: different db for different users OR user ID in same db?

I am not sure what the most effective way to organize a db for users
is.
I have 40 users (teachers) and 20 tables (grades, assignments,
students, etc).
Each needs access to its OWN grades, assignemnts, etc.
NOW I am not sure how to orgainize users in the DB. Right now I have
the code for 1 user and need to adapt it to several users.

1. A user id in each table and the same db for all users.?

OR

2. A different db with its own set of tables (same names) for each
user.?
Option 1. would be easier for me because it would only involve adding
an id to a the connection string in the include. Option 2, would
require modifying query strings throughout the code in the
application.

However I heard that ISPs usually limit the number of dbases per Mysql
server (don't know why).
On the other hand the dbase per user approach seems to me more
efficient since the number of records in a table is greatly reduced
and each user has access only to its own db.

What is best/common practice in this situation having in mind that the
number of users is limited to around 40 if that makes any diffrence at
all.
Thanks
Jul 20 '05 #1
2 1448

"John Pastrovick" <pa*********@hotmail.com> kirjoitti viestissä
news:a2**************************@posting.google.c om...
I am not sure what the most effective way to organize a db for users
is.
I have 40 users (teachers) and 20 tables (grades, assignments,
students, etc).
Each needs access to its OWN grades, assignemnts, etc.


I think normally something like this (I assumed that a project is made of
many assigments):

users-table: (or teachers or students)
user_id
user_name
user_pword
user_firstname
user_surname
etc...

courses-table:
course_id
course_name
course_description

grades-table:
grade_id
grade_value
grade_user_id
grade_course_id

projects-table:
project_id
project_name
project_description

assignments-table:
assignment_id
assigment_name
asssignment_description
assigment_user_id
assigment_project_id


Jul 20 '05 #2

"John Pastrovick" <pa*********@hotmail.com> kirjoitti viestissä
news:a2**************************@posting.google.c om...
I am not sure what the most effective way to organize a db for users
is.
I have 40 users (teachers) and 20 tables (grades, assignments,
students, etc).
Each needs access to its OWN grades, assignemnts, etc.


I think normally something like this (I assumed that a project is made of
many assigments):

users-table: (or teachers or students)
user_id
user_name
user_pword
user_firstname
user_surname
etc...

courses-table:
course_id
course_name
course_description

grades-table:
grade_id
grade_value
grade_user_id
grade_course_id

projects-table:
project_id
project_name
project_description

assignments-table:
assignment_id
assigment_name
asssignment_description
assigment_user_id
assigment_project_id


Jul 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

131 posts views Thread by Peter Foti | last post: by
136 posts views Thread by Matt Kruse | last post: by
reply views Thread by Anonieko Ramos | last post: by
1 post views Thread by Waqarahmed | last post: by
reply views Thread by Salome Sato | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.