database-design

Rewriting the system... keep the old schema?

Suppose we have a system (in production) written in an obsolete technology and difficult to adapt to changing business needs. The decision has been made to rewrite it in a newer technology. Should we start fresh with a new database schema that will accurately reflect the data models of the new system but accept the risks and costs of de...

Problems Mapping Composition Relationships using Entity Framework

I'm trying to model my domain model using the entity framework. An example is Page class containing a Content class. public class Page { public virtual int Id { get; set; } public virtual string Name { get; set; } public virtual Content PageContent { get; set; } } public class Content { public IList<Version> Versions { ge...

In a generic List<T> of objects, should I store the 'OrderID' inside each object, or just rely on the order in the list?

As the title says :) In my database the table I'm using has an OrderID field, which determines the order (strangely enough!) that the rows will be shown in when they are outputted. In the C# code this table of data is loaded in as a generic list (List) which each item in the collection being a copy of a row from the database table. So...

How to order pages in CMS?

I wrote a simple CMS for one of my clients which does specifically what he needs (without the bloat of mainstream content management systems he would never use). The CMS enables him to create and manage two types of content: pages and news (short messages that show in the sidebar). The pages are displayed in the navigation menu of the ...

Data Modeling for EAV

How are others using relational modeling tools to map a logical model or one in third normal form to a database that uses EAV? ...

Open Source Equivalents to Erwin

I am aware of CA/Erwin community edition but it is constrained to 25 objects. I have also tried modeling in Visio which was painful. Curious to learn of any open source equivalents that not only pictorially allow for relational modeling but can also generate DDL. ...

Database Design for Betting Community

I'm creating a online community for a soccer betting game available in my country. I've a pretty good idea how the whole system should work but I'm having some trouble figuring out the ideal database design and I need some help with it. The usual work flow should be something like this: Everyone is welcome to register as a member; eac...

Database Design: Is it bad to keep delimited strings in a database

I've worked on projects before that would store fields in a comma-delimited or pipe-delimited string as a field, which might represent options or something simliar. I was wondering if it was considered bad database design to do this, and relational tables should always be used, or sometimes is it acceptable to store data in this fashion?...

Database design question (conditional mandatory fields)

Hi, Just looking for some opinions/ideas on how best to do this. I'm building an extranet system where users are added by the administrators manually (there's no ability for someone to "register" themselves). When they're added only a small amount of mandatory data is entered (name, email, password), they are then emailed their login, a...

Allow user to update some records in table, but not all?

Suppose you have a lookup table that has a couple default options that your Business Logic layer depends on, but you want to allow the users to add/update/delete records in that table. For example, a CurrentStatus table that will be pre-populated with the following, but allow the user to update the text of those records as well as add/u...

Database Design question

Hello everyone! I have a Firebird database, which let's say has Tables A and B which look like this: TableA TableB's Id | SomeNumber | OtherNumber | ComputedByField | OtherIntField 1 5 200 SomeNumber*OtherNumber 10 1 2 70 ... ...

How to protect a database?

There is a website with a server database. I'm building a desktop application which uses data from one of the tables. Hacker can just take password from assembly. How can I protect the database? ...

Django/SQL: keeping track of who who read what in a forum

I'm working on a not-so-big project in django that will among other things incorporate a forum system. I have most of the system at a more or less functioning state, but I'm still missing a feature to mark unread threads for the users when there are new posts. The thing is I can't really think of a way to properly store that informatio...

large mysql (innodb) database - slow query performance, disappearing tables and long time to restore backups

I've a database with 3 of the tables having rows in excess of 20 million each. I've used GUIDs as primary keys (unfortunately). Now our database is about 20GB and growing 5GB per month. It takes about 2 hrs to take full backup of the database, and 30hrs to restore on a box with 4GB RAM. We once have all the tables from database disappe...

Database Design: Register and Verification

Is it a good choice to have unverified users into the users_table or should I make a temp_users_table to add the unverified users? The first option would be to create the row on the users_table with a column, for instance, account_activated to hold a integer that defines if the account is verified or not. The Second option would be to ...

Group rows in a table - design

I have a table TreeStructures wich holds structures of Trees. This table has columns 'id, name, left, right and a foreign key TreeId' to a table Trees with a column 'id' and some more information about the Tree. Now, if 'id' was the only column in table Trees, would it be good to remove the table Trees and let the foreign key TreeId jus...

Is it bad practice to use default values in a database?

Shouldn't the code deal with default values instead of the database? ...

Generic database logging system: Storing a reference to another database.table.column

My question is, how can I link a reference stored in the Log table to a piece of data in another database? We're building a system (Called Fusion) that will perform certain key tasks for all our other systems, one of these is a logging. The idea is that any other system will be able to use Fusion to log specific operation. CREATE TAB...

SQL Server 2008 Replication vs Manual Database Updates

Our scenario: We have a main database that stores company-wide information. We have several retail locations which have their own databases they work off of. These locations need to use information in the company-wide database, and I do not want our main application to run cross database queries because if the main database has issues (...

Should a user's profile be a seperate model?

Hi, I'm learning Rails by building a simple site where users can create articles and comment on those articles. I have a view which lists a user's most recent articles and comments. Now I'd like to add user 'profiles' where users can enter information like their location, age and a short biography. I'm wondering if this profile should b...