Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [database]

This tag is for general database questions; if you question is specific to SQL use that tag instead.

0
votes
2answers
67 views

How to scale horizontally a microservice that holds a database

Imagine a 'User' microservice that holds all user's related logic, and this microservice holds a database. How could you scale this microservice horizontally and keep consistency ? In fact, if you ...
-2
votes
0answers
23 views

MongoDB optimization and search performance [on hold]

I looking for the best way (performance of search document) to store data in MongoDB. Some background: The database contains only one type of documents - is information about transactions in many ...
1
vote
3answers
42 views

Proper Connection Pool Use

I'm confused as to how to properly interact with my Postgres database throughout the typical user experience on my web app. I'm seeking clarification on the most efficient method of communicating with ...
0
votes
1answer
58 views

Multiple sessions accessing localhost database

I do not how to ask the question, but I am confused by how to manage sessions when the server is at local host. Accessing the database direct Without a middleware (REST), sessions are created as ...
3
votes
2answers
64 views

Approach for storing lots of data of unknown type in database

I have an web app to which external applications can be connected to send their data. This is for telemetry purposes. The web app is not controlling what kind of telemetry data is sent to it - it can ...
1
vote
1answer
32 views

Using UNIQUE (col1, col2) or using a composite primary key for a relation table in SQLite/SQL?

i’m working on a project where i’m using SQLite and where i have a few relation tables looking similar to this one: CREATE TABLE tag_entry_relation ( id INTEGER PRIMARY KEY, tag_id INTEGER REFERENCES ...
1
vote
2answers
51 views

Index / Unique on `deleted_at` column?

We have an Accounts table in a Postgres DB that has a unique index on user_id and product. Users can have many accounts, there's no product table. Occasionally users will create an account ...
1
vote
0answers
13 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 ...
2
votes
2answers
75 views

Aggregation of data from two Microservices

I have two Microservices A and B. B Microservice has a large set of an entity called User. Microservice A stores the User entity in its own DB if User is configured by an agent.There is no flag ...
0
votes
0answers
9 views

Running a local instance of ElasticSearch on a REST API - is this feasible?

So, I'm looking at elastic search api, and the way you interact with it is, you excecute the ES binaries and make http requests on localhost (to insert, delete, whatever). Eg: curl -XPOST https://...
1
vote
1answer
63 views

A table for each field type or one all-in-one table model?

I am creating an application where users can create forms with many fields of text, numeric, date and select types. The model will have a forms table referenced by responses table; It also have the ...
-1
votes
0answers
8 views

Dynamic Report Builder tool: Correct way to show referenced fields

I'm designing a dynamic report builder tool to our project. The user follows the steps below: User picks fields he wants in the report User choose field order User choose columns totals/groups ...
1
vote
1answer
23 views

how simulate sequential consumers in Kafka

I have kafka consumer that get data from kafka and do some process if some circumstances meet and send it for another consumer to do it's job. How can i build something like this? One way I think ...
2
votes
0answers
20 views

Data durability guarantees in Kafka

Is it wise to use kafka as the 'source of truth' for mission critical data? The setup is: kafka is the underlying source-of-truth for the data. -querying is done on caches (I.e. Redis, ktables) ...
88
votes
9answers
15k views

Is it ever okay to use lists in a relational database?

I've been trying to design a database to go with a project concept and ran into what seems like a hotly debated issue. I've read a few articles and some Stack Overflow answers that state it's ...
5
votes
0answers
214 views

Concurrent fault-safe data structure

I am building an application that aims to process ~10M data items per second. Each item is exactly 42 bytes small (including a sorting key) which means the total data rate will not be big 420 MB/s. ...
1
vote
1answer
36 views

Client (app-server) vs DB generated unique ID's

I've been reading on instagram's approach to generate unique identifiers. Besides remaining content I'd like to understand on of the points their making as a con of client-generated (by client I mean ...
-3
votes
1answer
33 views

Defer insert data into a database

I need to insert some records into a database at a time when it normally it's not being used, what are some approaches I can take? I have considered using the SQL Server Agent to run some stored ...
0
votes
1answer
34 views

Implementing and storing virtual user credits on an e-commerce website

On my e-store I wish to allow customers to buy store credit, which could later be used to purchase items from the store. The vision is that the customer would send some actual money to my account via ...
2
votes
1answer
52 views

How to model rdbms relationships as graph relationships?

I am modeling our existing database in transition to a graph database. Currently here is how I can interpret the database a graph relationships group -have-> groups group -have-> participants ...
1
vote
3answers
248 views

Single database query with in-code iteration vs Multiple database queries

Say there is a single database table containing information about two different types of animals: land animals and sea animals. I want to create two lists of animals, one list for each type of animal....
0
votes
1answer
109 views

Where should a database API live?

Just read this article: https://microservices.io/patterns/data/database-per-service.html We are designing 2 microservices - both have tables in a shared db. What I'm wondering is if I build an API ...
-2
votes
1answer
29 views

Connecting android app(android studio) to myphpadmin database(already on the server)

I have a website for admin and a mobile app for normal user. Both of them share a same database which is now on the cloud(The website for admin is already deployed with the database on the server). ...
1
vote
0answers
33 views

Single users database for many apps

I'm designing a database that holds the information for users of three diferentes apps that share the access to the data trough an API. For every user i'm storing credentials, profile and roles. What ...
0
votes
2answers
84 views

Lookup code tables in DDD

I'm curious on the best way to handle lookup-type codes that can be shared across bounded contexts. For instance, state codes, or business-specific type codes that might be used in more than one ...
-2
votes
2answers
35 views

database/orm model design for contacts

I am building a internal crm which has contacts which are just people with first name, last name, email, phone etc. Contacts can be one or more types e.t.c. job candidates, hiring managers, customers, ...
1
vote
1answer
45 views

Best way to model pricelist per customer for products in webshop

I am making a b2b-webshop system that will have multiple customers. Each customer will have a separate active pricelist which contains the products that they can buy and the prices that applies for ...
1
vote
3answers
145 views

Who guarantees the data integrity of a denormalized table, me or the DBMS?

In the following database, School_has_Student is a denormalized table : Now if I decided to change the "paul" student name to "john" in the Student table, then the "paul" student name that exist ...
1
vote
4answers
157 views

When denormalizing a database, do I need to keep the parent tables?

Say I have the following ER diagram: To implement the above ER diagram as a normalized database, I would create a School table, and a Student table, and a School_has_Student table (that only contains ...
1
vote
1answer
77 views

How do I normalize a database to decrease duplicate entries?

I am designing a database system + application that deals with pipe objects who are part of a larger grid network. There are about 1000-5000 pipes for each network. Let's assume each pipe can have 2 ...
-1
votes
1answer
42 views

Databse model: Entity that can have values from two different tables or user input values

I'm modeling a database, where I have a table called "appointments" (citas in spanish, but I would translate the tables's names for better understanding) where the user can create an appointment to ...
-1
votes
3answers
102 views

DB architecture for managing items of different categories

I'm making a rental app which has many categories with unique properties Example: Category 1 Car which has Fuel, model, color, speed Category 2 Apartment which has Rooms, lift, ...
0
votes
2answers
127 views

Should a SVG be converted to JSON to be stored in the database?

Consider an application where you can create and edit a SVG file (e.g. draw.io). How should the SVG be stored in the database? With SVG (image/svg+xml) Thus no further processing is required before ...
0
votes
1answer
44 views

Descriptive short term for a field that has been set to read-only in anticipation of removal?

I'm currently writing a design to add the possibility to mark a field or attribute for an entity as read-only in preparation for imminent removal. The idea is that, once the field has been thus marked ...
0
votes
2answers
59 views

How to allow arbitrary database connections based on users selections?

I'm writing an application which would allow users to access the databases over the network. Currently the user enters database details in a form which are later used to establish a JDBC connection. ...
1
vote
1answer
83 views

How to set nullable/optional property of database object to NULL in backend?

We are building API which mainly passes database objects back and forth between user and database, so the main flow of information is quite basic: Table (view) <-- ORM --> C#/Java/etc. Objects &...
7
votes
4answers
464 views

If a microservice architecture needs a separate database per microservice then it's too costly & unmanageable. Why do we even need it?

I read about microservices and it seems illogical to me to create a separate DB per service just to achieve isolation. I can achieve the same using only web services and a single database. Why do we ...
1
vote
2answers
161 views

Best practice on how can I change the structure of a live database without losing data inside

Suppose I have a live website running on a live database and I have a dev website that is a duplicate of the live website. The live database is where customer transactions are stored. Suppose I do ...
0
votes
0answers
35 views

Time series database for low-resolution data

Does it make sense using a time series database, such as opentsdb, for very low-resolution data (hourly, daily) or I should rather use a relational/NoSQL database engine instead? It's quite possible ...
2
votes
3answers
91 views

Should I merge database migrations together before release?

During the development process many migrations may appear. Is there any point to keep them instead of merging them all together? Let's take a look into a simple example. During development we ...
1
vote
0answers
36 views

separate table for one of the type or java enum?

I want to make budget tracking web-app, tracking all savings and expenses with corresponding dates. Later generating reports, summaries etc.. I came up this design Frequency Table - does it have to ...
1
vote
0answers
54 views

How can I offload customer's data needs onto the customer?

I write code for an Engineering application where engineers keep giving me various specs in a form of tabular data - for example, a table with product model names and many various parameters for each ...
3
votes
3answers
126 views

Data storage for small application using XML

I am developing a small application as a hobbyist. This application will track costs (eg. purchases and sales, ...) for a single person company. Only string, date, double, integer, and decimal types ...
3
votes
3answers
407 views

One Database for Multiple Applications?

Has anyone worked in an environment where multiple in-house applications are all under one database with each application given its own schema within that single database? I don't just mean a few ...
2
votes
1answer
71 views

Development database with real data

In our team, we currently all develop on our local environment, with a local database, that regularly fetches data from the production database. However, as our production database grows, it's ...
5
votes
3answers
438 views

How to handle foreign key constraints when migrating from monolith to microservices?

My team is migrating from a monolithic ASP.NET application to .NET Core and Kubernetes. The code changes seem to be going as well as can be expected but where my team is encountering a lot of discord ...
3
votes
4answers
129 views

DB Enumerations vs App Enumerations vs Lookup tables

We started a project recently, and during the design process, we have some arguments among team members. We have to deal with enumerations so we ended up with three choices. Have the enumerations as ...
0
votes
2answers
67 views

Proper way to manage database for distributed backend architecture

My application backend consists of a bunch of standalone tasks linked together by messaging queues. They all need to access the same SQL database in order to run and store their results. Right now, ...
1
vote
0answers
35 views

Java dashboard for machine data

I am currently working on a project for a production facility. The machines in the production are saving so called 'Telemetry Data', measurements like water pressure, plastic volume or temperature ...
1
vote
2answers
92 views

Should application double check if data was acted upon?

Assuming the context of a CRUD: After performing a database DELETE, should an application's deletion method check if the records were actually removed from the database? If so, how valid is it for ...