Questions tagged [database-design]
The development of the conceptual schema and/or the logical model and/or the physical settings of a database.
6,366 questions
0
votes
1
answer
42
views
Modeling Addresses in SQL in Multitenancy Enterprise app
I have a multitenant app where I'm having some trouble modeling the Address tables. It's an Enterprise App so the database is quite big.
Since tenants, users and persons can have N addresses I've ...
0
votes
0
answers
25
views
Designing scalable sensor data storage: wide table vs single table per sensor in DolphinDB
I'm designing a system to store large volumes of sensor data (10,000+ sensors) and evaluating different schema approaches in DolphinDB.
Current Context:
Data Volume: 10,000+ sensors, continuous time-...
0
votes
0
answers
9
views
How to model a dynamic relationship in Hibernate where one field can reference multiple entity tables?
I’m designing an application using Hibernate (JPA) and I’m facing a modeling challenge related to dynamic relationships between entities.
Here’s the scenario:
I have a Comment entity that can be ...
0
votes
0
answers
27
views
How to update complex data structure in RocksDB?
I have been working with RocksDB for a while, and in my use case, complex data structures are stored as values in the database — for example, a Map that may itself contain nested maps.
1. Update ...
-1
votes
1
answer
95
views
Best Design and Implementation Practices for a long (billions) and narrow table [closed]
I am about to start working on a project that aims at modeling all trees in France using the LiDAR coverage of the territory.
I won't get into the detail of the modeling but basically after ...
2
votes
1
answer
104
views
Design of a table that references several columns in two other tables
Is it possible to create a table that is built from an inner join of two other tables with additional columns, but where the rows are kept updated when the inner join is re-run?
Currently using ...
0
votes
0
answers
39
views
When I hit iiq console in command prompt my Sailpoint says database version doesn't match the system version
In mine it says Application's system version 8.4-104 does not match IdentityIQ database's system version 8.4-87
I tried to update the database its still not working. If it works I can import xml files ...
1
vote
1
answer
108
views
Null value does not violate FOREIGN KEY constraint?
I am wondering why Postgres allows to insert a non-existing values for a foreign key to a nullable multicolumn unique constraint. (Cannot be an actual primary key.)
I made a fiddle. I expected this to ...
0
votes
0
answers
30
views
Location Hierarchy representing production rooms or first-class entity?
I'm struggling to figure out the best way to model Production Rooms in our manufacturing ERP app. Currently, we have a Locations model which is a hierarchical, materialized-path (Ancestry Gem) ...
2
votes
2
answers
166
views
Evaluating File Data from FILESTREAM-Enabled vs. Non-FILESTREAM-Enabled Columns in a Single Table
Originally, I was working with .NET 9 and a Blazor web app for admin and a Flutter app for external end-user, but for this context, I constrained it to SQL Server 2017, to evaluate it first internally....
-1
votes
1
answer
53
views
Can the NKTg Law analogy help in modeling database performance under variable data loads?
I recently came across the NKTg Law on Varying Inertia in physics, which describes an object’s movement tendency based on its position (x), velocity (v), and mass (m), with m allowed to change over ...
0
votes
1
answer
114
views
What type of database should I use for this application?
I am currently designing a mobile application that sends push notifications to users subscribed to a set of topics. The list of possible topics changes infrequently (not more than once per year), ...
0
votes
1
answer
116
views
Database Design for a Furniture Store E-commerce Site
I'm building my first web project: a modular furniture e-commerce platform using Next.js and PostgreSQL.
I’ve designed a normalized relational schema to handle:
Categories and subcategories
Furniture ...
1
vote
3
answers
234
views
Changing SQL Server Database Owner to SA Broke Application Login – Why Did It Happen and How Can We Prevent It?
We're in the process of aligning with SQL Server security best practices and recently initiated a project to change database ownership from individual domain logins to the SA account across our ...
0
votes
1
answer
65
views
how to purposefully mismatch database entries?
I've got my standard MariaDB database with phpMyAdmin.
I'm working with OpenSSL and php. And I've got nothing more than a basic rented web-server.
$cipher_algo = 'aes-128-cbc';
$key = '...
2
votes
1
answer
232
views
Have multiple users for your DB per action?
I installed my mariaDB and phpMyAdmin. I created a new user with all the Grand and Super priveleges. And I deleted the "root" user for savety.
Perfect.
As I follow an article: make a ...
3
votes
2
answers
163
views
Database structure and storage for highly interconnected different data
I am trying to figure out the best way to structure and handle highly interconnected data of various types used for analytics and inference (of new data from old data).
There would be one-to-one, many-...
1
vote
1
answer
78
views
Is this ER diagram using crow's foot correct?
Im having some trouble to check if my ER diagram using crow's foot is right.
I have a exercise asking for this:
TAB_Pessoa = { cpf (PK), nome, data_nascimento, sexo }
TAB_Aluno = { matricula (PK), ...
-1
votes
1
answer
95
views
What are the best practices of a banking relational database? [closed]
I don't have any particular problem in mind, I am just looking for the best practices.
I am creating a bank database. Nothing too important or involving real money, nevertheless, I think it would be ...
1
vote
1
answer
54
views
Database Design for Managing Main and Custom Scope Entities
I have a database consisting of a main scopes table (containing standard scopes), a projects table, and a configuration table linking scopes to projects. I now need to allow for custom scopes that are ...
-1
votes
1
answer
67
views
Best Database for Bulk Reads and Fast Key Lookups for Genomic Data [closed]
I'm developing a system to store and query genomic data using a relational database (PostgreSQL being my primary candidate).
The dataset is quite large around 9 billion records with over 300 columns, ...
1
vote
0
answers
56
views
Database Design advice
I am currently creating an application to manage customers, employees, invoices and appointments.
But I am not sure if my design is an overkill and it could be simpler.
Functional requirements:
-) A ...
0
votes
3
answers
546
views
How to Insert 150,000 Rows in SQL Server Efficiently? (Error: Max 1000 Row Limit)
I am working with a large dataset of 150,000 rows that needs to be inserted into a SQL Server table. However, I am encountering the following error when trying to insert all values at once using a ...
0
votes
2
answers
105
views
MSSQL Server Mirroring One Master Two Slave Architecture
Is there is any procedure to do MSSQL Mirroring with single master and multiple slave.
two slave X one master
Or this one.
One Master X One Slave for Viewing only
I need a MS SQL server for viewing ...
2
votes
3
answers
118
views
Best database design for a dress up game?
I am making a dress up game using Postgres as the database. A player can optionally wear a hat, pants, glasses, shirt, and shoes. I currently have a player table and it has columns like name, ...
0
votes
0
answers
51
views
Conceptual data modelling inheritance notation
I am drawing the conceptual data model between vehicle, car and motorbike. As far as I know.
Hierarchy. The simple "is a" feature.
Disjunction means that each ocurrence of superentity ...
0
votes
0
answers
50
views
Is there database design pattern that calls for the auxiliary table to store sequence numbers and how else can be applied?
I have table:
blocks:
id integer not null primary key,
ref_date date not null,
seq_no integer not null,
lk_document integer not null
there can be multiple records for each lk_document and all those ...
0
votes
0
answers
37
views
Database model for blood tests project
I’m developing a medical app (learning purpose) where users can store and manage blood test results, medications, doctor appointments, and medical documents. I’ve designed a PostgreSQL database schema,...
0
votes
0
answers
42
views
Best Approach for Detecting Changes in Master Data Before Updating
We have a database where:
Master tables store reference data that rarely changes.
Append-Only tables store transactional data, always inserting new records without updates. These tables reference ...
1
vote
0
answers
59
views
What "concept" means in the definition of an entity
One definition of "entity" in the Wikipedia page for entity-relationship model as follows:
An entity is a thing that exists either physically or logically. An entity may be a physical ...
0
votes
0
answers
79
views
How to design a parent-child relationship with a child priority AND a way to execute some code when the first child changes?
My situation is very similar to this question, with a twist.
I use Postgres 15.3 and I have two tables:
parents with an id
children with an id, a parent_id, and some other columns
(my real use-case ...
0
votes
0
answers
41
views
Database schema for different types of posts - SQL SERVER
I'm designing a database for a platform where users can post different types of content.
Database Engine: SQL Server
The system includes:
Proposals
Experiences
Events
##Current Schema Design##
...
0
votes
0
answers
39
views
Advice needed for VIEWS with some core columns and extra fields
I am looking for advice about designing VIEWs when a variable number of columns is needed.
Context
The tables are consolidated into views. For instance office_rents and office_electricity_bills are ...
0
votes
2
answers
119
views
Best Approach for Storing Recipe Version History in an OLTP Relational database [closed]
I am designing an OLTP system with a relational database in PostgreSQL/SQL Server to store dyeing recipe data. I need to implement versioning for recipes while keeping queries efficient for ...
0
votes
1
answer
52
views
Why "What people acted in a movie?" is a valid use case for testing the Movie graph data model?
I'm taking the course on graph data modeling in Neo4j Academy (the link is here for reference). And often in the course, I see the use cases phrased like a question such as:
What people acted in a ...
0
votes
0
answers
72
views
How do you create a table that can have x number of possible things joining into it?
The problem
I have a system that I'm building where I need to allow users to track time to any number of various other systems.
For example, I have a concept called a Project, a project can contain 0 ...
0
votes
0
answers
65
views
Db2 - Enable specific admin function(s) for generic, non-admin users
In Db2 (v11.5, 12, LUW) - what is the best way to grant/enable specific administrative functions with required permissions for applications?
E.g. a client/server application wants to make dynamic ...
0
votes
0
answers
71
views
How should I store information about who did what, where, and to whom or to what?
I’m trying to get some practice with database creation and maintenance and a project I’ve come up with is a database for road accidents.
I quickly found an example which has a part of the ...
0
votes
1
answer
97
views
SQL Server: How to implement 3-way relationship with cascades
This is the schema I'm working with:
Here's the DBML to recreate in https://dbdiagram.io/d:
Table University {
ID integer [primary key]
}
Table Professor {
ID integer [primary key]
...
0
votes
1
answer
136
views
Is that table in BCNF?
In the book I am currently reading this table is mentioned as an example for what we can do if a table fulfills BCNF but has still redundancies. It then mentions that a solution are arrays. But is ...
0
votes
0
answers
58
views
How to isolate postgres roles with only a single login role in the entire database?
I'm building a server application where any number of "modules" are created over time, that can reference each other in the form of foreign keys or reads. They can't write to each other, and ...
0
votes
1
answer
70
views
How do I design a 4th form normalized table that needs to reference one of many hierarchical, referential parent tables?
I’m working on a database design where I have three tables (Tables A, B and C) with hierarchical relationships, and I need to model references from a fourth table (Table D) to one of three other ...
0
votes
0
answers
30
views
Help with Creating an ERD and Logical Data Model for a Medical Management Application
A social security organization wishes to develop an application to manage patients, their attending a generalist, and specialist doctors. A person is either a beneficiary or a doctor; a doctor can ...
0
votes
3
answers
145
views
Is having a single table with about 46 columns all related to the same entity a good idea or breaking it into 3 tables better?
Let's start by explaining the entity that I'm thinking of breaking it into three tables and how the UI form is organized, and data entry is happening. There is a Person who has many properties, and ...
-1
votes
2
answers
141
views
Normalization of Grocery Shop Database: From 1NF to 3NF
In a grocery shop, customers buy items, and the products have categories. The TotalQuantity represents the stock of products.
1NF:
OrderProduct (OrderID, OrderDate, OrderTime, CustomerID, CustomerName,...
0
votes
1
answer
38
views
Efficient way to update comment like statuses after user login in a React application
I’m building a blog application in React where each blog displays a list of comments. Each comment includes:
Like count (total number of likes for the comment)
Like status (whether the currently ...
0
votes
0
answers
27
views
Is it recommended to store common combinations of lookup table IDs is a separate table that is then referenced by a T2 SCD versioning table?
Using the basis of a type 2 slowly changing dimension table I've put together this simplistic example of sports match with stats:
Match_Key
Match_Id
Stat_1
Stat_2
Stat_3
Effective_Date
Current_Flag
1
...
0
votes
1
answer
44
views
How to design properly a membership history accross multiple groups?
I'm looking to design an application (Python with sqlite) which deals with some contributors moving across several groups through time.
My design looks currently like (PK in bold weight, FK in italic, ...
-2
votes
2
answers
95
views
Should I break a large user table into smaller tables for specific roles and information?
I am designing a database for a system that has a users table. Currently, the table has around 50 columns, which include:
Personal information (e.g., name, email, phone_number, address, etc.)
Work-...
1
vote
2
answers
87
views
Database architecture with extension in mind
Exposition
Let's say our system has users and some games. Let's call these games A, B and C.
For simplicity's sake, our initial tables look like this:
CREATE TABLE IF NOT EXISTS users (
id SERIAL ...