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

What is the schema to specify relationships in a flat-document structure?

I have a question about the best database schema to do this. So, we want our database schema to carry out some generic operation <> involving two units of data, x1 and x2 (e.g. a1). // CURRENT ...
-3
votes
0answers
27 views

how to normalise this case study data? [closed]

Can anyone help me how to normalise this case study data into 1st normal form (1NF), 2nd normal form (2NF) and 3rd normal form (3NF)? For education purpose only so I can enhance new skills.
-2
votes
0answers
44 views

best data format and storage thinking for new app

I'll start with familiar apology for what might be a long-ish question, and possibly for not being the best forum .. but not for lack of looking ... I wonder if I might get an opinion from some clever ...
1
vote
3answers
100 views

Back-end solution for pulling from CSV files

I'm building a data visualization that displays COVID information for the United States, at the city, state, and county level. The ultimate source of truth are three CSVs published by the New York ...
-3
votes
0answers
55 views

How can I design my Spring program so that when a user logs in I can tell if they are a Staff member, student or faculty member?

A little more detail. Like I said I'm building this University Management System and it will have user authentication. It will also user authorization for some parts of the web layer, for example only ...
2
votes
1answer
106 views

What are the pros and cons of adding SQL columns in run time, vs through a different design time architecture?

The company I'm currently working for has a feature in an enterprise app where a user can add columns to a table configuration on a web GUI through fields and a button, and a corresponding SQL table ...
0
votes
0answers
17 views

Scalable database design review

I'm doing some research on how to scale our current SQL database and need some advice with a possible solution. The goal being able to handle more data and doing it in a way that performs well. We ...
2
votes
0answers
20 views

In a multi-region network, how do you organize requests through VPNs for atomic database transaction requirements?

I am trying to setup a multi-region (global) AWS system, where each region (which has multiple availability zones) has its own VPC. In theory these VPCs all use different portions of the private IP ...
1
vote
2answers
158 views

How do atomic updates work at scale?

I am working on a weird ID system where I generate all the IDs in advance and need to atomically pop() one from the database, so no ID is read twice at the same time (and so used more than once). This ...
2
votes
3answers
184 views

Product Codes in ERP: Alphanumeric vs Numeric

Background I'm working through creating a structure for Items in a new ERP (Cloudsuite Industrial) that I'm implementing. For Items (which can be finished goods/products or raw materials), we ...
1
vote
1answer
78 views

How to implement a website with translatable articles?

I am developing a website that is supposed to be in at least two languages. I am a skilled developer, but I never had to deal with internationalization. The owner of the site will create a new article ...
-3
votes
1answer
37 views

Tracking Graph edges changes history

i have a graph and transactions which change the relationship between the graph nodes and i need to keep tracking of this changes over time. Kinde of queries i need to execute: I want to see the ...
0
votes
0answers
27 views

Filtering data from elastic search based on mongodb

I've a list of items in my ElasticSearch. User enters a query and I fetch the results from elastic search. Now, I've a requirement where I don't want to show the user the items which he has already ...
1
vote
0answers
67 views

Should I decouple MySQL database?

I have two sites, one is a subdomain of the other. They both do different things entirely with one unifying goal. My intent is to have the main site do a majority of the heavy lifting, and the ...
-2
votes
0answers
25 views

Social Media App DB design with mongodb

I need to design an instagram like app that will have users, users can follow/unfollow each other. I am using MongoDB for data storage. Currently I have designed two tables, one for user: {userId: <...
2
votes
1answer
97 views

Storing static data idea — is it best practice?

I have a database in which I am storing a bunch of companies that can have several different types of codes associated with them — here is a example of a group of codes I was wondering if storing them ...
2
votes
1answer
47 views

How to store a branching linked list in a database

I am trying to model an HVAC system for simulation purposes, which will consist of a series of components linked together by airflow and electrical flow paths. I'm trying to figure out how to best ...
0
votes
0answers
75 views

How can I implement an invite system between users in an app?

I'm currently making a web app using flutter and firebase. To make this short and sweet, I want users in my app to be able to form groups. The group leader will pick base "settings" for the ...
0
votes
1answer
95 views

How do you name “*_statuses” for multipe tables so that there'll be some pattern in the names of the statuses?

I have the following entities in database that have a corresponding table "entityN_statuses" associated with each of them: * products * refunds * payments * users * etc... The &...
0
votes
1answer
59 views

What kind of Relations should I have in my E/R Diagram

I am trying to create an Entity/Relationship Chen Diagram for a new APP. Scope is simple enough. I will have multiples types of users login through the same Login Form. What I decided to do... Is ...
1
vote
1answer
80 views

When keeping all state in an SQL DB, how to handle one-off variables?

I noticed this pattern in my programs: I'm building a system, like the one I'm building for my local hackerspace right now. It's using database as its "brain" - a scraper as a separate ...
-4
votes
1answer
57 views

Name of design pattern where type and instance classes are mirrored

I have used this design pattern in several entity-component designs. Now I want to introduce it to my team: It concerns a type-of relationship, where the instance structure and the type structure are ...
-2
votes
3answers
113 views

At what point a shopping cart can become deemed abandonded?

Let's take Shopify. They consider a shopping cart abandoned right after a customer has entered their email at the 1st step of checkout. I think it's wrong because a customer might need at least 5-10 ...
2
votes
1answer
71 views

Use one table and a “type” column to represent two types or use separate tables?

I am building a blog system, the blog can have its comment. And like to provide the upvote/downvote feature for both the blog and comment. Since the vote count number of blog/comment should be ...
1
vote
2answers
135 views

How to design a relational data model for music recordings?

In Edgar Codd’s "A Relational Model of Data for Large Shared Data Banks" classic 1970 paper, a procedure for eliminating non-simple domains (domains whose elements are relations) of a ...
-3
votes
1answer
106 views

Best way to store data for machine learning (Database or Files)

I am currently in the process of developing a machine learning application, where my users can upload their own data to train models. Furthermore, the users must be able to extend their uploaded data ...
0
votes
0answers
35 views

How to seperate user data in database models?

I am writing a webservice for research and learning purposes and try to find an approach to seperate user data from other users to ensure a request can never deliver or reveal data from another user. ...
0
votes
2answers
126 views

When placing an order in a shop, should a snapshop be taken of the products in an order also?

...to prevent messing up with data updates, such as prices, titles, of the products that are placed in an order. Namely, a customer buys 3 items: for $5, $10 and $33 and pays for them. All is well. ...
1
vote
7answers
208 views

Academic question about table design

I just had an argument with my professor about surrogate key usage in my project's database design. My professor insisted that a primary key (natural or surrogate) should not ever be exposed, even in ...
0
votes
3answers
118 views

Many different user types in a microservice architecture

I'm trying to design a new microservice architecture that will eventually replace our current two monolithic APIs (we develop a desktop payroll software that uses our API to send payroll documents to ...
-1
votes
2answers
105 views

Splitting large table into multiple tables

Let's say I have a astonishingly big table (300 columns) with lot's of records (in the millions). This table is overly complicated to use. I'd like to refactor this table and split it in multiple ...
-2
votes
1answer
157 views

How to save events in a relational database better support time-based queries on these events

I have a system that subscribes to Kafka topics (i.e. a message bus) that publish life-cycle events. My system needs to digest and save these events and later serve its clients (the users of this ...
-2
votes
1answer
43 views

Using a field, variable, or column for multiple purposes

I am in a situation right now where a solution has been proposed that uses a csv file. The proposed file structure essentially contains three atomic values; ID Thing 1 Thing 2 Fine. As we were ...
0
votes
0answers
47 views

Multi-store E-commerce Database Users Table Design

I am developing multi-store e-commerce platform Restful api. I am stuck at users table design. Platform users has 3 different role thats Admin, Customer and Merchant. Admin user just have a user ...
-2
votes
2answers
126 views

Dependency of program code on specific database values

I have two approaches to solving a problem but I don't know which one is better. I will give a simplified example. First approach The database will look like this: color | -------- FFFFFF | 0000FF ...
0
votes
1answer
57 views

Mapping of time based models to database

Currently I'm developing a movie reservation system for diving into Spring Framework. I'm using Spring Data JPA for database modeling. I have several model classes but I am stuck with time-based logic ...
-2
votes
1answer
46 views

Design a database with multiple relations and tables

I'm struggling to find how to correctly design a database in order to store and retrieve data for my software. Basically, I'm designing an application for a gym (C++, MySQL with PhpMyAdmin): each ...
0
votes
0answers
14 views

Creating group/applicaton/user permissions around mongodb documents

I'm trying to find a good way to manage permissions for a high number of mongo documents. What I want to do: Apply group/user/and or application permissions to mongo documents. Idea 1: Use mysql ...
0
votes
0answers
18 views

Live Streaming Service Schema Design

I'm requesting some feedback on a database we use in a live streaming service. We've Frankensteined this one as we've grown, and I'm looking to make a new one because there are now some obvious pain ...
1
vote
1answer
58 views

SQL Database schema for Catering/Menu management

Background I'm building a Private Chef booking service where you can book a Chef to cook you a custom Menu. I'm having trouble creating a SQL db schema that accurately represents the domain while ...
-2
votes
1answer
31 views

Saving large files like Credit Reports in Data Store - SQL/NoSQL/ObjectStore

I am working on a project to save external credit bureau reports in database. These reports are typically big and could go from 0.5MB to 5.0 MB. Number of files will grow exponentially over the time ...
-2
votes
1answer
51 views

Adding unstructured data to a relational database (PostgreSQL)

I'm building a project and I only know the MERN stack. Everywhere I see the general consensus is that Mongo is not good and should only be used in very specific use cases. More importantly, I also ...
1
vote
1answer
76 views

Should I perform some minor denormalization to save myself several queries in the future?

I'm in charge of designing the entire backend for the REST API of an application that works more or less like an online browser game (think OGAME, Travian, and the likes). In this game, players are ...
-2
votes
1answer
39 views

facebook sharding by user_id or by photo_id?

I'm reading a design suggestion for facebook/instagram social network in grokking the system interview (closed content :( so I'll describe the relevant part in my question). They are speculating over ...
0
votes
1answer
45 views

what extra benefit do I get from a caching layer over the caching layer of the database?

I'm looking at the design of dropbox's edgestore. It manages several thousands of MySql instances, where all dropbox's metadata resides (users, filenames, etc.). I understand why sharding is ...
1
vote
1answer
29 views

Data integrity on polymorphic association to two different table

Let's say I have a very large student list want to filter if each of these students is satisfying some specific classroom school and classroom limitations. So, in my data model, I have School and ...
1
vote
0answers
26 views

Partial database synchronisation across multiple databases

Currently we are looking for a solution to sync databases across multiple locations. We a location hierarchy such as Country -> State -> District -> Center. To increase speed and reliability of the ...
-2
votes
1answer
45 views

What is the best way to store secure static data which can be easily updated by clients?

I'm currently building an education website which contains a lot of content such as questions, videos and notes which all need to be securely locked away and exposed to users with relevant permissions....
1
vote
2answers
83 views

What's the best convention to store “other” option?

Say I have a Person object. I need to ask the user to choose from a list, which laptop they have. They can also choose the option "My product isn't listed here". Now the Person object will look ...
1
vote
1answer
81 views

Moving a module out of monolithic database using microservice patterns - challenges

We have a large monolithic database. As part of a new requirement, I am proposing to move our financial transactional system into a new separate database via microservice-esque services. These ...

1
2 3 4 5
23