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,343 questions
5votes
3answers
346views
When is multiple validation layers of protection necessary?
I'm having a hard time of understanding at what point is multiple layers of validation protection necessary rather than a single point of failure and if the performance hit is a concern Lets say you ...
0votes
1answer
131views
Reorganize data with pattern while migrating from SQL to MongoDB
I have several tables in Oracle, in each of them are stored data about a different kind of tax declaration (house tax, hotel tax, and so on). All of them have some data in common, so I want to migrate ...
0votes
0answers
150views
System design for tracking viewed posts and returning unseen posts
I came across this system design question and have been wondering what is a good approach. Requirement : We have a typical blog or a mini social media kind of website where users create "Posts&...
0votes
1answer
140views
How to Design a Database for Both Flexibility and Data Isolation?
I am designing a system that serves multiple customers, providing data visualization for revenue and membership information. Currently I use a separate schema approach to isolate customer data. Each ...
3votes
3answers
192views
Aligning domain model to data model. Is my data representation wrong?
Engineering Community, I am currently writing my bachelor's thesis on microservices and DDD (this is not the actual topic, but it is part of it). The language I am writing in is Rust, but that is ...
21votes
5answers
4kviews
How manage inventory discrepancies due to measurement errors in warehouse management systems
I'm developing an enterprise-grade warehouse management application for a chemistry laboratory. A critical feature involves mixing multiple stock solutions to create new solutions based on predefined ...
2votes
2answers
272views
Best design pattern to synchronize local and cloud databases?
Right now I have an edge device (resource constrained) which is processing, storing, and querying time series data using a Postgres DB. When a data collection event has ended, a simple script on the ...
2votes
3answers
333views
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-...
1vote
3answers
205views
How to implement an DB index to allow intersection queries on a database which does not support compound keys?
I am creating a DB that indexes JSONs on top of a key value storage engine (LMDB or somewhat similar). When a new JSON needs to be indexed, I will create an entry for each field (AKA, JSON key), for ...
6votes
9answers
679views
If services own their data, how do you deal with relations?
I've been studying different flavors of Service Oriented Architecture (SOA), Event-Driven Architecture (EDA), micro-services and related topics for the past few days. I see it often recommended that ...
2votes
1answer
582views
One and only one vs One in crow's foot notation
Am I using one and only one correctly? I have read so many articles online on differences between one and only one vs one and I'm still confused. I.e. a customer can exist with zero, 1 or many (...
17votes
8answers
4kviews
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&...
0votes
1answer
89views
How to model a bidirectional, one-to-one relationship in DynamoDB?
I'm building a WebSocket API Gateway in AWS. When a device connects, API Gateway assigns the connection a unique connection ID. I need to store the relationship between the connection ID and device ...
0votes
1answer
100views
Database structure for two-step registration flow
I'm trying to design a database for supporting a multi-step registration flow. The registration flow goes like this: the user logs in via OAuth (which creates a session and user), then they're asked ...
1vote
2answers
151views
Why do developers put asymmetric items into a single database table? [closed]
A pattern I've seen several times is: Customer table - CUSTOMER ID, Contact table - CUSTOMER_ID, CONTACT_TYPE, CONTACT_NUMBER, OTHER The use case for the tables is: SELECT Home_Num.CONTACT_NUMBER ...