Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 7th, 2004, 04:05 AM
Authorized User
 
Join Date: Feb 2004
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
Default best way with database...

Hi,

I just wanted to know what you guys think, is it best to have one database with all the tables you will need for your website, or to devide the database into different categories.

That is, do you prefer to have different databases with different names for different tasks, or do you make one database that can handle all the tasks on the website?

Thanks

/Thomas

 
Old June 7th, 2004, 04:39 AM
Friend of Wrox
 
Join Date: May 2004
Posts: 642
Thanks: 0
Thanked 43 Times in 42 Posts
Default

This depends on the complexity of the website.

I think keeping all the tables in one database will be good.


Om Prakash
 
Old June 7th, 2004, 05:37 AM
Authorized User
 
Join Date: Feb 2004
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
Default

In my case the website is quite complexed, and as it is now I have about five or six different databases. I quess I could combine them all, but that would lead to allot of re-coding. Therefor I dont feel that I want to do it in vain.

Besides, will it be better in terms of loading time? That is my main consern.

BS
As it is now, somethimes I must access two or even three different databases in one single document, and I just want to know if that is resource-demanding.
DS
 
Old June 7th, 2004, 05:51 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

If you tell us a bit about your application design, and explain why you have chosen for different databases, we might be able to give you some hints.

Personally, I would try to keep things for one application in one database. This makes it much easier to JOIN related tables on each other. It's much more difficult to join, say, a Customers table in one database with an Orders table in another.

How complex is complex in your situation? Why do you have so many databases?

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 
Old June 7th, 2004, 08:48 AM
Authorized User
 
Join Date: Feb 2004
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Okay, here´s the thing...

I have for example two different categories on my website. One is called "News" and one is called "Articles". On the first site (default) I have to open two different databases because I want to view both News and Articles on the same page. What I want to know is if I should prefer to combine these two databases into one, even though they are two totaly different sections of the website.

Also, im making other sections that has databases with alot of tables, and I was thinking that it would be hard to keep track of witch tables belong to witch category if I deside to combine the databases.

Thanks for helping out. I want the website to run as quickly as possible, and therefor I would like to know if this is an issue.

 
Old June 7th, 2004, 09:17 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Again, it depends on your entire application design (is all the information added and used from within the same application? Do users add records through a Web interface? Are there any back-end apps that need this info as well), but personally, I would create one database for a Web app like this.

In fact, I would even recommend a single table for the base characteristics. If you look at this from an Object Oriented way, a News Item and an Article have a lot in common. On my own web site, I have stuff like News, Articles, FAQs, Snippets etc etc. I designed a base class called Content. The Content class defines the generic properties that all content items share: a Title, an Author, a CreateDate, a ContentType etc etc. In my database, all this information is stored in a single table called Content.

More specialized information (e.g. the Question and the Answer of a FAQ item) is stored in separate tables, like FAQ. The FAQ table is linked to the Content table based on its ContentID.

To display specific information, I can do something like this:

SELECT ID, Title FROM Content WHERE ContentType = 3

This gets me all the News items, for example.

Storing related information in the same database and even same table makes a lot of things much easier. For example: my security layer uses the Content.ID to determine access for specific users. If I had stored my content in multiple database and tables, security maintenance would have much tougher.

Of course this is just one method of doing things. There are many other good and probably even better ways. It all depends on what you try to accomplish. If performance is the most important ingredient in your design: go for one database. If you depend on other (legacy) systems for your data, you sometimes don't even have the opportunity to use a single database. In such scenarios, you often have to deal with multiple databases and multiple database servers.....

HtH,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 
Old June 7th, 2004, 11:06 AM
Authorized User
 
Join Date: Feb 2004
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for the tips Imar

Cheers...






Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem to restore database in C#2005 database acmuralee MySQL 0 March 25th, 2008 04:42 AM
Microsoft JET Database Database Engine (0x80040E09 cannielynn0312 Classic ASP Professional 2 December 17th, 2007 02:50 AM
Copying Table From one Database To Anoter Database jayanth_nadig VB Databases Basics 1 June 19th, 2006 02:39 PM
Upload image to database or not to database? thachnn SQL Server ASP 0 October 11th, 2004 03:00 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.