database-design

What is the best approach for decoupled database design in terms of data sharing?

I have a series of Oracle databases that need to access each other's data. The most efficient way to do this is to use database links - setting up a few database links I can get data from A to B with the minimum of fuss. The problem for me is that you end up with a tightly-coupled design and if one database goes down it can bring the cou...

Is there a Java equivalent to Apple's Core Data?

I have recently heard a lot of praise for Apple's Core Data architecture. Is there something similar in Java land, so that I can play around with Core Data's ideas (in order to evaluate how it stacks up against something like Hibernate) without having to get into Cocoa/Objective-C first? ...

Database column sizes for character based data

I've just come across a database where all the character based columns have their size specified in multiples of 8 (e.g. Username = varchar(32), Forename = nvarchar(128) etc.) Would this have any bearing on the performance of the database or is it completely pointless? Thanks. N.B. This is in a SQL 2000 database. ...

Setting database and access control permissions

Hi. I am part of a team creating a web application using PHP and MySQL. The application will have multiple users with different roles. The application will also be used in a geographically distributed manner. Accordingly we need to create an access control system that controls user permissions for specific database records i.e. modifi...

What is best: separate databases or an extra "code" table?

I have a database designed to hold card data from various trading card games. Up to this point, there has only been one card game I've been tracking, but I'm using an attribute table since not all attributes apply to every card. I'm now expanding into multiple card games and have a slew of data ready to migrate in. However, I'm not quit...

need help in Relationship between tables

Hello all, I am designing the database for "Patient Information System". I have table with names Table Name : Patient(a patient is the person who visit the hospital for treatment/consultation) Id,Name,Address,DateOfBirth,Phone,EmergencyContact,DateOfRegistration Table Name : Doctor( a doctor will be assigned to each patient.) Id,Name,Ad...

Signed or unsigned in MySQL

I wonder is there any positive effect in using UNSIGNED flag on defining some integer field in MySQL? Does it make queries faster or database smaller? Or should I only bother with it if I'm concerned about upper limit? ...

Modeling Entities with Things in Common: Super-type/Sub-type?

I will be using LLBLGen to generate a model, however I don't want to solve my design issues by just using whatever built-in inheritance tools it has. I want the model to make sense regardless of the OR/M tool. So, I have several different kinds of entities that can have addresses and each entity can have multiple address (primary, maili...

Best way to manage probably huge photo library with iPhone SDK

I'm developing a app with a list of products. I wanna let the user have 1 picture for each products. Now, the problem is what to do next. I think that the best way is that the photos get sync when the user connect to their computer & itunes, and acces them from the app (something like: /photos/catalog/ref1.jpg. The other option is put ...

How can an object-oriented programmer get his/her head around database-driven programming?

I have been programming in C# and Java for a little over a year and have a decent grasp of object oriented programming, but my new side project requires a database-driven model. I'm using C# and Linq which seems to be a very powerful tool but I'm having trouble with designing a database around my object oriented approach. My two main qu...

How to handle large amounts of data for a web statistics module

Hi, I'm developing a statistics module for my website that will help me measure conversion rates, and other interesting data. The mechanism I use is - to store a database entry in a statistics table - each time a user enters a specific zone in my DB (I avoid duplicate records with the help of cookies). For example, I have the followin...

Rename a column or append a column? that is the question...

I am about to alter the several tables in a massive system which I probably only understand around 10%. I want to add three columns. One of these is just a rename of an existing column. Part of me wants to :- Rename the column but worried about the impact on unknown parts of the system that use the old name. Append the three columns...

Database Schema Design - Tips for improving ability to archive?

I am designing a table in the database which will store log entries from the application. There are a few things which is making me think about this design more than usual. However these log entries will be used at runtime by the system to make decisions so they need to be relatively fast to access. They also have the problem is that ...

Primary key or Unique index?

Hello, in work we have big database with unique indexes instead of primary keys and all works fine. I`m designing new database for new project and I have a dilema: in DB theory, primary key is fundamental element,it`s OK... but in REAL projects what are adventages and disadventages of both? what do you use in projects? EDIT:...and w...

SQL Optimization: how many columns on a table?

Hi all. The current project that I'm working on have table with 126 columns and the least that i saw is at least 50 columns. Should a table hold less columns per table or separate them out into a new table and use relationship? In your experience what is the max columns per table? Does it affect the database with such design? Jack ...

How to design a movie database?

Hi Guys, I'm trying to get my head round this mind boggling stuff they call Database Design without much success, so I'll try to illustrate my problem with an example. I am using MySQL and here is my question: Say I want to create a database to hold my DVD collection. I have the following information that I want to include: Film Tit...

How Many Tables Should be Placed on the Same Partition Scheme?

My company just provided me with SQL Server 2005 Enterprise Edition and I wanted to partition some tables with large(r) amounts of data. I have about about 5 or 6 tables which would be a good fit to partition by datetime. There will be some queries that need 2 of these tables in the course of the same query. I was wondering if I should...

.NET - Unit Testing Your Code and State in Your Database

Assumptions: We use .NET coding against SQL Server 2005 I was just wondering how most people incorporate state into the Unit Tests that affect their database? I know when and where to use mocking, but when you want to move past that and actually do some database tests... what strategies do you use to setup and teardown your database? Do...

Best beginner resources for understanding the EAV database model?

I'm doing some custom work with Magento, which has a database design based upon the EAV model, and I need some good resources/tutorials that explain the EAV database model. Please don't provide Wikipedia as a resource... I'm looking for something that teaches EAV in a friendly way for beginners. ...

DB Performance and data types

I'm supporting an existing application written by another developer and I have a question as to whether the choices the data type the developer chose to store dates is affecting the performance of certain queries. Relevant information: The application makes heavy use of a "Business Date" field in one of our tables. The data type for t...