Questions tagged [database-design]

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

1
vote
1answer
25 views

How to store data which can be a foreign key or free text

I am not sure how to explain my problem, but basically I have an input field which lets you enter member's name or select one from a dropdown list. If the user has selected the person from the list ...
-2
votes
0answers
20 views

What are the best practices of designing database to serve multiple apps within one ecosystem? [on hold]

To clarify the question here is the scenario. There is a web app which implements RESTfull API with JWT authorization. It runs on PHP/mySQL at the back and Angular2 in front. Then comes another app ...
0
votes
2answers
79 views

How should I update non-maintained database tables between production and development?

I'm working on a Django web application (with a mySQL back-end) that uses non-maintained tables(tables not modified by the web app). However, I have two copies of the data tables (one for production ...
0
votes
1answer
38 views

Use single table with lots of columns or break it out and use Views, when using Entity Framework Core

I am currently building a game series information site and have come to a design issue. I have a table called Abilities that would have character ability information in it. Depending on the game ...
0
votes
1answer
38 views

Temporary users to restrict db access of query?

I am new to database managment, and I am wondering if it is a good idea to create temporary users to restrict access to only a single table. Like having an user named _logs can only (read?) and ...
0
votes
1answer
60 views

Service Oriented Architecture (SOA): One Database or Multiple Databases?

In Service Oriented Architecture (SOA), should there be One Single Database "with the share as much as possible philosophy" or Multiple Databases by Service/functional area? I know in Microservices, ...
1
vote
2answers
75 views

RESTful API - Adding nested resources as a query parameter?

I recently had thoughts on handling the flat vs nested architecture when designing a RESTful API. Would there be anything wrong with having a system where your nested resources can be specified ...
0
votes
2answers
157 views

Best way to match timezone with time offset?

I have a c# solution which uses mssql database to store data. In my database there is a big table of entities (e.g. accounts) for each of which the TimezoneId field is defined. This field is filled ...
-2
votes
1answer
59 views

Relationship between users and items tables in a database

I have two tables in a database: A users_table and a items_table. I need a way to be able to define which items each user gets access to. I thought to create a third table containing: 'user_id', '...
0
votes
1answer
79 views

ER Diagram in Barker Notation

I engineered an ERD diagram using Barker's notation. The problem was to make a database for system of water pipes where one node is connected to another using a section (pipe), each node can have ...
0
votes
0answers
32 views

Design a way for multiple and single group mapped to a Role?

Currently I am trying to setup a relationship between user groups and roles. I am trying to satisfy: Multiple roles apply to single group multiple groups can have same role multiple ...
1
vote
0answers
106 views

How to store relational data belonging to different client customers?

My users will be businesses with a small number of accounts each: e.g. Business #1 with 3 users, Business #2 with 5 users, etc. I am trying to determine the best way to organise the relation (on ...
0
votes
1answer
97 views

Encoding of timestamps over cosmological time (64-bit linear vs 32-bit logarithmic)

I understand this is the place to ask questions pertaining to software design. If my question is considered to opinion-based, is there a forum or something better suited for the discussion? ...
2
votes
3answers
239 views

How do you decide if data should be stored persistently or calculated at runtime?

I'm designing a service that contains different plans and features. I want to freely assign and remove features from plans. The service needs to tell the client both an ID's plan and the features it ...
1
vote
1answer
31 views

Entity Relationship Model do I have to connect a table which is not using attributes from another table?

I tried creating an Entity-Relationship-Model, but I just don't get if I have to connect some tables and if I have to connect all, how do I connect tables which don't use attributes from another table....
1
vote
1answer
72 views

Does a microservice's individual database need to have complete data?

Say you have a Users and Orders service and they have their own database. Since microservices need to stand on their own even if another service is unavailable, does the Orders DB need to have all ...
0
votes
1answer
80 views

Is it a good idea to create a new “message table” for each user? Should I worry about performance if I use a single table?

I'm working on an app that will have messages exchange and which have a database with several tables to all users data and preferences but I got thoughtful about the table of messages. I will have ...
1
vote
1answer
47 views

Database structure for an app used to capture data in warehouses

I am in the process of creating an android app for our clients that would replace the paper-trail in their facilities with electronic inspections. Although I have coding experience, I have little ...
0
votes
1answer
68 views

Database schema for products and their packages

The product is water purifier, and we are selling packages included support for changing filters. Serial is a unique number identifying a single produced item and it's only for water purifiers not ...
2
votes
1answer
55 views

Tracking revision history by recording events

I've got a requirement to create a data structure that allows for users to view revision history. Not just the history of a table, but the history of the entire structure at a given point in time. A ...
-1
votes
2answers
327 views

Application/Database design where two tables have both 1-to-many and 1-to-1 relationships

I have an application where the requirements are to show a list of (just for example) car manufacturers. When you click on one of the manufacturers, a list of car models show up. You can then click on ...
0
votes
4answers
118 views

Could you please recommend an approach on converting non-unique field to a unique field?

On our prod db we have two tables: companies invoices Relationship: A company has many invoices An invoice belong to a company The invoices table contains duplicate invoice_number for each company. ...
0
votes
0answers
44 views

Designing database relationships for a voting application

So I designed database relationships for a voting/polling application. I want a user to only be able to pick 1 option on a poll. I want multiple options per poll. So what I have here is this. User ...
1
vote
2answers
58 views

Branching SQL relationship to C# object model

I'm developing a C# WPF desktop application where I need to read/write to an SQL database regularly. Now I want to map the data from the database to objects in C#. I can't use Entity Framework so I'm ...
42
votes
8answers
8k views

Is domain driven design an anti-SQL pattern?

I am diving in the domain driven design (DDD) and while I go more deeply in it there are some things that I don't get. As I understand it, a main point is to split the Domain Logic (Business Logic) ...
1
vote
0answers
23 views

DataBase design generated by hibernate Many to Many for MariaDB

Hi I am in middle of designing DB and Got a little bit confused about DB Design. I am Using Hibernate as ORM Tool ahd mapping between Page and Step entity in hibernate. @ManyToMany(fetch = FetchType....
0
votes
4answers
54 views

Extent of Administrator Capabilities: HR and Design Logistics?

So I am developing an employee management application on behalf of a company and am concerned about the extent of rights and capabilities that are to be bestowed upon registered administrator accounts....
0
votes
3answers
82 views

What are criteria for enterprise to have multiple databases (for new project)?

We are working on new enterprise project (multiple activities - online ordering, offline ordering, b2b ordering, accounting processing, secure payment processing, analysis and dynamic pricing and so ...
2
votes
1answer
111 views

PHP - Dynamically apply parsing rules to text, and save to dynamic fields

OK, so I have been at this problem for the last few days, and I must admit - I am stuck. I am trying to make a web application, where users can upload documents or send inbound e-mails. Each ...
1
vote
1answer
124 views

PHP - Designing a rule based parsing engine

Dynamically apply methods/"rules" to documents I hope someone here can help me/guide me in the right direction. I am currently creating a web application, where users can import a text file, and then ...
1
vote
2answers
117 views

Multiple use/semantics of the same database fields - is it acceptable practice?

I have ERP database whose good or person entities each have several hundreds of fields. Many of them are used for some subjects only. And hence senior companions (especially from the business division)...
6
votes
3answers
335 views

How to model public IDs?

While creating the architecture of a new project I struggle to come up with a good solution to handle public IDs. For example our users will receive a membership card. Each card has the membership ID ...
2
votes
2answers
80 views

How to implement change log of a ticket in complaint management system [closed]

One of the requirement, in the complaint management system were are designing, is to implement complete history of the ticket. For example Status was changed (new to pending to work in progres to ...
3
votes
2answers
137 views

How to keep logs of emails sent by application

We have an ecommerce application which sends out transactional emails to customers for events like order placed, order shipped, order delivered etc. We used to send one bcc of every email to a gmail ...
0
votes
2answers
106 views

Some Suggestion about Data Modeling

I want to make a social game for Android. I am using NoSQL Based Database (MongoDB) and I am using NodeJs. I am using Android-Volley library to make POST and GET requests. But I am stucked on ...
-2
votes
1answer
45 views

Preuso/empty entity or only real entities + nulls?

I have a table "products" and a child one "product_modifications" Some products have "product_modifications": "colour", "size",, .... But not all. When a client orders a product, views pictures and ...
0
votes
1answer
67 views

How to create a flexible datamodel?

I'm trying to create a flexible datamodel and i'm not sure what's the right approach. My application is used by several clients (big and small). Big clients need all the seperate layers, but small ...
0
votes
2answers
98 views

Referencing Database Primary Keys from Codebase

I don't have a lot of experience with these kind of issues, but I feel I need to consult on this issue. The current codebase I'm working on is using what I consider to be a questionable technique to ...
1
vote
1answer
210 views

DDD many-to-many relationship on single entity

To provide a bit of context, the system I'm working on is a football database. A Squad has a collection of Rivals. Arsenal (Squad) has Tottenham and Chelsea as rivals, where Chelsea has Tottenham and ...
2
votes
4answers
147 views

What is the name of DB design pattern which support only soft-deletes and soft-updates?

I heard that there is some DB design in relational databases where updating a record will create a new record with different timestamp or status. Also, deletion will be soft-delete (it updates the ...
3
votes
1answer
101 views

Auto incrementing from two different points on the same table?

Each customer has an ID. For every new customer it's incremented by 1. My company is wanting to start selling to a new type of customer (lets call it customer B), and have their ID start at 30k on ...
10
votes
5answers
595 views

Do I really need triggers for relational database, for example, PostgreSQL?

I know that triggers can be used to validate stored data to keep database consistent. However, why not perform validation of data on the application side before storing them into the database? For ...
3
votes
2answers
102 views

How to design a multi-year statistics database?

I'm designing a database for name statistics (how many people where given that name). The data consists of names, and numbers for how many men and women were given that name within a time period (...
0
votes
1answer
46 views

Database design for a survey app [closed]

I'm creating a survey app and I don't know how to design database. I need surveys with multiple questions and multiple types of questions. There are 3 ways that I could think of: a) Create a ...
2
votes
1answer
58 views

Alternatives to RDBMS For Forecast Data

I currently capture well structured forecast data in a SQL Server. An example of this data is below: What this tells me is that each day, I receive a forecast for the next three days. Note that in ...
-2
votes
1answer
51 views

Designing a facial recognition systems database

First of all, I hope im in the right stack exchange. So I'm trying to build a facial recognition system, e.g. one that recognizes a face and compares it to a database of known faces. For the first ...
1
vote
0answers
56 views

Strategies for dealing with Stale data and Fetching

I'm working with firestore and have encountered several situations where a document will contain stale data which is a duplicate of the source of truth located elsewhere in the database. For ...
0
votes
1answer
35 views

In a parent table - Child table relation , where to store order of children

Assume a Parent -> Child relationship in RDBMS. questionnaire table and question table. question table has a foreign key questionnaire_id to store which questionnaire it belongs to. Questionaire ...
0
votes
0answers
65 views

What should I do if I am unfamiliar with my organisation's codebase? [duplicate]

I've recently started my first job as a software developer at a small startup company. I do not have a degree in a software engineering related field, although, I have very recently completed an A-...
1
vote
0answers
25 views

Test Results Database Design

I am trying to write a database to store test results for components, against a serial number, with different components potentially having different tests. I want to prioritise ease of adding new ...