Skip to main content

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.

0 votes
2 answers
215 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
407 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
100 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
198 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
400 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.8k
0 votes
0 answers
44 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
179 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
6 votes
1 answer
5k 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
  • 161
0 votes
3 answers
102 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
70 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
357 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
356 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
481 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
4k 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

15 30 50 per page
1 2
3
4 5
89