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

2
votes
3answers
56 views

Table design for holidays

I'm creating a system to store holidays and events. I have a basic understanding of the schema for the static dates (every 23rd of march for instance). My trouble lies with the relative dates (i.e. ...
1
vote
3answers
100 views

DB Schema design : single table with more columns vs multiple tables with fewer colomns

What would be better DB design for a social network website. A single table with more columns and less rows or multiple table with fewer columns but more rows. For example: User can post an update on ...
-2
votes
1answer
26 views

How to design task assignment system?

I want to design a system which is similar with stackoverflow review feature. That is to say: There are n tasks, which should assign to users (users count is unknown). At one time, one task should ...
0
votes
2answers
130 views

Why should I use lookup tables at all?

This question confirmed, what I was already aware of -- instead of directly storing strings in table, I should rather use integers or enums and join them with lookup table, to get, as a result, ...
2
votes
3answers
112 views

At which point using string-based enums can become a real problem?

This is a direct follower to this question. An answer given to that questions says (my understanding), that nowadays using string-based enums instead of integers isn't a much problem, because hosting ...
1
vote
3answers
73 views

Using auto-increment clustered key and guid primary key together

My boss is the db administrator in a new software project and he came up with that design where every table will have both a auto-increment clustered key and a guid primary key (or possibly composite ...
1
vote
0answers
32 views

Adding fields a good use case for EAV? [duplicate]

Is being able to add fields quickly to a system a good use case for EAV? What would be the frequency or number that would justify using an EAV model?
2
votes
1answer
71 views

An approach to multilingual db design

My boss is planning on a new db and wants to support multilingual data in this manner: LocalizedDescs (Guid / LanguageGuid being the primary key) Cluster Guid LanguageGuid Desc ProductCategories ...
0
votes
1answer
28 views

Generation of ids in offline/online application

I'm a bit confused about how to identify the elements in my application. I have a rest backend with an sql database. I'm currently using numeric (autoincrement) ids as primary key and use these for ...
0
votes
1answer
26 views

Storing Multi-select and Single-select data together

I've got a database with some multi-select fields. To keep it simple, let's just say those fields are MatchGender and Interests. I want users to be able to find people who match (hence Gender is a ...
1
vote
1answer
92 views

CMS with unknown data structure [closed]

I am looking to build a sports small application, but I would like to build it so other people/organizations could use it as is. These would be separate apps, not one app that caters for all. For ...
1
vote
2answers
194 views

NoSQL or MySQL? [closed]

I'm developing an app that requires to save data that is not consistent across all rows. These database entries represent different kind of sport activities. Let's take an example: In football the ...
0
votes
1answer
55 views

How to handle rating? [closed]

I want to implement like/dislike system, but I don't know how to achieve best performance. I have to tables: blog posts and comments that need rating. Should I store all data in one rating table? Or ...
1
vote
2answers
125 views

One Enum vs Multiple Enums

I am developing an application where a user submits a mission and other users accept the mission. Pretty simple. I want to keep a track of the mission progress status and store it into a database. ...
0
votes
1answer
31 views

Database design for linking parent & child relationship

Currently i have requirement saying user from an UI creates there own forms which has types textbox,choicegroup etc.. Does anyone have a any idea on how to architect the database to store all data? ...
2
votes
1answer
68 views

Use of tenant_id in multi-tenant database

We are building a SASS web application where every company will be using its own database schema. Using postgresql, there is a table 'companies' in the public schema that holds the name of the company ...
2
votes
2answers
84 views

Is normalization all that's needed to ensure data integrity and quality reporting?

I've gotten out into the real world recently, and for the first time have had to really think about database design, as I've been developing across the entire Java stack. With that I've realized that ...
0
votes
0answers
21 views

Cascading ACL and drill-down data architecture

I want to implement a drill-down data architecture based on the data and the ACL permissions of a user. Lets say we have data of employees of an organization and lets consider the hierarchy as ...
4
votes
1answer
116 views

How to store data that is recorded with different frequency?

I'm writing a metallurgical web application, that must store data (electrical parameters) recorded at different frequencies. For example: six parameters recorded with frequency of one measure per ...
11
votes
2answers
477 views

Why store flags/enums in a database as strings instead of integers?

I've been browsing SQL dumps of some famous CMSes, including Drupal 7, Wordpress (some quite very old version), and some custom application based on Python. All of these dumps contained data with ...
1
vote
1answer
101 views

Is there a valid symbol for “two or more” with Crow's Foot notation?

I have a database design for which one entity of Class A always has at least two entities of Class B. Can I express this with valid Crow's Foot notation? One possible idea I had was this: Excuse ...
1
vote
1answer
61 views

SQL - Designing a Threshold value table

I need to design an SQL table to be used for "threshold" or special values, which in general would have the following properties: - key - value - comparer (less than and greater than as a start, ...
0
votes
1answer
66 views

How to represent a Model with a 1:N relation?

I have a task to associate 1:N documents to a record in my hardware table. This file could be a warranty, or whatever. In SQLServer I set up a FileStream group and made a table for only the file and ...
1
vote
3answers
196 views

Are there any good reasons to use ER Diagrams instead of UML Class Diagrams for data modeling? Is ERD the COBOL of data modeling?

Are there any good reasons to use ER Diagrams instead of UML Class Diagrams for data modeling, given the fact that class diagrams subsume ER diagrams? Or is it just for historical reasons because ...
3
votes
1answer
41 views

Architecting a SaaS for backwards-compatibility in regards to data and business logic

I have a SaaS platform where the user fills out a form and data entered into the form is saved to a database. The form UI has a large amount of config (originates from the DB but ends up in ...
11
votes
5answers
416 views

Version controlling a database's contents

I'm working on a web project that involves user-editable content, and I'd like to be able to do version-tracking of the actual content, which lives in a database. Basically, I want to implement ...
0
votes
0answers
42 views

MySQL Database normalization for a user model

I currently have a MySQL Relational Database with a users table with the following attributes: ID (Primary key) Name Username (Unique) Password Email (Unique) Description Profile Picture File Path ...
1
vote
1answer
28 views

Recording many data items and retrieving time-based snapshots

I have a .Net Windows application that continually receives data from a hardware device. Additionally, the user can change various settings and parameters from within the software. I would like to ...
1
vote
2answers
138 views

Database Design for Inventory

I am starting to design a typical product based MySQL database but I keep running in circles on how to design the tables. I have many types of products Jeans Tshirts Dresses Which have many of ...
3
votes
0answers
141 views

Fine grained search over a large dataset

I have roughly 4 million records per day and have to keep 7 years worth online, so we are looking at 10.2 billion records that I need to be able to search through. The users are expecting that the ...
0
votes
2answers
34 views

Groups relationships - Detailed or Direct?

Current design I have a Person model: PersonId Name ----------- ---------------- 1 Jessica 2 Jennifer Then I have a ShareModel which have the ...
47
votes
7answers
5k views

How can I argue convincingly against duplicating database columns?

I've started working at a new organization and one of the patterns I've been seeing in the database is duplicating fields to make writing queries easier for the business analysts. We're using Django ...
1
vote
1answer
96 views

Likes / Stars / Following - same or separate data structures? [duplicate]

I am building a social network, which will have standard features of 'likes' (upvotes) for posts, 'following' between users and 'stars' for favorite posts. These might reasonably expand in the future ...
1
vote
1answer
150 views

Am I planning my database/backend correctly?

I'm an iOS developer and to be honest I'm not really looking to become a database expert right at this moment, but I do need to know how to properly plan out what I believe to be a pretty cookie ...
4
votes
1answer
42 views

Modular Database, Inheritance of Schema

Consider multiple relational database schemas that have an inheritance dependency structure as known from OOP systems: Tables are just a placeholder for arbitrary database objects such as Views, ...
2
votes
1answer
47 views

Is it good practise to have the class name as a prefix in Django model?

I wrote a model in this format in Django: class Block(models.Model): block_id = models.AutoField(primary_key=True) block_name = models.CharField(max_length=200) block_code = ...
2
votes
2answers
82 views

Notifications table design?

I'm trying to create a notification system for my social network. But I'm stuck on the database design. so when a user comments on another user I want to display "X commented on your post." or when ...
3
votes
3answers
93 views

Secure DAL Design using Stored Procedures

I normally avoid sProcs as much as possible. I dont like the language be it TSQL or PL/SQL; they seem archaic against Java/Dot-Net which I use. I go for them when a routine needs to fetch a lot of ...
1
vote
1answer
50 views

Object Storage where Object Type is variable

From time to time, we come across a problem where we must store an object, but we don't know in advance what kind of object we're going to store. I'm going to give a very simple example. Requirement: ...
1
vote
1answer
76 views

What happens to database design process when ORM tools are used?

I have learned about database design, including normalization during my undergraduate course. When we have to model a database for a system, we can start with an ER model and then convert it to the ...
0
votes
1answer
47 views

Planning complex Mongo (And possibly other NoSQL) Databases

There is no "right way" to do anything, but there are "better" and "worse" ways, as well as true and tested ways. I'm studying Mongo and considering it for a project. It's gonna start small but ...
1
vote
2answers
84 views

What is better for scalability for this specific dataset, MongoDB or MySQL?

I have a web app which has users, forms, and volunteers signed up on those forms. Currently I am using MongoDB and have it setup with a collection for admins, and a collection for forms with ...
0
votes
3answers
128 views

Is the Model part of MVC an inner platform

I'm not particularly up on MVC as an architecture but isn't the Model just a duplication (except slower and buggier) of the database? Given modern databases support stored queries, user definable ...
4
votes
1answer
230 views

How does the team ensure a good DB design? [closed]

We want to ensure that our team delivers a good performing DB design. But we are not quite sure how to achieve this. Couple of solutions have been suggested within the team: Adding DB indexes to ...
6
votes
7answers
407 views

How would you design a user database with custom fields

This question is around how should I design a database, it can be relational / nosql databases, depending on what will be the better solution Given a requirement where you'll need to create a ...
1
vote
1answer
66 views

how best structure localization of content type category name

I'm working on swift / iOS with a parse.com backend but this question could be applied to any language and is a general conceptual question. I'll use a specific example for illustration purpose. I ...
3
votes
1answer
140 views

Do you still need created_by and updated_by attributes with dedicated auditing?

For as long as I have been writing database-backed websites, I have included created_by, created_at, updated_by, and updated_at in every single table. As you can guess, whenever a record gets created ...
1
vote
2answers
54 views

How to handle inmutable data on Databases

I'm working on a quotation software. It basically creates quotations for customers based on certains ProductModel that contains n Plan that contains n PriceRange Edit: Here's a ER diagram of the ...
1
vote
3answers
119 views

Chat-service database design

I have an android/desktop application that I'm now releasing on the web, and as there are some social aspects I thought of adding a chat-service so users can IM as well. For this chat service, I want ...
58
votes
10answers
6k views

Is it premature optimization to add database indices?

A colleague of mine today suggested that we go through all of the queries in our application and to add indices accordingly. I feel this is premature optimisation because our application is not even ...