Questions tagged [relational-database]
A relational database is a digital database based on the relational model of data. This model organizes data into one or more tables (or "relations") of columns and rows
393 questions
-2
votes
2
answers
152
views
Preventing duplicate customers from company entry vs mobile sign-in [closed]
We have a system where customers can be created in two ways:
By a company — the customer belongs to that company and the company can edit their information.
By a mobile user — the customer has a ...
2
votes
3
answers
418
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-...
17
votes
8
answers
4k
views
How do we distinguish between "not filled in" and "unknown" in our data store?
In our domain model "not filled in" and "unknown" are two different concepts. For example, time of death may be missing or, on the other hand, may be filled in as "unknown&...
-1
votes
2
answers
194
views
Should uniqueness validation be on the database level or backend codebase level in data import
There is a kinda ETL task of importing data from csv to the database in project with legacy codebase and legacy database**. Data should be validated before persisting to database.
Validation includes ...
0
votes
0
answers
83
views
How to restructure a schema in order to support conditional (one of two tables) relations
I've been stuck on this for a while now so I decided to ask for some help.
My SetTemplate needs to EITHER be connected directly to exerciseTemplate OR connected to exerciseTemplate through a ...
3
votes
1
answer
610
views
Object-oriented programming design with relational database tables
I want to understand what is considered best-practice to better align with OOP when handling relational databases. I cannot find any online examples where classes and a more maintainable/re-usable ...
0
votes
1
answer
79
views
Database Modeling for Application with Many Integrations
I’m working on an application that requires many 3rd-party integrations. I’m using Postgres to store these API responses but am having trouble for a number of reasons.
These objects are frequently ...
3
votes
2
answers
227
views
how to deal with schema/constraint changes in insert-only Relational DBs?
as per request, I'll reduce this whole set of questions to 1-2 core points (thanks for the feedback ;)).
I'm considering using insert-only tables for keeping the history of my data. while the ...
1
vote
2
answers
65
views
Table referential integrity varying according to application logic
I've come across a scenario where data in one table is related to another table but referential integrity doesn't seem to apply as I would usually expect. This is because table x uses data from ...
0
votes
3
answers
155
views
Optimizing writes over the same entity in relational DB
I am developing a micro service that saves votes to a relational database. I have a use case with an entity that represents an aggregation of votes. I receive events from voters saying that they vote ...
1
vote
3
answers
719
views
How is double-spending technically prevented in traditional banking? [closed]
In contrast to bitcoin:
How is double-spending technically prevented in traditional banking? Do database transactions have to conform to the ACID property in order to prevent double-spending?
0
votes
0
answers
56
views
How to handle multi-region writes for a joint user registration?
UserA and UserB are signing up for some joint service together. They both have to independently agree to T&Cs before sign-up is complete. Once complete they both receive an email to sign-in.
A 1 ...
1
vote
0
answers
154
views
Efficient way to implement hierarchical inheritance in SQL?
I am working in a database that has a hierarchy of Companies (From location-level all the way up to Top-level parent company). I am designing a system within that to provide a "subscription" ...
2
votes
1
answer
875
views
Foreign key vs string
I have to create a table to map some strings that are my input, to the result value that is a value that I can choose, like an id (or string).
So, to make an example, I have an excel file made of a ...
0
votes
1
answer
142
views
I need to choose records from a database to feed to a model for training, but would like to weigh records beforehand. What's a good strategy for this?
I am currently responsible for feeding data to an STT model. My backend is written in Python/Django and is primarily responsible for managing a Postgress database. The database has a table that saves ...
1
vote
1
answer
496
views
How to represent NoSQL entities
I've mainly studied SQL structures, and I know that the representation of the entities can look something like this:
However, I'm building this app with MongoDB, so NoSQL DB. I'm aware that MongoDB ...
0
votes
1
answer
524
views
Database design for a reccomendation system
I am working on a project which will have a recommendation system and I am in the database design phase, I have a good foundation in programming but databases is a new topic for me, I have designed a ...
-3
votes
1
answer
150
views
Where should linking tables be stored? [closed]
I have a system where properties can be stored, and linked with multiple other entities (each with their own schema). Let's say that Documents can be linked with Users and Assets. What is the best ...
1
vote
3
answers
2k
views
Storing count of child rows in parent table
I have two tables, parent and child. Parents can "have" multiple children—in our case they are related through a third table, parent_child_mapping rather than the child storing its parent id ...
1
vote
1
answer
262
views
Database Design, Associative Entities
I'm learning databases and I'm designing an ERD based on simple banking processes. I'm not sure if my design of the entity relationship diagram is correct.
Thought Process
A customer can open 1 : N ...
1
vote
0
answers
156
views
How to handle storing of arbitrary data in an application enablement platform
I'm working on an AEP in the IoT space, where we've created a few domain-specific entities to allow users to model their data. Each entity has both a type and instances of that entity. These are:
...
2
votes
3
answers
1k
views
Enforce correspondence between enum and lookup table
I have seen a common design pattern where there will be a "lookup table" in the database like this:
Color
ColorId
ColorName
1
Blue
2
Red
3
Green
with a foreign key constraint on other tables,...
-1
votes
1
answer
106
views
CRDTs and merge conflicts in DB design
I face this problem with software development quite often, but I don't really know the name of this issue. It sounds quite common, though.
Two nodes (a computer and a mobile phone, for example) share ...
-1
votes
2
answers
216
views
Is it normal and good practice to enlarge the amount of columns when adding new features
There is a table named is A with 40+ columns, among which around 10 are columns of hierarchical levels, in a data analysis platform maintenance and development ( legacy ) project. Due to development ...
-2
votes
2
answers
232
views
Avoid redundant field using JSON type in MySQL [closed]
I have experienc with designing relational dbs but first time attempting to store JSON in a mysql table. I am using mysql 5.7.8 which has the ability to store json data type as a column.
When I create ...