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.

107 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
5 votes
0 answers
522 views

Graph Database, Storing Transactions

I'm working on getting a handle on Graph Databases (using Neo4j) and am trying to wrap my head around where "the line" is between what makes a good fit for GraphDBs and what should be strictly RDBMSs. ...
jleach's user avatar
  • 2,682
4 votes
0 answers
57 views

Designing provisioning strategies

I'm trying to redesign a provisioning application that administrates other application through their REST API. The application is quite simple, we have groups, we have users and roles and we have a ...
José 's user avatar
  • 41
4 votes
0 answers
2k views

NoSQL data modelling for multi level nested documents

What kind of NoSql data modelling is best suitable for the following requirement? This can be visualised (NoSQL-Document) as a Collection of Records where each Record contains nested Documents.The ...
KDR's user avatar
  • 153
4 votes
0 answers
549 views

Expiring counters in Cassandra

So I know that TTL is not available for counters because of design reasons and I've read https://issues.apache.org/jira/browse/CASSANDRA-2103 as well as some other SO questions regarding this but ...
Mikael's user avatar
  • 141
4 votes
0 answers
532 views

What's the canonical way to store translations of user data?

I've developed some software that allows my users to attach a blurb to some non-language specific information: Pseudocode model: item(): ID creationdate byline //Only one byline for the object ...
Carlos's user avatar
  • 874
4 votes
1 answer
1k views

How should I store usernames and passwords for user login using php/cassandra?

I am new to NOSQL and Cassandra. I am not sure if I should store usernames and password in Cassandra. If I should, what is the best way to do that? I am getting lots of conflicting ideas from research....
Nick's user avatar
  • 49
3 votes
0 answers
43 views

How Best To Store Data Structures Around Flow

I'm working on building a simulator for HVAC units. The conceptual model I am working with is basically that an HVAC unit has inputs and outputs, and I need to be able to calculate the outputs for a ...
Marshall Tigerus's user avatar
3 votes
0 answers
1k views

Designing a database for storing external API results

I have hard time wrapping my head around and finding a solution on how to design a working database structure for this situation: We have a system that should collect data from Google Analytics & ...
tommica's user avatar
  • 31
3 votes
0 answers
248 views

Saving tabular, spreadsheet-like data in a relational database?

I'm hoping this question isn't too broad or too prone to opinionated answers, since I could really use some pointers. I'm trying to come up with a way to persist tabular, spreadsheet-like1, data in a ...
Decent Dabbler's user avatar
3 votes
0 answers
535 views

PHP Vertical Columns from 3 SQL Tables

I work at a high needs school in which there are several classes that plan their work through Excel spread sheets grading and tracking student progress. We have come to the conclusion that this ...
Dane Alexander James's user avatar
3 votes
2 answers
962 views

Best way to structure many-to-one allocation of users to projects in NoSQL

I apologise if this is a bit of a stupid or broad question, but I'd like some general feedback please! Say I have this DB structure for users (in Mongo/JS, but really it's all pseudocode- and the IDs ...
Matt Fletcher's user avatar
3 votes
0 answers
337 views

Best approach for displaying a price from a product according the "setup"? [Designing the DB table and relations]

I'm basically building a reseller website, in which people can buy (users) from a predefined product list and sell them at a higher price (clients). I will show you some images to explain better ...
Jose A's user avatar
  • 295
3 votes
0 answers
777 views

Redmine - Database Structure/Normalization

I am using redmine for project management and issue tracking. I was looking at the database tables and the underlying structure and was wondering if anyone who is experienced with database ...
agent provocateur's user avatar
3 votes
1 answer
165 views

Database consistency for a distributed system

I'm working on a phone call monitoring project. The aim is to have one row in the calls table for each ongoing call. Each call instance may be updated by many different servers/threads as more ...
widavies's user avatar
  • 141
2 votes
0 answers
38 views

Populating form options in dynamic web form

I am looking for advice on database design for a web app I am building. In the web app (Angular, REST API, Oracle SQL database), I am constructing a web form dynamically. I chose dynamic form ...
SilentStorm's user avatar
2 votes
0 answers
32 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 ...
Lance's user avatar
  • 2,587
2 votes
1 answer
446 views

Design question on synchronization of two asynchronous data streams

I have two async streams suppose- Trip : {tripId, date, city} Bill : {billId, tripId, date, amount}. I need to design a system to get real time aggregated view of following nature: City, TripCount, ...
Himanshu Verma's user avatar
2 votes
0 answers
39 views

DataBase design generated by hibernate Many to Many for MariaDB

Hi I am in middle of designing DB and Got a little bit confused about DB Design. I am Using Hibernate as ORM Tool ahd mapping between Page and Step entity in hibernate. @ManyToMany(fetch = FetchType....
ThinkTank's user avatar
  • 121
2 votes
0 answers
392 views

Logging Database Changes

What is the proper way of storing a changelog, similar to git, for data in a database. Currently, I have it set up so that every line in a table is given a unique string id that is used to determine ...
Aux's user avatar
  • 129
1 vote
0 answers
29 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
0 answers
115 views

Efficient way to implement hierarchical inheritance in SQL?

I am working in a database that has a hierarchy of Companies (From location-level all the way up to Top-level parent company). I am designing a system within that to provide a "subscription" ...
user2563087's user avatar
1 vote
0 answers
101 views

Backend Design: System requires both ElasticSearch and MySQL. In which scenario we fetch data from MySQL or ElasticSearch?

So, one of the backend system, having 5 resource types (tables) and some foreign keys as well, requires full text support for two of the tables. Also, for some use-cases, we require inner-joins for ...
Bugs Buggy's user avatar
1 vote
0 answers
374 views

Design MySQL database to store user workout data for Workout App

I am building a fitness app and I'm trying to figure out the optimal way to store the data is a MySQL database. I would like to have specific programs (for example, 'get jacked'), I would like a users ...
adherb's user avatar
  • 121
1 vote
0 answers
110 views

How to handle storing of arbitrary data in an application enablement platform

I'm working on an AEP in the IoT space, where we've created a few domain-specific entities to allow users to model their data. Each entity has both a type and instances of that entity. These are: ...
awr's user avatar
  • 259
1 vote
0 answers
44 views

Looking for the right design (pattern?) for my webapp and external APIs intgerations

I'm working on a simple CRM (Customer Relationship Management) webapp (Flask and Peewee ORM) and I found myself in a situation where I believe that I should have used a design pattern that I may not ...
Pathong's user avatar
  • 11
1 vote
0 answers
163 views

Near Real-Time Data Aggregation using Complex Queries

We are working on a multi-tenant SaaS product that has a ledger of all tenant customer transactions, which we use to track invoice states on a line-item level. This particular application will result ...
André Haupt's user avatar
1 vote
0 answers
40 views

Best way to store webshop item data as a snapshot when an order is created

I'm designing the architecture of my application and I'm running into an issue. For the webshop every Order entity has a relationship with a Store and many StoreItem's. This allows for quick fetching ...
Pim Hakkert's user avatar
1 vote
0 answers
308 views

Providing guest users with full accounts vs only sessions (a.k.a. guest checkout)

I'm working on a web application with JWT authentication (with token stored in cookie) and an SQL database. Upon loading, the frontend makes a request to the backend to determine whether the user is ...
Kris's user avatar
  • 111
1 vote
0 answers
199 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 ...
shiafisher's user avatar
1 vote
0 answers
166 views

How to separate user data in database models?

I am writing a web service for research and learning purposes and try to find an approach to separate user data from other users to ensure a request can never deliver or reveal data from another user. ...
Daniel Stephens's user avatar
1 vote
0 answers
53 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 ...
Saryu Labs's user avatar
1 vote
0 answers
374 views

How to minimize errors between teams working on a shared code base

Imagine there are two solutions that each have their model, and data layer separately, and are developed separately on different git repositories, but they both are using the same database. Now, team ...
Ali Bordbar's user avatar
1 vote
0 answers
105 views

Practice for modeling class - multiple container relationship

I have a class that could: Have multiple types of containers Have multiple types of implementations and what I did to model so far is: public interface ChildClass { Container getContainer(); ...
Hasan Can Saral's user avatar
1 vote
0 answers
135 views

How to store relational data belonging to different client customers?

My users will be businesses with a small number of accounts each: e.g. Business #1 with 3 users, Business #2 with 5 users, etc. I am trying to determine the best way to organise the relation (on ...
lionbigcat's user avatar
1 vote
0 answers
417 views

Strategies for dealing with Stale data and Fetching

I'm working with firestore and have encountered several situations where a document will contain stale data which is a duplicate of the source of truth located elsewhere in the database. For ...
rt_'s user avatar
  • 161
1 vote
0 answers
507 views

Polling Postgres DB architecture

We are using Spring Integration DB polling which polls a table every second and executes some logic based on result. My questions are: What are some good practices we can implement to account for DB ...
Anton Kim's user avatar
  • 111
1 vote
0 answers
44 views

Which is suitable fragmentation style for Distributed DBMS architecture with Micro-service oriented application?

I am new to Distributed DB design. In my current application ,I am having multiple functionalities which shares the some common tables from DB. All these functionalities will be build in spring, ...
user avatar
1 vote
0 answers
99 views

Design a "family relationship" in MongoDB

I have a members collection in MongoDB database where each document looks like this: { "_id" : "8801", "name" : "John Doe" } I need to store family relationships between members. That ...
Héctor's user avatar
  • 727
1 vote
0 answers
62 views

Using fixtures to maintain static database assets

I have a pattern that's something like this: Create a database model UsagePlan which stores how many usage tokens a paid customer receives in exchange for its respective monthly fee. Through my ORM (...
Julien's user avatar
  • 119
1 vote
0 answers
764 views

DB design for a scheduling system

I am currently designing a system to support our employee staffing process. I collect weekly preferences from employees, and feed that into a system for staffing. Availabilities can be defined as ...
user2283268's user avatar
1 vote
0 answers
111 views

Is a topological sort required here?

Say you are writing an ORM like entity framework. You write basic POCO, and then let entity framework do the job of creating equivalent structures in the database according to those objects. This ...
deostroll's user avatar
  • 379
1 vote
0 answers
41 views

Database Constraint from another table column

Let's consider the following objects : Article which can be of different types Equipment which point to an Article, some fields on equipment are only used for some types. I want to add constraint ...
Walfrat's user avatar
  • 3,486
1 vote
0 answers
96 views

Hierarchical data structure: pull requests + pull request reviews + pull request review comments

GitHub has: pull requests pull request reviews pull request review comments BitBucket has only: pull requests pull request comments So there are three kinds of objects. I write code ...
porton's user avatar
  • 762
1 vote
0 answers
46 views

Creating a new table referencing older one vs just creating a column

I'me developing an iOS chat application and working on the db design for the contacts feature. There are 2 kinds of contacts- Unsaved Contacts - Contacts with who you've conversed with, but not saved ...
user1968919's user avatar
1 vote
0 answers
33 views

Offsetting high usage in a multi-tenant database environment?

I'm writing a research essay over distributed cloud-based systems, and one of the topics that I'm trying to touch on is potential solutions to high database utilization in a single-database multi-...
JD Davis's user avatar
  • 1,367
1 vote
0 answers
240 views

Data Store Design for NxN Data Aggregation

I am trying to come up with a theoretical solution to an NxN problem for data aggregation and storage. As an example I have a huge amount of data that comes in via a stream. The stream sends the data ...
gimg1's user avatar
  • 111
1 vote
0 answers
904 views

the right way to generate my Django model/db_table

I went through the Django tutorial with in mind to go through it again using it to set up my small app. So now I am making a simple app where users can search a large set of strings and get a subset ...
naftalimich's user avatar
1 vote
0 answers
68 views

Database data Bucketing Report Design

Here's the scenario: I have item x (item_id, customer_number, cost) which can be submitted to another system multiple times over months which may or may not reject item x before finally accepting it ...
Reimius's user avatar
  • 111
1 vote
0 answers
97 views

Extending database model of ORM in subproject

I have a maven project which contains some entities which are stored in a database. The purpose of this project is to manage personal information, users, locations, etc. This project can work on its ...
Jimmy T.'s user avatar
  • 111
1 vote
0 answers
40 views

how to reduce or stop duplication of relation's entry in treeview

I want to create tree-view for display or show family member's relation. For this I created 3 tables i.e following. familyDetails->[f_id,fname,lname] relations -> [r_id,relation] .....//e.g ...
Kreya's user avatar
  • 111