Questions tagged [database]
This tag is for general database questions. If you question is specific to SQL or NoSQL, use the corresponding tags instead.
2,154 questions
4votes
4answers
257views
how can CQRS improve performence when we have to duplicate the writes
I was reading about CQRS, and from what I understand, it separates reading from writing by using two databases: one for queries (reading) and another for commands (writing). However, I don’t quite get ...
0votes
3answers
142views
Transaction management with one connection
We have a desktop application written in Java that communicates with a DB. We support Oracle and Postgres. For the purpose of this question, let's focus on Postgres Our app uses one connection for all ...
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
271views
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 ...
4votes
7answers
2kviews
Should there be one-to-one relationship between DAOs and tables?
Should there be a one-to-one relationship between DAOs and tables? For example, should only one DAO communicate with a given table? Our data layer is kind of flawed, e.g. we have a MAN table that ...
2votes
0answers
71views
Efficient FIFO Data Storage and Deletion for Sequential Data [closed]
I’m building a device that needs to store data sequentially, retrieve it in chunks using FIFO, and then delete it. My device uses the ESP32-S3, and I'm currently using an SQLite build. However, as the ...
2votes
3answers
99views
Planning Dynamic Patient Charts with Version Control and Historical Accuracy - Temporal Versioning or JSON
I'm working on a project for our healthcare clinic's software and could use some guidance. For regulatory and historical purposes, patient charts need to remain as "static" records—...
6votes
4answers
579views
Why is there (practically) no 6-byte integer in common usage?
In Postgres, it used to be quite common to use a 4-byte integer auto field for primary keys, until it started becomming somewhat common to run into the 2147483647 limit of 4-byte integers. Now, it's ...
2votes
1answer
581views
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&...
6votes
3answers
2kviews
How to handle primary keys and UUIDs in a database
I've heard advice from several people about using UUIDs as ID in your database. For one this has the benefit of making your URLs unguessable. It also masks how many objects you have in the system. e.g....
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 ...
3votes
4answers
731views
How much better is using quad trees than simple relational database for storing location data?
I want to store and find back driver location data in the standard design uber/lyft problem. I was researching about possible system design. Several videos and tutorials usually describe storing ...
-3votes
2answers
171views
How to properly choose between two equivalent implementations, and how to prove you picked the correct one? [closed]
Thinking about non functional requirements (the -ities) and other concerns, which approach would you choose and why? consider the two snippets Direct Supabase Connection import { useState, useEffect } ...
0votes
2answers
91views
Entity/DAO for any combination of values?
You have a nice set of entities but then someone decides to add one or two more stupid values that are used only in one place (or maybe, not so stupid but ones I would rather avoid) Now, you have a ...