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 > General > Database Concepts & Design > Should I create a new DB or use an existing DB?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-17-06, 12:52
leoncat leoncat is offline
Registered User
 
Join Date: Feb 2006
Posts: 7
Question Should I create a new DB or use an existing DB?

I'm trying to get a feel here from some other database professionals... what criteria would you use to decide whether or not a new system of tables should have its own database or be included in an existing database?

---
Our company database has about 40 tables which load daily from another extract environment. New requirements dictate that I need to load and retain a subset of 13 of these tables at a few different time intervals.

I could create the new schema in 1 of 2 ways...

1) add the new tables to the existing company database with time suffixes... as in :
tbl_Customer
tbl_Customer_6AM
tbl_Customer_8AM
tbl_Employee
tbl_Employee_6AM
tbl_Employee_8AM
tbl_Plan
tbl_Plan_6AM
tbl_Plan_8AM
...etc

OR

2) create two new databases named EARLY_REPORT_DB_6AM, EARLY_REPORT_DB_8AM, as in...

COMPANYDB
tbl_Customer
tbl_Employee
tbl_Plan
...etc

EARLY_REPORT_DB_6AM
tbl_Customer
tbl_Employee
tbl_Plan
...etc

EARLY_REPORT_DB_8AM
tbl_Customer
tbl_Employee
tbl_Plan
...etc


Other Notes :
------
- Regular users need access to the original tables only.
- A special report process will run using the 6AM DB & another special report process will run using the 8AM DB.
- By definition, these tables will never intersect (that is, we will never need to access tbl_Customer_6AM & tbl_Employee_8AM in the same query).


Would you include the new tables in the current database, or would you create two new databases. What would be the pros & cons of each?

Thank you all,
Leon
Reply With Quote
  #2 (permalink)  
Old 02-17-06, 14:03
r937 r937 is online now
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
i would create one new table (not two) and i would flag the rows as they are being inserted as either 6am or 8am

whether this table is in the same database or a new database doesn't matter
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #3 (permalink)  
Old 02-17-06, 15:51
leoncat leoncat is offline
Registered User
 
Join Date: Feb 2006
Posts: 7
That's a good suggestion.

Unfortunately, I can't do it that way because the tables could have a different set of relationships defined on them and it would require too much of an overhaul in SP code.

What's most important for me, though, is to get a feel for what criteria people use for creating a new database.

Thanks!
Reply With Quote
  #4 (permalink)  
Old 02-20-06, 18:42
loquin loquin is offline
Super Moderator
 
Join Date: Jun 2004
Location: Arizona, USA
Posts: 1,797
Different relationships?

Couldn't you build one table with flags as r937 suggested, and add views for the three groups?

Remember, your PK and FKs can consist of multiple fields.
__________________
Lou
使大吃一惊
"Lisa, in this house, we obey the laws of thermodynamics!" - Homer Simpson
"I have my standards. They may be low, but I have them!" - Bette Middler
"It's a book about a Spanish guy named Manual. You should read it." - Dilbert

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