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

1
vote
2answers
34 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
57 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 ...
54
votes
8answers
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 ...
0
votes
0answers
24 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, ...
0
votes
0answers
20 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
37 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
33 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
0answers
14 views

Zerofill Auto Increment - mySql [migrated]

Ok, So I'm working on an app and I can't remember, for the life of me, why I set a zerofill on an Auto_Increment column when I created the database. And I couldn't exactly find any compelling info ...
0
votes
1answer
39 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
150 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
59 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
205 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
29 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
61 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
44 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
61 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
239 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
88 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
72 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
73 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
189 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
45 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
177 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
129 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
184 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
164 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: ...
1
vote
0answers
87 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
154 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
182 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
111 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 = {}; ...
0
votes
3answers
71 views

What is the hierarchical DB schema for this xml?

As per this link, this is the xml that maintains "BookStore" data. I see that number of occurences of author are varying for any book. xml's hierarchical representation of BookStore looks more ...
0
votes
3answers
71 views

Best approach to implement an update operation of a container object?

I have an Invoice object wich may contain several FacturedServices objects stord as a list. In may interface, the user can edit an Invoice object, delete add or edit its FacturedServices list. Whe ...
3
votes
1answer
39 views

(HTML) Form structure storage

In the context of a single-purpose website/application (for instance, based on Symfony2), I wish to have a set of forms fillable by users which then will be sent out as a formatted email (with the ...
0
votes
1answer
128 views

Dealing with several custom getters

I have a data structure with data units containing different types of data. I've wrapped the data in "Field" objects so that each field is able to independently parse user input in a desired way. ...
2
votes
3answers
135 views

Best approach for storing huge data

I'll be handling 300,000+ users. Each user (after logging in) will be able to create lets say "folders", in each folder, users will create "name=value,name2=value2,name3=value3" entry pairs. Each name ...
8
votes
3answers
427 views

Decentralized Data Management - encapsulating databases into microservices [closed]

I've recently been taking a course on Software design and there was a recent discussion/recommendation about using a 'microservices' model where components of a service are separated into microservice ...
1
vote
1answer
129 views

Creating a separate table for images or adding “image fields” to many tables?

I need to create a database in which several tables have images. For example, users have profile pictures and uploaded ones and products have many pictures, as well. Is it better to have one MySql ...
4
votes
2answers
110 views

Using audit trail as time machine?

I would like to do SELECT * TABLE t (using data from 1st of march 2012) I already have a nice audit trail of all tables in the database. It basically makes a copy of all rows that change, storing ...
54
votes
7answers
3k views

Code First vs. Database First

When I design and create the software I work on, I typically design and create the back-end SQL tables first and then move on to the actual programming. The project I'm currently working on has me ...
3
votes
2answers
82 views

Database design for polymorphic data

I have an application that needs to log communications with users over several different mediums: Email, SMS, Voice, Website Announcements, etc.. in a traditional database. I have considered 3 ...
0
votes
0answers
29 views

I have two applications… use NoSQL or RDBMS? [duplicate]

I have two applications in the making: one is a budget management tool; the other is a article based places/restaurant guide. The budget management tool works where users create accounts (e.g. bank ...
4
votes
3answers
123 views

How to track temporal changes in a database?

Imagine a software for theater owners. You can accept reservations for the different cinema halls. Each hall has a different number of seats. Say the owner wants to know how many people visited the ...
2
votes
2answers
134 views

Should I use relational or noSQL databases for this problem

I'm working on a project where one part is to save data of different people. A typical person might have the following structure: Email: Multiple values possible City: Multiple values possible ...
2
votes
1answer
77 views

How to represent an optional-to-optional relationship in a database

I have two types of users: a CRM user and a system user. We have a record of every CRM user, thanks to a nightly sync that we run (so we don't have to hit the CRM API every time). We have system users ...
0
votes
1answer
47 views

user verification value - where to store [closed]

Quick question as relates to database. Where would you store the value of "UserVerified"? (The one that occurs after the user has checked his email and clicked on the "Verify" link with the hash ...
0
votes
2answers
56 views

How to Design Database with User-Contributed Content

I'm building an application where there are different "Locations". There are Stores, Bars, Schools, and Churches (and so on) all of which are geocoded and defined by existing data sets. While not ...
-1
votes
1answer
105 views

Best way to track 200 boxes [closed]

I have a php/mysql application that needs to track a simple on or off setting for 200 boxes. I use it for a fundraising application. Basically there are 200 buttons. A user selects a button numbered ...
1
vote
1answer
46 views

Looking for advice for the following MS SQL Schema

We currently have the following SQL Schema: Projects Budgets BudgetTabs BudgetSections BudgetTasks BudgetTaskDetails ...
1
vote
1answer
51 views

Proper tree NoSQL structure with focus on full-text searching

I developing an app with tree(folder-file) structure, on which I should perform full-text searches with MongoDB. I did a research on the best tree structure practices and found this great article, but ...
0
votes
4answers
102 views

Is there an accepted design pattern for storing a few global variables in a NoSQL database?

I'm wanting to create an admin dashboard for my app, and to show new events there. In order to know which events are new, I'll need to store at least one extra datapoint to the server: the last date ...