For questions about structuring the data within a database. How to lay out tables, whether to use a relational DB or not, etc.

learn more… | top users | synonyms

3
votes
1answer
154 views

Who's responsible for a master / slave switch?

We are introducing a master / slave replication schema in our web application. At certain scenarios we would prefer to explicitly direct reads to a slave and writes to the master, which to me is an ...
1
vote
1answer
1k views

Books that every software system architect/data modeller must read [closed]

I hope I'm not confusing the term system architecture with the data model/database. Is there a book out there that's the standard for describing best practices, design methodologies, and other ...
19
votes
4answers
1k views

Best Practices for Redesigning a Database

I'm aware of some general best practices when designing a database for an application, but what about redesigning? I'm on a team tasked with re-designing an internal business application, though ...
1
vote
1answer
192 views

What's the best way to design a data and php model for a multi-account system?

I'm doing some high-level sketching of a system that will require users to register, when they do they get an account and can invite others to that account. To be clear, an account would be similar ...
3
votes
2answers
262 views

two approaches to database modeling - which one to use when

recently I have noticed a new approach to data modeling vs what I have used so far. This seems to be a way to address modeling of an entity that has a very large set of fields and quite often many of ...
1
vote
5answers
649 views

Worst practices in developing database applications [closed]

In constrast to http://programmers.stackexchange.com/questions/123591/database-design-good-practices I wanted to ask: What are the top worst practises you encountered when having to work with other ...
2
votes
1answer
518 views

Querying key/value store

I don't know whether this question is reasonably answerable (and therefore will be closed), but I will take my chances: What are the possible problems (and solutions), one might encounter, when ...
7
votes
4answers
914 views

Add an ID in every table even if it's not needed?

Is this good or bad design to add, by default, ID field in every table in a database, even when you don't see currently to usage of this ID (For instance in a MxN table) ?
10
votes
5answers
2k views

Is there any reason to use VARCHAR sizes rounded to a 128/256/4096 byte offset?

In database schema's, I often notice VARCHAR sizes are rounded to the byte offsets 128/256 or 4096. I've done it before as well, and the idea behind it was probably something with efficiency. ...
1
vote
2answers
365 views

Database design

I'm on the way developing an application which requires a kind of dynamic database, So this is what I want, This is the for reading the details of a class, the number of variables and methods ...
3
votes
4answers
169 views

What is the best way to design a table with an arbitrary id?

I have the need to create a table with a unique id as the PK. The ID is a surrogate key. Originally, I had a natural key, but requirement changes have undermined this idea. Then, I considered ...
2
votes
3answers
764 views

What advantages do we have when creating a separate mapping table for two relational tables

In various open source CMS, I have noticed that there is a separate table for mapping two relational tables. Like for categories and products, there is a separate product_category_mapping table. This ...
3
votes
4answers
1k views

Recommend Stanford Online Database Class?

I am taking the Stanford Online Machine Learning class which is outstanding. http://ml-class.org Is anyone taking the Stanford Online Database class: http://www.db-class.org? Does it seem useful if ...
3
votes
5answers
632 views

Good techniques to speed up database execution

I have an ASP.Net application that is using a MySQL database. My queries are not executing as fast as I would like them too. Are there some standard ways to increase the speed of a MySQL database ...
3
votes
3answers
2k views

How to design a database wherein multiple tags(string) are to be associated with an id?

I have to design a database wherein I have to associate an audio_id with multiple tags(words). I am considering following approaches to select one from these: 1) To have multiple fields for multiple ...
1
vote
3answers
216 views

Should I structure my DBs based on the data's true form, or how I plan to use that data?

This is mostly a hypothetical question, but it's something I've been tossing around and I wondered what other people though. Here's a contrived example to illustrate: Let's say I'm building an app ...
6
votes
2answers
366 views

What are some useful resources for learning tuple calculus?

I've been trying to go over my tuple calculus over and over again. What's worse is that my professor and tutors are not much help during their hours. Does anyone know a good place to learn about ...
2
votes
2answers
183 views

Are there standard strategies for defining job flow and dependencies?

I'm working on a project that involves the chaining of separate jobs into a single master job, though there may be parallel paths in the chain leading up to the final output. Job and chain details ...
3
votes
4answers
520 views

Which database should I use to manage relationship?

I need 2 capabilities: calculating mutual friends distinguishing between different types of edges, (e.g. FRIEND, ENEMY and other) getting relationships distinguishing between different types of ...
5
votes
2answers
444 views

How can I design an efficient moderation system for comments?

Here's the job I want to do: My project is a website where there will be a lot of comments. Those comments will be moderated: a moderator will connect, see comments and accept or refuse them. I need ...
5
votes
5answers
493 views

Should I use a relational datamodel or Cassandra with ColumnFamily based indexes?

Currently we are working on some storage problems for log data from various servers and communication message logs (HTTP(S), XMPP). There will be many write operations and for read operations we will ...
1
vote
2answers
273 views

Simplifying Database Schema for Extensibility by non-expert Users [duplicate]

Possible Duplicate: Is it necessary to create a database with as few tables as possible I've recently started to develop a database for a ~10 person office (it's an internship for me), and ...
2
votes
1answer
2k views

Database design for tagging system

I'm creating a system where items will have one or more tags. Now there will be an item table that will store each item, and a tags table, that will store all tags used in the system. My question ...
5
votes
2answers
178 views

Storing stop/start points in a database

Let's say I am storing start and stop points per user into a database table. For example... let's say in a chat system, a user only needs to see lines 24-293, and 500-512. (Let's say he logged off ...
4
votes
3answers
417 views

How should I implement Transaction database EJB 3.0

In the CustomerTransactions entity, I have the following field to record what the customer bought: @ManyToMany private List<Item> listOfItemsBought; When I think more about this field, ...
4
votes
2answers
4k views

Why NoSQL over SQL? [duplicate]

Possible Duplicate: When would someone use MongoDB (or similar) over traditional RDMS? How well the SQL and NoSQL go head-to-head. I read somewhere that SQL databases are not well for data ...
8
votes
8answers
2k views

Copying a competitor's database schema?

I am going to be releasing some software soon which will require users to run a local database. There is a competitor in the space that is doing the same thing and they have a pretty sophisticated ...
5
votes
1answer
818 views

Search multiple tables

I have developed a web application that is used mainly for archiving all sorts of textual material (documents, references to articles, books, magazines etc.). There can be any given number of archive ...
14
votes
8answers
2k views

Favoring Immutability in Database Design

One of the items in Joshua Bloch's Effective Java is the notion that classes should allow mutation of instances as little as possible, and preferably not at all. Oftentimes, the data of an object is ...
16
votes
6answers
4k views

Should I use one database per application or share a single database amongst multiple applications [closed]

I have multiple applications some that use data from the same sources. Is it best practice (or what are the pros/cons) to: leave the data in databases shared by multiple applications saves space ...
7
votes
6answers
1k views

Agile methods and Databases at the start of the project

New to agile and I'm not sure how to start. The idea is to create small parts of the project in sprints. However the project I'm working of requires a database and the database must be almost ...
6
votes
12answers
2k views

Over normalization in database

Currently I am working on creating a new database schema as part of a major new product. Our previous customer address records (in a previous product) look something like this in our current schema ...
4
votes
1answer
1k views

Database Application Design Best Practices [duplicate]

Once upon a time it was common practice for both the business logic and database logic to be written in the same language (eg PL/SQL, Transact SQL, etc), more recently the practice is to separate the ...
4
votes
1answer
500 views

Are rollback and roll-forward transactions equivalent for fault tolerance?

I've been reading about systems that employ transactions to provide fault-tolerance -- SQLite, for instance, implements a journal that allows the database to be rolled back to a known state in case of ...
1
vote
2answers
656 views

Price Comparison Database Scema

I have a bunch of data from multiple retailers. Each product that each retailer sells may or may not be sold by another retailer in the database. If multiple retailers sell the same product, then the ...
3
votes
2answers
250 views

Which database paradigm is suggested for a site with search capabilities?

Currently I'm trying to select the best DB paradigm to implement a web site with full-text search and faceted search capabilities. I have an important functional requirement: The database paradigm ...
4
votes
2answers
487 views

How to design a website with search capabilities?

Suppose you want to create a web page with some search capabilities over a database. Search has to be restricted both on some categorization of data and open text given by the users. Functional and ...
5
votes
6answers
821 views

Priority list of tasks stored in a database

I am trying to think of the best way to do the following: I have a list of tasks stored in the database. A task has a priority assigned to it. You can change the priority of a task to reorder the ...
9
votes
2answers
1k views

What is the difference between collation and character set?

I have a general question about databases. We usually use the term collation with databases. I would like to know how its different from character set. I guess collation is a subset of character set. ...
2
votes
2answers
706 views

Database for storing books by grouping, their pages, and the table of contents

I'm looking for a better way to deal with the design I have here, I'm not confident it's really suitable. To give this some context, lets say we have a bunch of groups, one group could be "SQL", and ...
2
votes
3answers
212 views

Fault tolerance through replication of SQL databases

Suppose the middle tier servers are replicated 3 way and the backend database (MySQL, PostgreSQL, etc...) is replicated 3 way. A user request ends up creating some user data in the middle tier servers ...
11
votes
8answers
1k views

Handling deleted users - separate or same table?

The scenario is that I've got an expanding set of users, and as time goes by, users will cancel their accounts which we currently mark as 'deleted' (with a flag) in the same table. If users with the ...
9
votes
3answers
3k views

EAV - is it really bad in all scenarios?

I'm thinking to use EAV for some of the stuff in one of the projects, but all questions about it in stackoverflow end up to answers calling EAV an antipattern. But I'm wondering, if is it that wrong ...
8
votes
2answers
309 views

When is cloud database right for me?

Some say that DBaaS (database as a service) -- aka cloud database -- is not suitable for Business Intelligence (BI), analytics (OLAP) or archiving. Is this true? More generally, when DBaaS is the ...
6
votes
5answers
366 views

Anti Identity Column

I recently came across some code which generates an identity value for a key: DECLARE @ID INT; SELECT @ID = MAX(ID) + 1 FROM Person; INSERT INTO [Person] ([ID], [FirstName], [LastName]) VALUES ...
11
votes
10answers
880 views

How could RDBMSes be considered a fad?

Completing my Computing A-level in 2003 and getting a degree in Computing in 2007, and learning my trade in a company with a lot of SQL usage, I was brought up on the idea of Relational Databases ...
3
votes
3answers
497 views

Quickly Large Data Pivoting

We are developing a product which can be used for developing predictive models and the slicing and dicing of the data in order to provide BI. We are having two kind of data access requirements. For ...
2
votes
8answers
432 views

How Would You Design This Table?

I have to create a table where each row needs to store 50 number values. Each row will always need to store 50 number values. If this was a smaller number of values, I would just make fields for ...
1
vote
9answers
866 views

Sr. Dev made a database I disagree with. Advice sought

I need to run to work soon, so this will be brief. I've only been with the company for a couple weeks. It is a good company, this is a contractor who just happens to be twice my age. I am new to ...
13
votes
7answers
1k views

What special considerations are needed when designing databases to hold financial records?

I hope this question isn't too broad. In the future I may need to add some accounting and financial-tracking systems to some applications (mostly web-based applications, but my questions pertains to ...