Database design is the process of specifying the logical and/or physical parts of a database. The goal of database design is to make a representation of some "universe of discourse" - the types of facts, business rules and other requirements that the database is intended to model.

learn more… | top users | synonyms (2)

5
votes
1answer
520 views

In MongoDB, is having lots of small collections better than having one huge collection?

Huge collections have huge indexes that may not fit into RAM. Is that problem entirely solved with sharding ? If I have lots of small collections with small indexes, what are the options for storing ...
0
votes
2answers
909 views

What will be the best data model for membership based websites?

I am building a paid membership based website where user can signup for different kind of membership. Membership will essentially enable or disable certain pieces of functionality in the website. A ...
25
votes
5answers
4k views

Why is there still a varchar data type?

Many of my databases have fields defined as varchars. This hasn't been much of problem since I live and work in America (where the only language that exists is "American". ahem) After working with ...
41
votes
6answers
6k views

Why shouldn't we allow NULLs?

I remember reading this one article about database design and I also remember it said you should have field properties of NOT NULL. I don't remember why this was the case though. All I can seem to ...
2
votes
1answer
96 views

How to make a duplicate field cheap?

There are two tables associated with each one to many in a field. In Table 2, there are fields that duplicate the value in Table 1. Is there a cheaper way to ensure (guarantee) the correspondence ...
6
votes
4answers
196 views

Dynamic contacts database

I'm trying to create a database for contacts. I must have many categories for every contact, like Home, Office, Emails, Phones. In every category one can add more than one value. Also the categories ...
2
votes
1answer
548 views

Trusted Constraints and NOT FOR REPLICATION

Version and Build: SQL Server 2005 SP4 (9.0.5000) As a disclaimer of sorts, I am asking this question to generate some discussion and/or debate on the topic. I don't know if there is really a ...
2
votes
1answer
122 views

Does document “depth” affect CouchDB performance?

I have a project where it is very tempting to use a deeply nested collection of data. But how does that affect performance? Are there any reasons why I should avoid doing this? I'm talking about lists ...
12
votes
5answers
4k views

How do I force one record to have a true value for a boolean column, and all others a false value?

I want to enforce that only one record in a table is considered the "default" value for other queries or views that might access that table. Basically, I want to guarantee that this query will always ...
4
votes
3answers
346 views

Database Design Issues

My question consists of three parts: When can I be sure that my database design is perfect? Is returning to the database design to change some issues (i.e, adding new column, deleting a column, ...
13
votes
7answers
264 views

Which of these table designs is better for performance?

I have been asked to create something which tracks the daily cost to collect on accounts, and I am trying to figure out a database table schema that would support this. Here's what I know Company ...
8
votes
5answers
1k views

Do empty columns take up space in a table?

I have table that holds from very basic info. Just a title and a few date fields. There's one field called comments which is varchar(4000) Most of the time we leave it blank, but some times will enter ...
2
votes
1answer
440 views

Database Design: Storing Map Locations

When working on a game, I developed a database that used X/Y coordinates, roughly as: CREATE TABLE Map ( MapId INT IDENTITY PRIMARY KEY, X INT NOT NULL, Y INT NOT NULL, North INT ...
18
votes
5answers
9k views

When should you denormalize?

I think we are all familiar with database normalization. My question is: What are some guidelines that you use when you want to denormalize the tables?
2
votes
2answers
390 views

Table contains multiple names for same company

I have a table of monetary transactions that has a field for who the money was paid to or received from. Transactions are recorded using info from paper invoices, paper reciepts, internet reciepts, ...
20
votes
1answer
3k views

Designing a platform: one database or multiple databases?

We are building a web platform that incorporates multiple services, each with its own underlying data. These services are being built independently following the principles of Service-Oriented ...
1
vote
1answer
274 views

Where to save user data?

I hope this is the right stackexchange place to ask. Im really new using databases and I have a little question: Where to save the user data? I mean, if Im logged as "Foxandxss" on my app, and I want ...
16
votes
1answer
569 views

What is the reasoning behind the CAP theorem?

http://en.wikipedia.org/wiki/CAP_theorem http://www.cs.berkeley.edu/~brewer/cs262b-2004/PODC-keynote.pdf I think it is not very straightforward why only two of Consistency Availability Partition ...
3
votes
2answers
221 views

How can I model this relationship?

My database design skills are a bit rusty so I was hoping to get some help from y'all =) I have a 'user' table that contains all the typical fields (id,name,email,etc.). Users can have many ...
2
votes
1answer
873 views

Track daily view count of youtube videos

I am making program that searches youtube for given keyword and need to get links of active videos. Term "active" means that video must have 1000 views per day. Youtube API doesn't give such ...
4
votes
2answers
665 views

Using IDs from multiple tables in a single column

One of my co-workers created a schema similar to the following. This is a simplified schema including only the parts necessary to address this question. The system rules are as follows: ...
1
vote
1answer
197 views

MySQL Database Design Help?

I am going through my database and what I want to do is re-design it because I feel like it's very messy and that I am doing it wrong. This is just for practice; I've never had anyone teach me so I ...
5
votes
2answers
1k views

Database Hardware and Software to handle million requests per second?

I'm curious about the necessary hardware and software requirements to support a strong MMORPG. For example, what kind of requirement (both hardware and software) would I need if I were to build a ...
3
votes
2answers
119 views

What would be the best way to model my simple table?

What would be faster: searching for the right row through a table with 17 different columns, each with a tinyint value of 1-4? Or, searching for the right row through a table with only 1 column with ...
9
votes
4answers
2k views

Whether or not to create separate tables for different product types?

I'm in the process of designing a database and I'm having second thoughts about my initial design decisions... Product types are as follows... Models, parts, replacement part kits and options. ...
4
votes
1answer
285 views

Proper Database Partitioning

I had asked a previous question "Proper technique for storing users event data" and the correct answer in my opinion was to create a database partition. Now from what I have read on it there are ...
4
votes
2answers
837 views

Creating partitions on a production database

I have a production MySQL 5.1 database that is running well but I want to improve query performances. I have never used Partitions and just going through the manuals. I have two tables that involve a ...
4
votes
3answers
413 views

Table structure for many custom profiles

I'm currently developing an bulk-email campaign manager that will allow customers to upload as much information as they would like on their subscribers. For example, I have a basic profile that is ...
0
votes
1answer
676 views

Database design for head to head sports

I am trying to create a database to store details relating to darts matches. Im relatively new to this so was wondering if the design I've come up with below would work. It seems I have lots of places ...
7
votes
2answers
448 views

Proper technique for storing users event data

I am mostly a self-taught when it comes to database designs. I am posing this question because I have settled on this common structure, but am wondering if it is the most efficient or 'industry ...
3
votes
2answers
92 views

Exclude dataset from a query

I have 2 tables EXAM (StudentID, SubjectID, SchoolYear, Period, Mark) and CANCELED_EXAM (StudentID, SubjectID, SchoolYear, Period). Primary key for both tables are (StudentID, SubjectID, ...
4
votes
4answers
690 views

Speed problem with a simple select statement

I'm having a problem with a select statement taking way too long to run. I would like to know if I'm doing something wrong or if it taking this long makes sense. I am using Microsoft SQL 2005 ...
2
votes
2answers
672 views

Most Effificient Way to Store Ingredients in a Food Database

I have a database that I've called "food" and I'm a bit stumped on how to store the ingredients for a recipe. Should I create a separate table for the ingredients or just have the ingredients insert ...
5
votes
5answers
4k views

Pros/Cons Using multiple databases vs using single database

Working on a new project which has the requirement to use 7 databases. Arguing performance, stability, optimization is easier implemented. While I don't agree I'm having trouble collecting good ...
2
votes
4answers
145 views

Is there a “standard way” to log network messages (events) into a database?

I have two applications communicating over a LAN via events contained in network messages. Each message (i.e. an UDP packet) contains only one event. Messages are heterogeneous, meaning that the first ...
23
votes
5answers
7k views

Best practices on common person fields (Name, email, address, gender etc…)

What are the most common best practices on length and data type on common fields like: First Name Last Name Address Email Sex State City Country Phone Number etc....
4
votes
2answers
909 views

Data validity and accuracy according to database integrity

What does it mean that data is valid and accurate according to database integrity?
2
votes
2answers
75 views

Importing order information

Our new project is to write a customer order management system. My specific task is to import customer orders from various different sources - XML, CSV, XLS... etc. Our old DBA has left the company ...
11
votes
3answers
2k views

Column name naming conventions and best practices

I would like some expert opinion on best practices when it comes to column naming. The background is that according to Wikipedia, the following syntax, SELECT ... FROM Employees JOIN Timesheets ...
2
votes
2answers
971 views

Unknown Db file format - best way to find out?

A client has given me the data he wants visualised in my project - but I don't know what DB format it's in. He's pretty unclear, also.. I have access to the table structures, but don't know how to ...
5
votes
1answer
513 views

LDF and MDF file sizes for a dynamically created Database

I am creating a dynamic database from C# code, and would like the database to have a fixed size (for example 5 GB). While creating the DB through code, I need to specify MDF and LDF max file sizes. ...
2
votes
2answers
3k views

Database to track employee performance

This is going to be very basic as I'm a complete newbie when it comes to database design. I've been tasked with setting up a way to track employee data over a number of months and potentially years. ...
5
votes
6answers
143 views

How to do a bulk load of a database when application are relying on it?

In a daily routine, I need to drop and do a bulk load of a database. The problem is that I have a WebApp relying on that database. So I can't drop the database just like this. What would be a good ...
2
votes
2answers
4k views

Database Design for Airline Reservation System

I'm just a beginner seeking some answers. I'm creating a very simple database system for an airline company, just for learning purposes. Here are my questions: How to show relationships for entities ...
7
votes
2answers
294 views

Can I losslessly decompose this table?

I've stumbled across a database design problem that's out of my league, and my go-to DBA guru is off on fire drills. In essence, I have a table with the following primary key: child_id integer ...
4
votes
2answers
2k views

What are some common and useful fields for a users table in a database?

I want to begin implementing user functionality on my website, but I'm not sure exactly what kind of information I should be storing. Obviously the basic things like username, password, password hash, ...
7
votes
3answers
1k views

Is there a standard implementation of a Users Database?

I need to implement basic personalized user functionality for my website. Is there a standard structure for databases of this type? Like is it common practice to have all user info and data in a ...
6
votes
2answers
1k views

Fact table foreign keys null?

I am new to data mart design and need to clear a few concepts. I have read up a bit on dimension modelling where I see that fact tables store foreign key references to dimension tables. Now suppose ...
1
vote
1answer
479 views

Groups, Users, and Inbox

We're working on a PM system where a user can send an email to other users or groups. We currently have the following tables: Users Groups Users can be part of many groups. A user doesn't have to ...
3
votes
2answers
856 views

Removing Archive Logs after PostgreSQL PITR online-recovery

I'm using pgpool-II + PostgreSQL 8.4 on three servers: primary + standby1 + standby2. Replication mode is "on" Load balance mode is "on" (between primary and standby1) I followed the official ...