database-design

How to implement a multi-user tag *voting* system (i.e. like Slashdot's story tags)

Hey all, This is a question that's a bit different from the typical "how do I make a tagging system" question, which has been thoroughly discussed on SO and elsewhere. I want to crowdsource tagging so you don't have to rely on the owner of each document to completely list out applicable tags. At the same time, I don't want a random sch...

Should we start with multiple small-grained databases for an app that may scale massively

We're developing a new eCommerce website and are using NHibernate for the first time. At present we are splitting our data into multiple SQL Server databases, divided per area of functionality. So we have one for UserInfo, one for Orders, one for ProductCatalogue and so on... Our justification for this decision is twofold really: th...

First Time Database Design in SQL / Please review our initial diagram

Hi, We would like to create a training database in SQL which we can use for our internal training sessions of our employees. Unfortunately I do not have any experience in database design and did not have a chance to buy and read a proper book about this topic. I have just started to create a database after reading a few tutorials onlin...

Is there a SQL ANSI way of starting a search at the end of table?

In a certain app I must constantly query data that are likely to be amongst the last inserted rows. Since this table is going to grow a lot, I wonder if theres a standard way of optimizing the queries by making them start the lookup at the table's end. I think I would get the same optmization if the database stored data for the table in...

varchar(1) or bit?

Possible Duplicate: NCHAR(1) vs BIT I have a field in the database that currently stores two values: 'Y' and 'N' (yes, no). The field datatype = varchar(1). Would it be better to convert 'Y' to 1 and 'N' to 0 and to use a bit datatype? Is there any benefit to using varchar(1) over bit in this case? ...

How are bitmap indexes helpful?

Wikipedia gives this example Identifier Gender Bitmaps F M 1 Female 1 0 2 Male 0 1 3 Male 0 1 4 Unspecified 0 0 5 Female 1 0 But I do not understand this. How is this an i...

Storing Some SQL Server Data Offline

I am beginning to design a new laboratory test data management system with many (about 30) test stations. The system must be able to collect data offline in the event of a network outage. Each station would keep an up-to-date, read-only copy of test structures (specifications, entity types, business rules/workflows, etc) but not test d...

case studies or examples of high throughput services with highly dynamic data

hello everyone, I'm looking for some architecture ideas on a problem at work that I may have to solve. the problem. 1) our enterprise LDAP has become a "contact master" filled with years of stale data and unused and unmaintained attributes. 2) management has decided that LDAP will no longer serve as a company phone book. it is for...

To separate to a different table or use enum type?

I'm working with an online shop, currently products are either available or not, and enabled or not, by an int field on the products table. They want me to add more to this, e.g. "in stock with supplier", "out of stock, ships within x days" etc. I'm thinking of just ditching the flags and creating a status field of enum type, with 'ava...

In Oracle, why are the columns of type LONG created last?

This Oracle documentation page mentions ... columns of type LONG are created last but doesn't say why. What can the reason be to store them at the end of a row? ...

How does this not make varchar2 inefficient?

Suppose I have a table with a column name varchar(20), and I store a row with name = "abcdef". INSERT INTO tab(id, name) values(12, 'abcdef'); How is the memory allocation for name done in this case? There are two ways I can think of: a) 20 bytes is allocated but only 6 used. In this case varchar2 does not have any significant adva...

MySQL - move from flat table to first normal form

Hello I am building an application that will allow a user to record weekly activity over a 6 week period. Each week has 3 benchmarks to record against, here is an example: Week 1 +------------+-----------+------------+-----------+ | Day | Minutes | Location | Miles | +------------+-----------+------------+-----------+...

What kind of file system configuration changes are handled by an RDBMS?

From here, Oracle ASM provides several advantages over conventional file systems and storage managers, including the following: Rebalances data automatically after storage configuration changes What kind of configuration changes are we talking about here? In a database, what kind of configuration changes happen? ...

MySQL - moving from 1st Normal Form to 2nd and 3rd Normal Forms

Hello This question directly relates to a previous topic "MySQL - move from flat table to first normal form" (http://bit.ly/9pvS0Y) - and as I am now asking a question about moving to second and third normal forms, I figured it best to start a new topic. Below is my first normal form schema which I am pretty sure is solid enough for my...

Data Retrieval - Performance with CLOB Columns in Oracle

I have a table in Oracle that is currently storing close a Million Records. This table is having 2 CLOB columns that store XML data. I also have a search screen built for this particular table where users can search on pretty much all the columns except for the CLOB columns. Now here is my questions - Assuming that I have right indexe...

Many-to-Many relationships needing an associate table

In many database design tutorials/articles, they always bring up the fact that if two tables share a many-to-many relationship, then a third table should be created to act as an associate table to link the two. However, they never provide the reason WHY we should do it that way. I'm curious to know why and examples of problems that coul...

Data Warehousing Design Question

I'm developing a data warehouse and have come up against a problem I'm not sure how to fix. The current schema is defined below: DimInstructor <- Dimension table for instructors DimStudent <- Dimension table for students I want to implement a scenario whereby if details of an instructor change in my OLTP database, I want to add a new r...

Custom CMS with multiple users. Best practices

Hi, I'm currently developing a web application for a particular niche. The point is that users can create an account, manage specific data and use that data on their website through API calls. So it's actually some sort of WordPress CMS but without the front end functionality. It is also not open source. So in short, user can manage th...

Database design: Plot storage.

I'm new to database design and I considering implementing something that will be time consuming, so I wanted to ask here first if it is the best thing to do. Facts: For my purposes here, let's define a plot to be a set of x,y pairs. Plots can have different numbers of x,y pairs. Furthermore, for a particular plot, x,y pairs can be...

create a pricing matrix - sql or array of constants?

I am planning to create a pricing matrix for a project in Rails. It's supposed to be a table of destinations and departure locations, and prices depending on where you came and are planning to go. I am kinda undecided on how to better do this: either making a table in the db for this matrix, or making a mega array of constants. Problem ...