Question Overflow
Question Overflow

Reputation: 11255

Merits of Storing Tables in Separate Databases for Same Project

I have four groups of tables:

Group A: tables which are queried only by unregistered users;

Group B: tables which are queried only by registered users;

Group C: tables which are queried by both registered and unregistered users; and,

Group D: tables which are queried only by the administrator.

I would like to know whether there are any merits, security or otherwise, of segregating them into separate databases if each group is independent of each other.

Upvotes: 0

Views: 113

Answers (4)

ypercubeᵀᴹ
ypercubeᵀᴹ

Reputation: 115530

One database for one project.

If your four table groups are really and completely independent of each other, then you have four projects, not one.

I can't imagine one project or application where there are entities that are completely irrelevant to each other.

Upvotes: 1

Johan
Johan

Reputation: 76537

I think this is a dangerous idea.
If you do maintenance and change the table layout on your tables you'll need to do it times 4.

Better idea would be to partition the tables per user group.

Upvotes: 0

Alex Howansky
Alex Howansky

Reputation: 53533

I wouldn't bother. For a web app, application security is going to be more important than database level security. I.e., putting four locks on your front door doesn't provide more security if you leave your windows open. If the tables logically belong to the same application, keeping them in the same database will make maintenance much easier. Also, if any of the users (like the admin) ever need to access tables in one of the other databases, then your app will need to juggle multiple active connections.

Upvotes: 2

Tetaxa
Tetaxa

Reputation: 4403

Performance. It's very easy to move the separate databases to different servers. Maybe not the best way of increasing performance, though.

Upvotes: 0

Related Questions