database-design

Should i reflect database structure in application?

I'm designing an application that will allow putting some data in the database. I wanted to somehow reflect the database structure in the application, for example if i have a table where there are departments and a table with employees and there is a department with id 3 and two employees related to him with ids 44 and 123, in my applica...

DataModel for Workflow/Business Process Application

What should be the data model for a work flow application? Currently we are using an Entity Attribute Value based model in SQL Server 2000 with the user having the ability to create dynamic forms (on asp.net), but as the data grows performance is getting down and hard to generate report and worse if too many users concurrently query the ...

What are some optimization techniques for MySQL table with 300+ million records?

I am looking at storing some JMX data from JVMs on many servers for about 90 days. This data would be statistics like heap size and thread count. This will mean that one of the tables will have around 388 million records. From this data I am building some graphs so you can compare the stats retrieved from the Mbeans. This means I w...

How to design a database for unkown amount of 'meta'-data

I want to store certain items in the database with variable amount of properties. For example: An item can have 'url' and 'pdf' property both others do not en instead have 'image' and 'location' properties. So the problem is an some items can have some properties and others a lot. How would you design this database. How to make it se...

Library Database System Design

Hello, I have a library, and I want to migrate it from an old system to a new optimized one. The old library was built using MS Access (mdb files), where each book is a file by itself. Each book consists of two tables, one for chapters titles and the second for contents. There is also one mdb file that contains all books names, pages n...

Is it ok to use character values for primary keys?

Is there a performance gain or best practice when it comes to using unique, numeric ID fields in a database table compared to using character-based ones? For instance, if I had two tables: athlete id ... 17, name ... Rickey Henderson, teamid ... 28 team teamid ... 28, teamname ... Oakland The athlete table, with thousands of playe...

Database Object Placement for Custom Add-on Software

What is everyone's recommendations on where to place database objects (tables, procs, views etc.) for a custom add-on to another application's database? Should they be kept separated like so: ErpInventoryAccountingWare.dbo CustomIntegratedPortal.dbo Or, could the add-ons objects be placed in the same database. The objects would be ...

Dealing with variable category hierarchies

The issue I have is as follows: My company's supplier gives us an Access database (which I import into SQL Server) containing their product information (the alternative is to use XML), and I'm trying to massage this into a more usable format for use in an e-commerce website. The problem I run into, and maybe I'm just not thinking clear...

SQL Server - Syncing two database.

We have a warehouse database that contains a year of data up to now. I want to create report database that represents the last 3 months of data for reporting purposes. I want to be able to keep the two databases in sync. Right now, every 10 minutes I execute a package that will grab the most recent rows from the warehouse and adds the...

How to prevent orphaned records in detail tables of normalized database?

I have to maintain an old database which is not properly normalized. For instance there is a project table that has grown (or maybe mushroomed) to have 5 or more different date columns, for different milestones of the project from being ordered to the delivery date. There are also several tables each with columns for street addresses, ma...

How would you represent a hashtable collection in a database schema?

If you were trying to create a domain object in a database schema, and in your code said domain object has a hashtable/list member, like so: public class SpaceQuadrant : PersistentObject { public SpaceQuadrant() { } public virtual Dictionary<SpaceCoordinate, SpaceObject> Space { get; set; } } ...

Is it "better" to have an update field or COUNT query?

In a Django App I'm working on I've got this going on: class Parent(models.Model): name = models.CharField(...) def num_children(self): return Children.objects.filter(parent=self).count() def avg_child_rating(self): return Child.objects.filter(parent=self).aggregate(Avg('rating')) class Child(models.Model)...

Explain db tag storage method

from this post http://stackoverflow.com/questions/334183/what-is-the-most-efficient-way-to-store-tags-in-a-database It was recommended to store tag tables like this. Table: Item Columns: ItemID, Title, Content Table: Tag Columns: TagID, Title Table: ItemTag Columns: ItemID, TagID And another SO post said the same thing. Can anyone ...

Entity/Attribute alternative - dynamically created tables

I like pure relational design but sometimes there is a need for an Entity/Value method of storing data. Especially where the user needs to frequently create a new type of data. I have seen in some commercial software that they dynamically create standard tables rather than use EV tables. Obviously this isn’t a solve-all solution and ca...

Is using Null to represent a Value Bad Practice ?

If I use null as a representation of everything in a database table is that bad practice ? i.e. I have the tables: myTable(ID) and myRelatedTable(ID,myTableID) myRelatedTable.myTableID is a FK of myTable.ID What I want to accomplish is: if myRelatedTable.myTableID is null then my business logic will interpret that as being linked to ...

Designing a tool for estimating project bids

This tool will be used to estimate project costs for clients. These are not necessarily software projects. Currently there is an Excel spreadsheet with a number of categories with individual tasks for each category. Each of these has some sort of weight or constant involved and is partially responsible in determining the final bid estima...

The dangers of hyper-normalization?

Several colleagues and I are faced with an architectural decision that has serious performance implications: our product includes a UI-driven schema builder that lets non-programmers build their own data types for a web app. Currently, it builds properly normalized schemas behind the scenes and includes some complex logic to alter the sc...

Should you enforce constraints at the database level as well as the application level?

I've been reading the book "Enterprise Rails" by Dan Chak and it got me thinking: Do you feel that you should have data constraints at both the database level and the application level? Or do you feel similarly to opinionated frameworks like Ruby on Rails - the database is just a "dumb repository" for data, and all checks should be don...

Is prefixing each field name in a table with abbreviated table name a good practice?

Do you prefix each field in a table with abbreviated table name? Example: Table: User Fields: user_id user_name user_password Or do you do you name your fields minimally? Fields: id name password If you have used both, then which format you feel helped you most in the long run? Edit: This question doesn't seem to have a definite...

Enterprise Search: Has anybody developed on FAST ESP? What did you think about it?

I work for a scandinavian yellow pages. The company is looking at moving its bespoke search technology over to FAST ESP. Like all big, expensive systems with relatively few installations, it is difficult to get feedback on the strengths and weaknesses of the system. Are there any stackoverflowers who have experience of FAST ESP and wan...