Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.

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.

Filter by
Sorted by
Tagged with
1 vote
1 answer
123 views

I’m implementing the authentication module in a modular monolith built with NestJS. Initial Draft In the first draft, the User entity included the hashed password, refresh token, and refresh token ...
captncrunch's user avatar
0 votes
1 answer
158 views

I have an excel macro that imports daily share price files, and finds the highest price for a share after a given date. Each of these daily stock price files has ~1000 rows of data. Currently I have ...
Frankie139's user avatar
0 votes
2 answers
154 views

I am trying to create a notification system similar to Instagram, for the lack of better comparasion. The Goal: Getting user notifications in a unify way, for easy unparsing and displaying to user. ...
eliezra236's user avatar
1 vote
2 answers
353 views

One-to-one relationships occasionally evolve into one-to-many relationships. Once that happens, your team has a tricky job of refactoring the datastore, the backend to allow that change. For example, ...
Sergey Zolotarev's user avatar
3 votes
2 answers
154 views

Suppose I have (micro)services: The following is simplified a lot, you may assume they're significant enough to be a micro. Reseller Service - Our code is turned into whitelabel software. This is the ...
Martijn's user avatar
  • 757
5 votes
3 answers
433 views

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 ...
Observable Stone's user avatar
0 votes
1 answer
164 views

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 ...
Accollativo's user avatar
1 vote
1 answer
241 views

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&...
brahmana's user avatar
  • 154
0 votes
1 answer
166 views

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 ...
Meitaiyang's user avatar
3 votes
3 answers
312 views

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 ...
Hannes's user avatar
  • 39
21 votes
5 answers
4k views

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 ...
Biowav's user avatar
  • 321
2 votes
2 answers
464 views

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 ...
Jack1221's user avatar
2 votes
3 answers
414 views

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-...
JayDev95's user avatar
  • 131
1 vote
3 answers
296 views

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 ...
Samuel E.'s user avatar
  • 233
6 votes
9 answers
950 views

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 ...
Antti_M's user avatar
  • 179
2 votes
1 answer
1k views

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 (...
Brendon's user avatar
  • 29
17 votes
8 answers
4k views

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&...
Sergey Zolotarev's user avatar
0 votes
1 answer
130 views

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 ...
Otterup's user avatar
0 votes
1 answer
119 views

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 ...
Kyle Richards's user avatar
1 vote
2 answers
168 views

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 ...
P. Hopkinson's user avatar
1 vote
1 answer
140 views

Edit: writing a more specific question, as per comment, I guess my question boils down to: are dynamic properties designs appropriate for applications with rich UI and complex business logic (as ...
andre_ss6's user avatar
  • 113
16 votes
6 answers
5k views

I am trying to convince a colleague that their proposed approach to storing a "fee" is problematic. The "fee" can be either a percentage rate, e.g. 50%, which is stored in the ...
Peaceful James's user avatar
0 votes
1 answer
101 views

If I have three entities (end-user, country, tier) in my system that has relationships as follows: Where each country has its own tiers with specified points per year, and each end-user has a country ...
siba36's user avatar
  • 109
0 votes
0 answers
83 views

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 ...
Jocko's user avatar
  • 11
1 vote
2 answers
356 views

I've got a site (here) that lets users publish labs. I'm looking at adding a feature where users can customise the order that their labs appear in. To be clear, I mean that they can manually control ...
paj28's user avatar
  • 1,675
1 vote
2 answers
129 views

I'm writing a game server. Similar to the Sims. Players can own furniture items they purchase from the catalog. There can also be rooms. Players can be in a room. A room can have furniture items of ...
VoiD HD's user avatar
  • 159
2 votes
1 answer
308 views

I have a web application that contains products and users. There are 10,000+ products and 100,000+ users to give a sense of the scale that's required. For some application specific reasons, I need to ...
kitkat's user avatar
  • 29
2 votes
1 answer
429 views

I am developing a diagramming application and want to optimize operations with the Nodes and Relations of the diagram. Currently, I am using a relational database with tables for diagrams and nodes. ...
Maksim Murza's user avatar
2 votes
1 answer
915 views

I am working on developing a MySQL database schema for a restaurant menu system inspired by platforms like DoorDash, UberEats, and Yelp. My aim is to design a schema that is flexible and can handle ...
tony's user avatar
  • 145
0 votes
2 answers
349 views

I ask this to learn from experienced DB designers/architects. I need a high-level overview, I'm not interested in the specific tools for now. Rather, I'd like opinions on how you would approach this ...
terauser's user avatar
-1 votes
1 answer
76 views

I am building a User Service. User would be able to register with emailId or phone no. Upon successful registration, they can choose a username (which should be unique) It is easy to do on SQL ...
best wishes's user avatar
-1 votes
2 answers
266 views

I'm building a PHP application to manage business operating hours, including cases where the closing time extends past midnight. I'm considering various ways to store these hours in MySQL and need ...
tony's user avatar
  • 145
-1 votes
1 answer
749 views

I am working on a project. I have designed the codebase all the way from the scratch. Basic thing is the project is divided in individual modules. The modules represent one complete part of a business ...
Muhammad Waqar's user avatar
0 votes
1 answer
79 views

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 ...
Jack's user avatar
  • 109
0 votes
1 answer
61 views

I'm making a vpn service that can be controlled through admin web page. So I have a web page that consists of front-end page and a backend API + DB. In this admin web page, I can execute a vpn binary ...
Guest-01's user avatar
  • 121
0 votes
0 answers
289 views

I would like to be able to build up a log of user activities, capturing data such as who they were, where they logged in from, what activity did they take, and what data did they change (both before ...
David Keaveny's user avatar
3 votes
1 answer
249 views

I was currently developing a PoC of a "core banking system" in my current company, a pawn shop that generally offers lending services to retail customer and deposit services. We've built a ...
jeremy__'s user avatar
0 votes
1 answer
1k views

I'm seeking clarification regarding the usage of timestamp without time zone in a database and its corresponding Java type, LocalDateTime. The current setup I'm working on involves servers and (...
user avatar
0 votes
1 answer
134 views

I need to decide about my database architecture. The app provides files for download. I can add a counter to every file and track total events. But the client may want some analysis and ask for the ...
kelin's user avatar
  • 153
-2 votes
1 answer
115 views

I am working for a medium-sized development and construction company and we are looking to upgrade our data and BI. Currently, all project data is managed via Excel (data, project management, and ...
Robert Eldridge's user avatar
1 vote
1 answer
176 views

We are finishing up a long (over 1 year) project to retire our monolith. We have been moving pieces of functionality into microservices guided by domain driven design. So far we have been leaving the ...
sceaj's user avatar
  • 324
-1 votes
2 answers
692 views

I'm building a reddit clone on top of software that must incorporate a legacy neo4j graph database to track user actions. I also want to use it to store the comment/post data. Assuming this new app is ...
Austin Capobianco's user avatar
1 vote
1 answer
805 views

I'm looking for advice on how to design the data model for a project I'm working on. I'm not really sure where to ask such a question. I've been using StackOverflow for years, but this problem is a ...
Shaggydog's user avatar
  • 111
-2 votes
2 answers
271 views

I am working on digitizing old photographs, articles, ephemera, etc. related to my town's history, and I've been tasked to put these scans I've made onto a website for the public to see. There are ...
EdmundF's user avatar
  • 13
12 votes
5 answers
8k views

I maintain a large legacy app working with SQL database. The app uses raw SQL queries to query the database. Together with app rewrite I plan to introduce ORM to work with the database. The simplest ...
user14967413's user avatar
1 vote
2 answers
1k views

Let’s say I have a booking microservice (single instance) with its own DB. If I want to horizontally scale the service with multiple instances(exact same copy of the business logic code) running on ...
dig_123's user avatar
  • 147
2 votes
3 answers
944 views

I use MariaDB to store data using EAV model. I need EAV, because each attribute of each entity can have its own validity (validFrom, validTo). For example, I have entity person and I track changes ...
user14967413's user avatar
2 votes
2 answers
286 views

I have a system where Client(C) sends request to Server(S0). S0 then sends the response back to Client that "request received" and closes the connection. C can regularly poll S0 to check on ...
sam's user avatar
  • 33
3 votes
2 answers
227 views

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 ...
SirCodeALot's user avatar
15 votes
4 answers
5k views

Lets say I have students and classes which are 2 entities. A student can take many classes and a class can have many students. This would be a many to many relationship. To solve this with an RDBMS my ...
Jeremy Fisher's user avatar

1
2 3 4 5
27