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

0
votes
0answers
16 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
21 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
88 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
103 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
23 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
77 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
88 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
36 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
37 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
54 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
70 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
35 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
63 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
33 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
67 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
103 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
215 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
285 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
28 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
126 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
48 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
73 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 ...
1
vote
0answers
45 views

ER Diagram Multiplicity (UML)

Schema: #=PK Employee (#NIN, fName, lName, address, DOB, sex, salary, taxCode, deptNo) Department (#deptNo, deptName, managerNIN, businessAreaNo, regionNo) Project (#projNo, projName, contractPrice, ...
1
vote
0answers
24 views

Database data Bucketing Report Design

Here's the scenario: I have item x (item_id, customer_number, cost) which can be submitted to another system multiple times over months which may or may not reject item x before finally accepting it ...
1
vote
2answers
54 views

Performing data operations that involve separate applications and data sources

I'm designing an enterprise application that produces output based on some input data from another application. In this case, I happen to have also built and thus do control the source application ...
0
votes
2answers
49 views

DB Schema for a questionnaire - Different output from different combinations of responses

A user is required to complete a questionnaire - answering the questions in various categories. Depending on the responses from the user, the user will be presented with a number of recommendations. ...
0
votes
1answer
43 views

Database structure for links between objects of same class

I have seen elsewhere that it is a nice design to implement links between objects in a database as a separate object. This makes a clean way to have multiple objects of one class to be linked to an ...
1
vote
3answers
161 views

Is self referencing tables a good idea for geographical data?

I am creating a design for different Geographical types where each type is just a little "place holder" in over all heirarchy. One example is Zip code Belongs to Territory Belongs to District ...
3
votes
2answers
77 views

Encrypting stored data for multiple unique users to access information

Developing a database for many users, and thousands more "people" in the database, one section requires we encrypt the personal data - Youth's information, medical information, etc. We have users who ...
5
votes
2answers
237 views

Hard Coded File Paths - Solution?

Say you have an application that saves image(.jpg, .png etc) and text(.txt, .xml) files, and the application has all of the files paths hard coded throughout code, per the example below. Assuming the ...
0
votes
1answer
35 views

Merging user activities into one stream with a common representation

My social network website currently has forum threads and posts gallery pictures albums on the users' profiles group discussions classifieds I would like to create one "stream" of activity. It ...
0
votes
1answer
67 views

Application with really dynamic data structure [closed]

Well, I'm on the verge of this project that really puzzled me. The situation is, in our office, we have a department that collect data about the corporate performance indicators from all across the ...
0
votes
1answer
48 views

Is there an established pattern for associating a database entry with a Java class that executes on that data?

I have a behavior tree with different leaf nodes that execute tasks. When building out the tree relationship in the database I need an association between the leaf node entry and the Java class that ...
1
vote
2answers
72 views

Structuring data to represent a tree with squirrels

What I want to represent Let's assume I have several schemas of the following kind: It is a tree on which positions of squirrels are represented by a blue dot. The number of bifurcations differ ...
3
votes
3answers
246 views

Do I need use really INNER JOIN?

Imagine a coiffeur, with his services: +----+-----------------+--------+ | id | name | amount | +----+-----------------+--------+ | 1 | hair cut | 40 | | 2 | shampoo | ...
2
votes
1answer
91 views

What should be the structure of a person to person store database?

I am going to create a person to person store with Laravel, a website where its users can share and sell their product or their mobile, TV, Computer, Shoes, Shirts, Books, Cars, Bags, Animal, etc. I ...
0
votes
1answer
120 views

Laravel relationships and database schema

I am playing around with Laravel and came across something in the documentation for defining 1 to 1 relationships between tables that I would like to get feedback on. The example in the docs is ...
0
votes
2answers
103 views

Implement a virtual tag on the database level

I have a set of objects, for which users manually applied tags, whatever they invented. I'd like to implement a task engine, where each task might be applied to objects from a tag. For convenience, ...
3
votes
2answers
209 views

S3 image urls in database

I have an application where users will be able to upload multiple images for one Product (via something like Ryan Bates nested fields, so you'd click "Add Image", and a file upload would appear on the ...
0
votes
1answer
67 views

Class Table Inheritance: do child tables need a primary key?

I'm using the Class Table Inheritance architecture with my application and have read Fowler. When mapping my database tables to classes in code, I've realized I have no need for an "ID" property on ...
2
votes
4answers
233 views

Are NoSQL databases the best choice for more efficiently querying large amounts of data?

We are planning to build a travel website in which we will be integrating multiple APIs (eg. DOTW, GTA, Expedia) for Hotels. I have initially tried to use MySQL but since there are huge amounts of ...
1
vote
4answers
144 views

Database design for objects with multiple states

Context I'm designing a database which, simplified, should be able to handle users sending job requests to each other, and after that a job can be started, finished, and reviewed. The design should ...
1
vote
1answer
228 views

Is this database design good? What JPA Entities should I create for this design?

I am trying my hands on JPA. For this I am thinking of using the example of a student admission process as shown in the diagram below. Is this design good ? Any suggestions for improvement are ...
2
votes
3answers
167 views

Effect of denormalizing

Here's a scenario where I'm wondering whether to denormalize a relational database (MS SQL). Text description of the requirement I have users (stored in a users table). Users belong to Accounts: ...
2
votes
0answers
99 views

Is this a good implementation of mongodb for a money management tool?

I have a money management tool which has users. Each user may have several accounts/funds (e.g. bank account). For each account/fund there may be thousands of transactions. Users may only view their ...
3
votes
1answer
220 views

What is exclusive arc in database and why it's evil?

I was reading most common database design mistakes made by developer Q&A on stackoverflow. At first answer there was phrase about exclusive arc: An exclusive arc is a common mistake where a ...
1
vote
2answers
357 views

many to many relation in database schema and oop class diagram

I have Student and Group entities. Student can have many groups and Group can have many students too. so in database I should have middle class and change many-to-many relation to one-to-many and ...
1
vote
1answer
142 views

A very simple database system with JSON

If we need to store some data in a database, but without the need of advanced SQL features, can we use this scheme (written here in Javascript / node.js) : // the DB will be in RAM ! var myDb = {}; ...