Skip to main content
Filter by
Sorted by
Tagged with
Best practices
0 votes
3 replies
39 views

What is feedback on the normalisation of my ER diagram which I designed for my school project for a service to match users based on their preferences? The ERD is supposed to show no transitive ...
1million_ naira's user avatar
Best practices
0 votes
2 replies
36 views

I'm playing around with Postgres 18 temporal keys. At the moment, I have this schema: CREATE EXTENSION btree_gist; CREATE TABLE customer ( id integer NOT NULL, valid_at daterange ...
Philippe's user avatar
  • 307
Best practices
0 votes
4 replies
38 views

I am designing a database schema in PostgreSQL for a notification system. I have several distinct "parent" entities that can trigger a notification log: order invoice shipment ...
Darryl Soh Soon Yong's user avatar
Advice
2 votes
3 replies
57 views

I am creating a database with temporal validity using date ranges in PostgreSQL 18.1. I want to place constraints which force the date ranges to be non-overlapping and adjacent (= there are no gaps). ...
Philippe's user avatar
  • 307
Best practices
1 vote
4 replies
54 views

I am designing a mobile application with a user login system. I am going to implement refresh tokens in order to allow for users to only have to log in once every 30 days. How do I differentiate each ...
Calax's user avatar
  • 91
Best practices
0 votes
6 replies
70 views

Table event records an instance of an event. Some events are repeating and should be referenced as a batch. I do not want to create a separate table as event_batch or something like this, as I just ...
Walker Farrow's user avatar
Best practices
1 vote
3 replies
42 views

Should resume skills be stored as JSON, BLOB, or normalized tables for analytics and search performance? I'm building a resume analyzer that extracts skills and stores them for analytics. Currently ...
jaysingh's user avatar
Advice
0 votes
6 replies
91 views

I am a software developer and I’m starting to learn System Design and Pattern Recognition concepts. I want to understand: how to approach system design problems step by step. what fundamentals I ...
Nikhil Dsont narayan's user avatar
Advice
0 votes
2 replies
61 views

I am building a time series database in C++. Changes to record sets are restricted to appends. This is not a production system, rather for learning. The motivation and purpose for a WAL (write-ahead ...
Jabir's user avatar
  • 1
1 vote
1 answer
89 views

Some part of a post has translations: CREATE TABLE "posts" ( "id" int4 NOT NULL, "title" varchar, PRIMARY KEY ("id") ); CREATE TABLE "...
Arman P.'s user avatar
  • 4,424
Best practices
0 votes
4 replies
52 views

We're building a SaaS platform for which we need to design a data model which could accompany domain specific data. We don't know the structure of domain specific data. So these are the evaluated ...
gokul656's user avatar
  • 323
Best practices
0 votes
5 replies
167 views

How do I design a scalable user badges system without creating many boolean columns? I'm building a badge system where users earn specific badges by completing certain tasks. Schema::create('...
ThePlayerRolo's user avatar
Advice
0 votes
3 replies
46 views

My case study project inventory system tracks stock and updates stock after every sale of a FMCG (Fast-moving consumer goods) business. Since it is FMCG, they get stock by consignment and the database ...
Imran Haziq Bin Khairul Anuar's user avatar
Best practices
0 votes
2 replies
130 views

I’m designing a domain model where some entities evolve over time, and I need to keep a historical record of their state that can be retrieved later. A simplified example: A Credit Line represents a ...
MABC's user avatar
  • 615
Best practices
0 votes
5 replies
105 views

I'm developing a desktop application for gym management. One feature is a store for selling memberships and products. My client sometimes wants to sell something that is not in the inventory or ...
kitt51's user avatar
  • 10
Best practices
1 vote
1 replies
106 views

Our team manages a SQL Server 2019 data warehouse that’s grown to over 10 TB. It currently uses a single database with multiple schemas (clinical, financial, hr, operations, staging, etc.). Our DBA is ...
Raja's user avatar
  • 68
Best practices
3 votes
1 replies
121 views

I am creating an E-Commerce app. It has Category and Product classes. Both have multilingual descriptions, so, tables with title, description, meta-*, etc. and unique key (id, language_id). To add ...
qarabala's user avatar
  • 178
-1 votes
1 answer
69 views

I’ve been working on a React/Firebase app for the past 10 months, and things have been smooth so far. Recently, I decided to do some refactoring. I switched from using user-generated fields as unique ...
Emi Buliga's user avatar
3 votes
1 answer
153 views

I have two tables in Postgres with a parent/child relationship: CREATE TABLE table_a ( id SERIAL PRIMARY KEY, type TEXT NOT NULL, rundate DATE NOT NULL ); CREATE TABLE table_b ( id ...
AcrKnight's user avatar
  • 496
1 vote
2 answers
71 views

We have entities Teacher and Student; there are two relationships between them, supervision and teaching: Supervision is one-to-many, but teaching is many-to-many, which is a problem. To fix it, I ...
Sim's user avatar
  • 19
0 votes
1 answer
86 views

I have these tables in my PostgreSQL database: CREATE TABLE companies ( id INT PRIMARY KEY, name VARCHAR(255) NOT NULL UNIQUE ); -- Employees belong to one company CREATE TABLE employees ( ...
Rohit Menon's user avatar
-1 votes
1 answer
127 views

I have a table Languages: ID | ISO639 | NAME ---+--------+--------- 1 | EN | English 2 | DE | Deutsch 3 | TR | Türkçe (etc.) I have another table Headlines: ID | EN | DE | ...
rhavin's user avatar
  • 1,804
0 votes
2 answers
165 views

I want to create a database for my blog website where I have many posts and categories. A post can have many categories and a category can have many posts. I couldn't figure out how to implement it in ...
Hau Khua Lian's user avatar
-1 votes
1 answer
85 views

Why isn't it possible to add a column to a partition? From my point of view, the partitioning feature introduced in PostgreSQL is much more useful than table inheritance. Table inheritance shoots at ...
rela589n's user avatar
  • 1,224
0 votes
1 answer
62 views

I have an application that represents user-defined data in two views: A hierarchical view (parent-child nodes) A flat view (a table where all attributes are listed in a row) In PostgreSQL it handles ...
Oskan's user avatar
  • 21
-1 votes
1 answer
104 views

Table1 has roughly 50k rows, like this: Id Name Dob Device 1 Bill 09/30/1987 bira1 2 Kayle 06/12/1967 kale2 3 Gill 05/23/1976 bira1 4 Kane 01/30/1963 bira3 5 Hena 02/12/1978 kale1 Table2 has 200 rows: ...
HaiY's user avatar
  • 207
0 votes
0 answers
37 views

I'm designing a time-series application using GridDB Cloud to store sensor data from IoT devices. Each device sends temperature and humidity readings every 10 seconds. device_id (string) temperature (...
nazia ghous's user avatar
0 votes
1 answer
104 views

I would like to save objects like this to a local database. The object is a dictionary with various entries. For instance, the first entries are like: "id": "https://openalex.org/...
robertspierre's user avatar
0 votes
1 answer
67 views

I have an entity "MyEntity" which has some fields - "StartDate", "EndDate", "Color". It can have multiple records, and each record is sometimes updated. I need ...
user2957592's user avatar
-1 votes
2 answers
176 views

I am designing a database for a music player. I am already using SQLite to store music tracks in a table called tracks, containing a unique id. I need to add very standard playlist functionality: ...
goose_lake's user avatar
  • 1,657
0 votes
1 answer
104 views

I'm working on a SAAS product where we have a multi-tenant data model with multiple fields that are specific to tenants. I am using Kafka as a message queue and PostgreSQL as datastore. The way I ...
Farhaan Shaik's user avatar
0 votes
0 answers
194 views

I have a Trino that reads Parquet (which was converted from JSON) and wants to insert that data into a PostgreSQL database. When defining the Trino schema and creating a table, it is ok. But after ...
Prof.Plague's user avatar
-1 votes
1 answer
91 views

I'm trying to figure out how to balance security, performance, and best practices in the validation process of the data of a REST API and its interaction with the database. Say you have a book table ...
Observable Stone's user avatar
3 votes
3 answers
112 views

UserID First Middle Last Type CreatedAt 123 John Henry Doe Mage 03-28-2025 Let's say I have the following table above. I would like to create index to help speed up my queries. All queries would like ...
Alan Chen's user avatar
1 vote
0 answers
116 views

I have two transactional systems that is used for the same operational business activity: purchase order transactions. One system is legacy and the other is a new modern one. They have different ...
user121's user avatar
  • 801
0 votes
0 answers
68 views

I'm trying to implement real-time analytics on aggregated blockchain data. My database stores swap events (SwapEvent table) with information about tokens traded, amounts, and USD values. Currently, I'...
cjc02's user avatar
  • 1
0 votes
1 answer
203 views

From the book Fundamentals of Database Systems (7th edition) by Elmasri et al., pages 475-476: A multivalued dependency [MVD] X ↠ Y specified on relation schema R, where X and Y are both subsets of R,...
showkey's user avatar
  • 435
0 votes
1 answer
44 views

The server I developed with golang is divided into two categories when accessing the database. One category is data with redis cache, which is generated very frequently, but inserted into the database ...
progquester's user avatar
  • 1,934
0 votes
2 answers
220 views

I am working with SQL Server 2019 and have a TVF that retrieves products based on a list of categories. However, I noticed that when I use SELECT *, the query results in a table scan, whereas ...
Ron537's user avatar
  • 1,006
0 votes
2 answers
89 views

In our current PostgreSQL DB, primary keys are Ints. However, in almost all of the communications between services another candidate key is used, a GUID. While I am not the original author of the ...
Nour Salman's user avatar
0 votes
0 answers
40 views

I am trying to use sqlalchemy to model a database consisting of two classes A and B. The B class has two fields: B.a (1 to n) and B.alist (n to n). I am trying to follow the Setting Bi-Directional ...
msampaio's user avatar
  • 3,463
1 vote
2 answers
312 views

I've inherited a code base with an associated database schema. The schema has numeric, auto-incrementing primary keys. It does pagination with queries like this: WITH params AS ( SELECT id ...
Tom's user avatar
  • 8,191
1 vote
3 answers
180 views

I use an Oracle sequence of the form: CREATE SEQUENCE MY_SEQUENCE INCREMENT BY 1 START WITH 1000000000 MAXVALUE 9999999999 MINVALUE 1000000001 NOCYCLE CACHE 20 NOORDER; This sequence is used in an ...
Till Glöckner's user avatar
0 votes
1 answer
53 views

I'm using a two-collection approach (userChats and chats) for quickly accessing a user's group chats as opposed to the use of an extremely long participant array of user IDs. However, I am struggling ...
George Assan's user avatar
-1 votes
1 answer
111 views

I’m working on a web application where users can select multiple preferences (e.g., favorite foods, music genres, hobbies, etc.). A user can have many preferences, and I need to store this information ...
Freddy Alexander's user avatar
-1 votes
1 answer
78 views

I'm trying to model the economy of a resource management game. Processes turn one type of resource into another, at varying rates. For example, process A turns 1x item A into 1x item B. That's simple, ...
user1021379's user avatar
1 vote
1 answer
743 views

I am trying to set up a simple but large DuckDB database with a single column of unique values as read from a parquet file. For faster inference of single-point existence checking (WHERE id = test_id),...
Bram Vanroy's user avatar
  • 28.9k
-2 votes
2 answers
79 views

I have two tables: Product Columns: Product ID (PK), Product Name Order Columns: Order ID (PK), Order Name I would like to store which Product Id for each order. Is it better to create another table: ...
developer's user avatar
  • 1,379
-1 votes
1 answer
72 views

In an entity relationship (ER) diagram, is the relationship between Order and Cart considered a weak entity relationship? Because order depends on the cart. I analyzed the relationship between Order ...
Mohammod Shihab Hossain's user avatar
-2 votes
1 answer
81 views

What does the # mean when placed before an attribute in a relational database schema? Umbrella(ID,Lido, Cost, Type) Lido(ID, Name, #Spots, Manager) Manager(FiscalCode, Name, Surname) Client(#Card, ...
Rbn's user avatar
  • 21

1
2 3 4 5
485