data-modeling

What's the difference between data model and object model?

CWM is data modeling UML is object modeling. Can someone explain the difference that a layman can understand? ...

Model for a Scheduling System

We have built a scheduling system to control our client's appointments. This system is similar to the one used by Prometric to schedule an exam. The main concerns are: guarantee that there is no overscheduling, support at least one hundred thousand appointments per month and allow to increase/decrease the testing center capacity easi...

How do you manage web navigation info in your application?

I’m building an application where different users will have different menu items available to them depending on what they’ve paid for. There will also be multiple levels to the menu hierarchy. What’s the best approach to this problem? I’m assuming I need a database table that represents the menu hierarchy, including the parent-child r...

Suggest Cassandra data model for an existing schema

Hello guys! I hope there's someone who can help me suggest a suitable data model to be implemented using nosql database Apache Cassandra. More of than I need it to work under high loads and large amounts of data. Simplified I have 3 types of objects: Product Tag ProductTag Product: key - string key name - string .... - some other...

Rails ActiveRecord- has_many through and belongs_to a related model

I have 3 models sites, user_favorites and users. Relevant relationships: class Site < ActiveRecord::Base has_many :users, :through => :user_favorites class UserFavorite < ActiveRecord::Base belongs_to :user, :counter_cache => true belongs_to :site end class User < ActiveRecord:Base has_many :user_favorites has_many :sites, ...

Limiting choices from an intermediary ManyToMany junction table in Django

Background I've created three Django models—Inventory, SalesOrder, and Invoice—to model items in inventory, sales orders for those items, and invoices for a particular sales order. Each sales order can have multiple items, so I've used an intermediary junction table—SalesOrderItems—using the through argument for the ManyToManyField. Als...

Model a Zero or One to Many Relationship

How should I model a zero or one to a many relationship in the database? For example, a user record may or may not have a parent. So should my user table have a t_user.parent_id or should I have an associative table called t_user_hierarchy with the columns t_user_hierarchy.parent_id and t_user_hierarchy.user_id? ...

Core Data Model Design Question - Changing "Live" Objects also Changes Saved Objects

I'm working on my first Core Data project (on iPhone) and am really liking it. Core Data is cool stuff. I am, however, running into a design difficulty that I'm not sure how to solve, although I imagine it's a fairly common situation. It concerns the data model. For the sake of clarity, I'll use an imaginary football game app as an e...

Are soft deletes a good idea?

Are soft deletes a good idea or a bad idea? Instead of actually deleting a record in your database, you would just flag it as "IsDeleted" = true, and upon recovery of the record you could just flag it as "False". Is this a good idea? EDIT: this might be a better idea??? what about physically deleting the record then moving it to a ext...

Querying a Cassandra column family for rows that have not been updated in X days

I'm moving an existing MySQL based application over to Cassandra. So far finding the equivalent Cassandra data model has been quite easy, but I've stumbled on the following problem for which I'd appreciate some input: Consider a MySQL table holding millions of entities: CREATE TABLE entities ( id INT AUTO_INCREMENT NOT NULL, entity...

One to Many relashionships for a restaurants website?

Each restaurant has restaurant branches, each branch must determine which days of the week it opens, each of those days must determine (several) open_hour and close_hour thru that day. I created one to many relationship using these tables: rest_names ---> rest_branches ---> open_days ---> open_hours Am I going right this way? or there ...

How do I correctly model data in SQL-based databases that have some columns in common, but also have columns that are unique?

For instance, let's say I have a User model. Users have things like logins, passwords, e-mail addresses, avatars, etc. But there are two types of Users that will be using this site, let's say Parents and Businesses. I need to store some different information for the Parents (e.g. childrens' names, domestic partner, salaries, etc.) than f...

GAE modeling relationship options

Hi there, I need to model the following situation and I can't seem to find a consistent example on how to do it "correctly" for the google app engine. Suppose I've got a simple situation like the following: Company 1 -----> M Store A company has one to many stores. Each store has an address made up of a address line 1, city, state, ...

Synchronize model in MySQL Workbench

After reading the documentation for MySQL Workbench I got the impression that it's possible to alter a database in the server (e.g. add a new column) and later incorporate the DDL changes into your EER diagram. At least, it has a Synchronize Model option in the Database menu. I found it a nice feature because I could use a graphic modell...

What is the point in using a "real" database modeling tool?

We currently have a 10 year old nasty, spaghetti-code-style SQL Server database that we are soon looking to pretty much re-write from scratch as part of a re-write to a large web application. (The existing application will serve as the functional requirements for the next incarnation of the app). Some have suggested we use Visio to do a...

how relate one table to another for future records

I have a games table which holds the data about a game. Then another table which holds the data about news. So far so good. First I thought about creating a junction table for game_news so I could relate news to games. This way works as intended when the game exists. So whenever I insert a news I can relate it to a game using the junc...

Restful authentication + Facebook connect - User model redesign

I have a site with Restful authentication as authentication plugin. I need to integrate Facebook connect. Facebook does not provide email address for the user (maybe only if user agrees if), and of course does not provide a password. The main issue is that the User model has a lot of validates_** on those 2 fields (from Restful authent...

Dynamic Typed Table/Model in J2EE?

Hi, Usually with Java EE when we create Model, we define the fields and types of fields through XML or annotation before compilation time. Is there a way to change those in runtime? Or better, is it possible to create a new Model based on the user's input during the runtime? Such that the number of columns and types of fields are dynami...

User/Group multiple ownership Model using Entity Framework 4

Hi guys I have to model the following situation. I came up with 2 possible alternatives, but I want to know if there's a better solution. Here's the deal... Simplified Schema User Group ----------- ------------ UserId (PK) GroupId (PK) Name Name ... ... \ / ...

Optimize mysql table ?

Here is my actual table schema (I'm using Mysql) : Table experiment : code(int) sample_1_id sample_2_id ... until ... sample_12_id rna_1_id rna_2_id ... until ... rna_12_id experiment_start How can I optimize both part : sample_n_id and rna_n_id (all are bigint(20) and allow null=true) ? About values : we can have : ex : sample_1_id ...