473,569 Members | 2,522 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Database Design Question

5 New Member
Hi, I am in the process of develop a multiuser application. I started today with the database design and I am not sure how to proceed, I have two ideas, but since I am not sure which one will be better, I would like to see what others thinks would be the better approach, or even suggest a different approach if you can think of any other.

Lets suppose I have 1000 users. and each user will need to store information on 9 different places. But each place must be unique for the user (meaning, the user will be the only one writing there) - I am doing this because each user will be storing a lot of information and I am sure I can save a lot of processing time if I avoid the indexing and having to go through thousands of records to recover the records of a single user.

My question is, should I create 1000 databases (one database per user) each with 9 tables, or should I create 9 Databases each with 1000 tables (one table per user)?

I was thinking that maybe the 1000 databases was a better model because I can reduce the number of Database connections, since I can connect once and then send the querries to the different tables on the user database, while the other model needs 9 databases connections to get the same information out of the databases. Anyway I am not sure that is just my opinion, I can't think of any other model for this kind of application but If you do, I am open for suggestions.
Jan 19 '06 #1
5 1972
Niheel
2,456 Recognized Expert Moderator Top Contributor
How much information is being stored by each user?

1,000 databases are a lot harder to maintain than 9 databases. That is the first thing that pops in my head.

Maybe you can post a rough schema of what information is stored by each user. Also posts the basic queries you will be doing. Ex. "Look for age and income from all users whose age is over 10".

Get back with us, so we can help.
Jan 19 '06 #2
jensenat
5 New Member
Hi KUB365, thanks for your answer. We are in the design process and we dont have queries and all that tecnical details of the application yet. The users will be storing there all kind of information, so is not that we will be storing user information, but the users will be the ones storing data into the databases, the data for each user will be "personal" in a sense that the user itself will be the one providing his own data. For example, data can go from calendar entries (building our own calendar software as part of the application), meeting, apointments, accounts information, personal notes, address book and some extra data that will be produce as part of the company current web services running on the intranet. The thing is that we are providing some generic data templates that the application will be filling from dynamic data, this data is intended for only one user (or maybe a couple of users, but is not for a big comunity). So we were thinking that separating all the data by user was the correct approach. We can have a few databases and separate the data by adding a userid to specify who is the owner of this row, however I dont think that is a smart design due the fact that if I do that I will be searching for a couple hundreds of records in a table with possible millions of records. If I need to do that for about 1000 users (considering this is a small bussines) I will need to go with distributed databases or with big and expensive servers. They dont have the resources to manage all that and I think splitting the info by users will be better performancewise , plus we can use a couple of machines to manage users. I was thinking to use a separate database as a catalog to determine where is the "home database" for each user and from there, we connect to that database and we have everything for the user there on the same database.

I have plenty of programming (c/c++, java, asp, php, perl, jsp), web development (javascript, html, dhtml, xhtml, css, xml) and databases (oracle, db2, mssql, mysql) experience (9 years), but I never faced a design like this one, and it was odd to me, because while we were thinking on the design, I though that having close to 1000 databases was a crazy thing, but now I am starting to convince myself that maybe that is the best approach, however I am still accepting suggestions, since I am not behind in schedule yet and I want to have the best design as possible by the time we start writing code.
Jan 19 '06 #3
Niheel
2,456 Recognized Expert Moderator Top Contributor
Well maybe you are right. I have dealt with a company that has used the seperate database for each client approach. Scaling is lot easier, as you can just add more machines. The approach does work.

Things to consider should include;
  • deployment of codebase across multiple machines
  • deployment of changes to all the databases and machines
  • a master client database that keeps track of each users database password/username general stats - etc.
Well I think you have the right approach. If you feel in your gut this is the way to do it; you should attack the design of it on paper.

With any application design, forethought will save you a lot of time, resources and money in the future.

Keep us updated.

~KUB
Jan 19 '06 #4
jensenat
5 New Member
Thanks KUB. Just to add something else, I dont need deployment of source code accross different machines, we are going to use a current centralized database that will allow us to authenticate users They have this up and running and we are just adding a way to identify the server that has the database with all the new user data. The application server will have an interface to the database servers (for security purposes) so the communication between the database server and the application server will be through a web service (using an XML protocol) instead of a direct communication through ODBC, JDBC etc etc. The design is complex, but everything is clear, at least I think and hope so, there are still things that are not complete, but I think we are on the right path.

Two of the most importan requirements (I think this is a general requirement almost everywhere) is to have the less possible down time and an acceptable response time. So I have one server for the central catalog, and three servers for the databases. All these have replication schemas and backups just in case and to guarantee service availability, also I am planning to provide an extra server that will serve as the "six man" here, so if any of the servers goes down this extra server will assume that possition until the admins take care of whatever the error is. Like I said there is more behind all these, but I just wanted to give you a better idea what we are trying to do. Thanks for your help and like I said before, I am still open for suggestions if someone else wants to contribute with something.
Jan 19 '06 #5
taylan
5 New Member
Hi Jen,
Thank you again for your previous response (this is a follow up for my thread,"User Authentication" ), I tried to put your suggestion in the following script of mine but didnt work. As soon as it authenticates the user, it still stays at the authentication page instead of directing to a new page. Can you see whats wrong below? I basically want this authentication. php page to verify user_id and password and then if the user passes, then direct the user to another page.

Thank you again. Sorry for posting here but I was trying to find a way to reach you.

$request = "SELECT * FROM users WHERE password='".$pa ss."' AND username='".$us er."'";

//Pass the request to the mysql connection,
//and the data is returned in a blob and
//saved in $results
$results = mysql_query($re quest,$conn);


//if mysql returns any number of rows great than 0, we know we had a match,
//right?
if(mysql_num_ro ws($results))//function returns true if any matches are found
{
$_SESSION['user'] = $user;
$_SESSION['auth'] = true;
$url="http://myserver.com/redirected.php" ;

}
else
{
echo "User Name/Password Pair Not Found.";
$_SESSION['auth'] = false;
}


//End PHP file authenticate.ph p
?>
Jan 21 '06 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

0
1510
by: Lefevre, Steven | last post by:
Hey folks - Thanks to everyone who gave input to my concerns. Of course, we don't intend to have the mysql port open to the world. We will have Apache/PHP connect on a unix socket, or to another machine with a cross-cable on non-routeable IPs. But now I have another question. We are working on a web database to allow our suppliers to log...
2
1831
by: Josh McFarlane | last post by:
If this is not the right place to post this, I apologize. I've taken over work for a few utility programs for a collection of database / raw files. All the programs but one read from the files, and as it is, many of the operations are done through standard non-OO code. All of the database information is currently stored in linked list...
5
674
by: Don Vaillancourt | last post by:
Hello all, Over the years as I design more database schemas the more I come up with patterns in database design. The more patterns I recognize the more I want to try to design some kind of generic design patterns that can be used and shared amongst many sub-schemas. For example, the grouping of entities. I may have the following tables:...
29
3545
by: MP | last post by:
Greets, context: vb6/ado/.mdb/jet 4.0 (no access)/sql beginning learner, first database, planning stages (I think the underlying question here is whether to normalize or not to normalize this one data field - but i'm not sure) :-) Background info:
12
6982
by: nyathancha | last post by:
Hi, I have a question regarding best practices in database design. In a relational database, is it wise/necessary to sometimes create tables that are not related to other tables through a foreign Key relationship or does this always indicate some sort of underlying design flaw. Something that requires a re evaluation of the problem domain?...
1
7111
by: arrival123 | last post by:
Hello, I'm currently trying to decide on a database design for tags in my web 2.0 application. The problem I'm facing is that I have 3 separate tables i.e. cars, planes, and schools. All three tables need to interact with the tags, so there will only be one universal set of tags for the three tables. I read a lot about tags and the best...
10
5796
by: ARC | last post by:
Hello all, General question for back-end database that has numerous date fields where the database will be used in regions that put the month first, and regions that do not. Should I save a date format in the table design, such as: mm/dd/yyyy? What I've done for years is to store the date format in date fields, then on the forms, based...
4
2911
by: dgleeson3 | last post by:
Hello all I am creating a VB.Net distributed SQL server 2005 application. Each computer in the system has a database with a table of users and their telephone numbers. Each computer has a unique 4 digit identifying code. The central server runs an application which reads the database table on each computer.
0
1337
by: David | last post by:
Hi list. I have a few database-related questions. These aren't Python-specific questions, but some of my apps which use (or will use) these tables are in Python :-) Let me know if I should ask this on a different list. Question 1: Storing app defaults. If you have a table like this:
10
3342
by: Les Desser | last post by:
In article <fcebdacd-2bd8-4d07-93a8-8b69d3452f3e@s50g2000hsb.googlegroups.com>, The Frog <Mr.Frog.to.you@googlemail.comMon, 14 Apr 2008 00:45:10 writes Not sure if I quite follow that. 1. Data encrypted by AES key 2. AES key encrypted with Asymmetric public key (?)
1
7677
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6284
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5514
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5219
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3653
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3643
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2115
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1223
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
940
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.