Skip to main content
Share Your Experience: Take the 2024 Developer Survey

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
0 votes
0 answers
30 views

Would it be bad to use two different database engines for location history? [closed]

I'm building an analytics and storage platform for entity location history. I'm a bit hung up on the database engine, though. On the one hand a graph database fits really well for the entity ...
gph's user avatar
  • 101
1 vote
1 answer
155 views

Designing a flexible and comprehensive restaurant menu database schema?

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
  • 135
0 votes
2 answers
170 views

Advice for database design and approach

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
0 answers
36 views

How to implement SQL tables for storing "most popular page funnels" on a website?

Suppose there is a website with a bunch of nested URLs representing possible steps in a complex user interaction flow. You can flow through the app like: /a -> /a/x -> /b -> /c -> /c/y -&...
Lance's user avatar
  • 2,611
-1 votes
1 answer
46 views

Ensuring unique indexes on nosql datastores [closed]

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
90 views

Best Practices for Storing Operational Hours Extending Past Midnight in MySQL

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
  • 135
-1 votes
1 answer
108 views

Would it be a good design to have multiple repositories for one entity?

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
0 answers
36 views

Need advice on approaches to saving data

The following code(JSFiddle here) is a grid-based code where I'm performing the following steps: I’m moving blue boxes from left to right (on the grid) after clicking Move Text Content! button. Here ...
Tan's user avatar
  • 151
0 votes
1 answer
56 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 ...
Jack's user avatar
  • 109
0 votes
1 answer
45 views

Where to store config when using a external binary in a web service?

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
68 views

Approach for comprehensive data/activity logging

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
2 votes
1 answer
103 views

Handling Back-dated Transactions and "Online" Transactions on ERP/Banking Systems

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
208 views

Clarification on using timestamp without time zone and LocalDateTime in UTC-centric systems

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
73 views

Better way to track and analyze downloads (or any other events)

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
78 views

What is a route I could take when considering setting up a data warehouse for a small business? [closed]

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
126 views

Monolithic Database to Microservices, but with Radical Data Model Changes

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
  • 304
-1 votes
2 answers
199 views

Should I store large amounts of data in the properties of a node in a graph database?

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
0 votes
1 answer
148 views

Designing a graph database structure for an application with a large amount of connections

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
  • 101
-2 votes
2 answers
168 views

Designing a database schema for a website related to my town's history

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
7k views

Is it an anti-pattern to create ORM entities based on existing database schema?

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
0 votes
2 answers
460 views

How to effectively scale one microservice to multiple instances

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
  • 137
2 votes
3 answers
429 views

Dynamically transform EAV data into standard SQL table

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
234 views

How to design fault-tolerant distributed "all-or-nothing" system?

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

Better solutions than joining table for Many to Many?

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
0 votes
1 answer
197 views

Database design for different type of user comment

I'm designing a database where a user can add notes on diffrent entity of the application. For example, the user can add a note on the project and/or on the project line. The note added can have ...
mp9007's user avatar
  • 59
1 vote
4 answers
329 views

Is it a good practice to allow null FKs?

I have Projects table. Projects can have costs, so I have a Costs table. A cost can be because of a product or beacuse of a service. So I have 4 main tables: Projects (IDProject, Description...) ...
Álvaro García's user avatar
0 votes
2 answers
183 views

When should we separate common parts of multiple services into one separated service

We have some services (consider 10, some of them already exist and some are yet to come). All of these services have a common part where they keep track of what's being changed, and these so-called &...
AminMal's user avatar
  • 101
1 vote
1 answer
356 views

Representing Rust enums in databases

Although I love Rust's enums (and the idea of making illegal states unrepresentable), I'm struggling to represent (ironic, yes) them in databases like PostgreSQL when the variants have data associated ...
yoshke's user avatar
  • 19
0 votes
0 answers
89 views

Data modeling - strategy game - over-normalization?

I am trying to build a travian-like web browser game (static strategy game). I am currently working on my tables and data model. I don't have much experience with relational databases and I am ...
Pierre-Alexandre's user avatar
1 vote
1 answer
194 views

Database design for graph where nodes can be other graphs

How should I design a relational schema to store graph documents that can contain plain nodes (shapes, in the example below) as well as nodes that can reference other graph documents? To visually ...
rink.attendant.6's user avatar
-1 votes
3 answers
395 views

Are there existing term(s) for a 1-1 child-parent table anti-pattern?

NOTE: Please don't respond by telling me that I probably don't understand what I am looking at. You can't possibly know that and it's wrong. Just don't answer if that's all you have to say. I'm ...
JimmyJames's user avatar
  • 27.5k
0 votes
0 answers
42 views

Cascading ACL to embedded objects

We have an object Root, which references many other objects. Which eventually is translated into FKs on the DB level. We came up with an ACL scheme where there's a separate permissions table with the ...
Stanislav Bashkyrtsev's user avatar
1 vote
1 answer
172 views

deciding where to put "formatting" logic - database or in application layer

We have an application that fetches user data from an Azure tenant via MS Graph. We need to distinguish between guests and regular members. Guests come back with Usernames that look like this: ...
dot's user avatar
  • 571
1 vote
1 answer
123 views

Is it s agood idea use as foreign key two fields instead of the primary key?

I have this two tables: Documents(ID, IDTypeOfDocument, BigIntReference); I have a documents table that has and ID that is an autonumeric bigint. Also I have categories, and also it has a big int as ...
Álvaro García's user avatar
5 votes
1 answer
4k views

Best way to store quite large JSON objects?

I'm building an app where I need access to quite large reports about different publicly accessible URLs, JSON objects about 200kb to 500kB in size. Each user would generate hundreds of these reports ...
any_h's user avatar
  • 151
0 votes
3 answers
101 views

How to avoid data corruption with dual parent/child foreign keys

Imagine the following: Persons table: (Id, FirstName, LastName) PersonEmails table: (Id, PersonId, Address) (to allow a person to have multiple emails) Contacts table: (Id, PersonId, UnsubscribeAll) (...
Mr. TA's user avatar
  • 155
0 votes
1 answer
66 views

Secondary indexes vs Using elastic search

When does it make sense to put data in elastic search vs creating secondary indexing on Primary datastore? Elastic search with another primary store Pros: Primary datastore can be optimised for read ...
best wishes's user avatar
1 vote
1 answer
338 views

How can I restore an entity from the database while keeping my entities database-independent?

Background I'm currently working on a project using domain-driven design and Dapper as my ORM. The entities are naturally slightly different than the tables in which they are stored (e.g. _id is ...
JansthcirlU's user avatar
-2 votes
1 answer
314 views

Storing a large number of user permissions [closed]

I am refactoring an old application which has about 200 user permissions. Based on access permissions for the user, menu items for webpages will be Enabled or not. Permissions are also checked on the ...
Daniel Gee's user avatar
-2 votes
1 answer
388 views

Adding new column(s) to DB Table breaks existing queries [closed]

Dilemma: I am working in microservices (MS) architecture for a product with shared (PostgreSQL) DB between MSes and DB Views exposed as Data Access API between SW Components, written and maintained by ...
ALZ's user avatar
  • 107
1 vote
1 answer
3k views

SQL or NoSQL Database for a chat application?

currently I am working on a kind of "Chat" Application. The app consists of "threads". Each of this threads consist of "subthreads" in wich a user can send a message (...
Vito's user avatar
  • 65
0 votes
1 answer
535 views

Exchanging data between two Microservices

I am facing this problem and would like to review my approach to it here. A Client sends an HTTP request to Service A and is expecting an answer. Service A is connected to DB A. When it receives a ...
Solidak's user avatar
  • 157
0 votes
0 answers
140 views

How to design entities to keep up with the depth of JSON objects?

To better context see Rich Authorization Requests for OAuth2 As u can read here there are some common data field types like actions, locations etc. So I have created C# entity for EF as below: public ...
Szyszka947's user avatar
3 votes
2 answers
250 views

Preventing POST requests from being lost when database connection is lost

I am working on a project to stand up a central database to replace a current massive file-sharing/syncing system of physical log files and text configurations for the primary application I work on. ...
Benjamin McKay's user avatar
0 votes
1 answer
87 views

How to design a database wherein multiple tags(string) are to be associated with an id per user?

I have a similar situation to the user here How to design a database wherein multiple tags(string) are to be associated with an id? However I'm designing a system where each association (between ...
AncientSwordRage's user avatar
2 votes
2 answers
317 views

How to store queryable 10-100MB BLOBs?

I have read several discussions about storing BLOBs in the database vs in an object storage. What I need in addition though is a functionality for querying these BLOBs. The BLOBs will be immutable ...
Ivaylo Toskov's user avatar
-2 votes
1 answer
372 views

Ho do I implement Database per Service pattern in Kubernetes?

Assuming I wanted to implement the Database per Service pattern or one of its related patterns like Private-Tables-, Schema- or Database-server-per-service (https://microservices.io/patterns/data/...
user avatar
1 vote
0 answers
30 views

Optimised MongoDB design for access control at project/organisation level

I'm looking for the optimised approach of designing MongoDB database collections where there are three stakeholders- A User (who accesses a portal). An Organization (which can have multiple Projects)....
Shashank Agrawal's user avatar
1 vote
3 answers
227 views

Triggers and network performance

There are many questions and responses on database triggers, however I have not found any that touch on network performance specifically, in the matter of benefits (or otherwise) of triggers. I have ...
Sunil Gupta's user avatar

1
2 3 4 5
27