database-design

Schema-less design guidelines for Google App Engine Datastore and other NoSQL DBs

Coming from a relational database background, as I'm sure many others are, I'm looking for some solid guidelines for setting up / designing my datastore on Google App Engine. Are there any good rules of thumb people have for setting up these kinds of schema-less data stores? I understand some of the basics such as denormalizing since y...

Database schema for Product Properties

As so many people I'm looking for a Products /Product Properties database schema. I'm using Ruby on Rails and (Thinking) Sphinx for faceted searches. Requirements: Adding new product types and their options should not require a change to the database schema Support faceted searches using Sphinx. Solutions I've come across: (See Bil...

Mysql : should i put my data into 1 table or split per user?

This data is for a holiday cottage's simple accommodation calendars. The data is simple and stores dates when each cottage is booked. The cols would be cottage_id, booked_from_date, booked_until_date and I would expect around 60 rows per user per year * 200-300 users. I should put this is one table right? ...

Tool for documentation of the fields of a database ?

Hello, I need to add documentation to all fields of 2 databases (1 postgresql & 1 sql server), around 100 tables each. What tool would be convenient to do that (reverse the schema + add documentation manually on all fields) ? My favors would go to an open source tool with a graphical & xml output. Thanks for your help Jerome WAGNER ...

is there a database that can easily digest hierarchical data besides XML?

It is very difficult for me to design the database because it requires a lot of recursion. I really can't use XML because it is just not practical for scalability and the amount of data I need to store. Do you guys know of a database that can be used to store hierarchical data? ...

How to design a database where the main entity table has 25+ columns but a single entity's columns gets <20% filled on average?

The entities to be stored have 25+ properties (table columns). The entities are pretty diverse, meaning that, most of the columns are empty. On average, I'd say, less than 20% (<5) properties have a value in any particular item. So, I have a lot of redundant empty columns for most of the table rows. Almost all of the columns are decimal ...

Storing users in a database

Im wondering whats the best way of storing different types of users in my database. I am writing an application that has 4 main user types (admin, school, teacher, student). At the moment I have a table for each of these but i'm not sure thats the best way of storing user information. For instance... Allowing students to PM other stude...

Set to null a parent record so that children are removed: howto?

How to delete a child row (on delete cascade ?) when setting a null value on a parent? Here's the db design. table A [id, b_id_1, b_id_2] table B [id, other fields...] b_id_1 and b_id_2 can be NULL if any of them is null, it means NO B records for corresponding FK (there are 2 of them) so (b_id_1,b_id_2) can be (null,null), (100,...

database design in google app engine

hi , i am designing a simple project based to do list. the idea is to define tasks under project ( no workflow - just "task is completed" or not is required. ) in a hirarchial way. i.e. each task has multiple task and that task may have other multiple task. a project can be said to be completed if all task under that project are complete...

Database schema for multiple category/product relationship

I want to design a database for an e-commerce application with category/subcategory management. Please suggest a database schema where we can create categories and subcategories and add products to those categories. Each product can have multiple categories and we can select products belong to multiple categories using a boolean database...

How should I do this (business logic) in Sql Server? A constraint?

Hi folks, I wish to add some type of business logic constraint to a table, but not sure how / where. I have a table with the following fields. ID INTEGER IDENTITY HubId INTEGER CategoryId INTEGER IsFeatured BIT Foo NVARCHAR(200) etc. So what i wish is that you can only have one featured thingy, per hubId + categoryId. eg. 1, 1, 1...

Looking for database example for webshop

Title says it all. Looking for an example on a webshop (using ORM) database with customers, orders, shoppingcarts, products and so on. Been on google for ages now but cant really find anything good ...

Is there any SQL Server database designer software like MySQL workbench?

I need to design database for SQL Server, is there any MySQL workbench like software for that? I have access to MSDN, so it can also be commercial product that can be found form MSDN. ...

Why single primary key is better than composite keys?

Why is the rejection of composite keys in favor of all tables using a single primary key named id. Cause generally all ORM follow this..??? EDIT I just started learning ruby on rails and in the book of agile develepment by pragmatic there is a line:--- Rails really doesn’t work too well unless each table has a numeric primary key. It i...

Storing dates i Train schedule MYSQL

Hi I have created a train schedule database in MYSQL. There are several thousand routes for each day. But with a few exceptions most of the routes are similar for every working day, but differ on weekends. At this time I basically update my SQL tables at midnight each day, to get the departures for the next 24 hours. This is however v...

Whats the best way to design this database scenario?

I want to setup 2 MySQL databases which differ in schema in that, one is normalized and the other is flat for quicker reads. The information being stored in both DBs is the same, but the representation is obviously different owing to the different design approaches. I need to find a robust solution to sync information in real time from ...

NoSQL DB for .Net document-based database (ECM)

I'm halfway through coding a basic multi-tenant SaaS ECM solution. Each client has it's own instance of the database / datastore, but the .Net app is single instance. The documents are pretty much read only (i.e. an image archive of tiffs or PDFs) I've used MSSQL so far, but then started thinking this might be viable in a NoSQL DB (e.g....

Legit? Two foreign keys referencing the same primary key.

Just as an update for Cliffs, Thanks ChaosPandion for the template. Person PersonID Int PK Network PersonID Int PK FK OtherPersonID Int PK FK OR Person PersonID Int PK Network PersonID Int PK FK FriendID Int PK FK Friend FriendID Int PK OtherPersonID Int FK ++++++ Original Post Below ++++++ Hi All,...

Database - Designing an "Events" Table

After reading the tips from this great Nettuts+ article I've come up with a table schema that would separate highly volatile data from other tables subjected to heavy reads and at the same time lower the number of tables needed in the whole database schema, however I'm not sure if this is a good idea since it doesn't follow the rules of ...

conceptually different entities with a few similar properties should be stored in one table or more?

Assume A and B are conceptually different entities that have a few similar properties and of course their own specific properties. In database design, should I put those two entities in one big aggregated table or two respectively designed tables. For instance, I have two types of payment; Online-payment and Manual-payment with followin...