We Talk Coding

Should I use multiple databases when creating a web application?

Hey there, Just wondering what is the best way to build my database. I know this question depends on what type of application I'm developing, but in general, I was wondering if it was common to separate some things out into different databases for security reasons - for example, keeping user info in a different db than everything else? I know there should be backup db's as well, but my question is specifically within a single web app? Thanks.

Public Comments

  1. I don't think it much matters on it's face whether you use multiple databases or not. As a matter of fact, you might want to keep things in one database if possible to make maintenance easier and to avoid the overhead of closing and opening connections to different databases repeatedly.
  2. same db is fine, but you should never host your DB anywhere near the folder of your web apps, and your user and PW for the DB should be alpha numeric, and completely obscure.
  3. You shouldn't do this if for no other reason than to maintain db integrity. I don't know of any database packages allowing you to create foreign key relationships cross database. If you're concerned about performance or space considerations use alternate filegroups, if you're concerned about security, use encryption. HTH.
Powered by Yahoo! Answers