Stack Exchange Network

Stack Exchange network consists of 175 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.

2
votes
1answer
70 views

Auto incrementing from two different points on the same table?

Each customer has an ID. For every new customer it's incremented by 1. My company is wanting to start selling to a new type of customer (lets call it customer B), and have their ID start at 30k on ...
4
votes
4answers
132 views

Splitting application into multiple but keeping database same

I have a medium scale e-commerce application. Over a period of time our monolithic project got quite heavy in terms of code base. I was exploring the solutions for it and found micro-services is one ...
0
votes
2answers
57 views

What is the best method to avoid company data duplication in mixed B2C and B2B product in account creation?

I'm building a user license portal, store, SSO, and mini CRM and admin for internal people to manage those users for a niche 3D software company, similar to Autocad. Licenses are sold to both ...
0
votes
2answers
51 views

Most efficient way to get unique customer count

I'm working on a system that stores details of customer purchases for several stores. One statistic that they would like is to know how many unique customers they have had over a specified day range, ...
-1
votes
1answer
33 views

How should I update back-end data (e.g. follows, likes, etc.) which changes at an inconsistent rate?

(This is a conceptual question but as reference, I'm using Android Studio (Java) and Firebase Firestore...) My app currently has a structure where the user can follow authors and favorite their works....
10
votes
5answers
438 views

Do I really need triggers for relational database, for example, PostgreSQL?

I know that triggers can be used to validate stored data to keep database consistent. However, why not perform validation of data on the application side before storing them into the database? For ...
3
votes
2answers
83 views

How to design a multi-year statistics database?

I'm designing a database for name statistics (how many people where given that name). The data consists of names, and numbers for how many men and women were given that name within a time period (...
0
votes
1answer
31 views

Database design for a survey app

I'm creating a survey app and I don't know how to design database. I need surveys with multiple questions and multiple types of questions. There are 3 ways that I could think of: a) Create a ...
-2
votes
0answers
30 views

What approaches or ways are there to implement a database design which allows users to create new Folders/Files in Folders? [on hold]

So I'm trying to make a website where a user logs in and is able to create Folders and Files inside a Folder and so on. It's pretty much dropbox alike. The Problem is I don't have any Ideas and I ...
1
vote
1answer
51 views

MongoDB: Two documents of separate types that reference each other

I'm writing the back-end for a chat application. The database being used is MongoDB, which uses objects that have their own unique IDs. I've run into a problem; I have two document types, channels ...
-2
votes
1answer
44 views

Designing a facial recognition systems database

First of all, I hope im in the right stack exchange. So I'm trying to build a facial recognition system, e.g. one that recognizes a face and compares it to a database of known faces. For the first ...
-1
votes
0answers
52 views

Choosing between database file storage and file system storage [duplicate]

(repost from https://stackoverflow.com/questions/54590899/choosing-between-database-file-storage-and-file-system-storage) This question might be asked a lot of times, but I couldn't find the solution ...
0
votes
2answers
112 views

Running automation tests in production

Although many people understand that even if we have the same setup for TEST and UAT environments as we have for PROD, there're still a lot of reasons why it makes sense to run smoke tests in ...
1
vote
1answer
65 views

How to safely allow different end users to insert data into a table stored in an Oracle database?

This is a basic question, but I don't have any sense of what other developers do in this scenario. The Situation I am creating an interface to allow end users to insert and update data in a table ...
1
vote
0answers
43 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 ...
-5
votes
0answers
27 views

Help with architecture design for client, server and database application [closed]

I need to design the architecture of a client server application for a company in which there will be a database with information on employees, system users, customers and products. Several employees ...
0
votes
1answer
33 views

In a parent table - Child table relation , where to store order of children

Assume a Parent -> Child relationship in RDBMS. questionnaire table and question table. question table has a foreign key questionnaire_id to store which questionnaire it belongs to. Questionaire ...
-6
votes
0answers
26 views

Real time table for availability of participation at courses

I need the start point for a WordPress procedure. I need a chart which shows in real time informations about the availability of a course. The participant has to see in real time if there are still ...
2
votes
1answer
75 views

Does it make sense to use both Cosmos DB and Elasticsearch?

My app uses Cosmos DB to store data. I have a requirement to support full-text search, which Cosmos does not provide out of the box. One of the recommendations was to use Elasticsearch, and I have ...
0
votes
0answers
37 views

Migrating a messaging service to end-to-end encryption

If I have a web app for messaging that started as non-end-to-end encrypted and I want to migrate that same service to be e2ee, how might I deal with old messages? If I'm using something like the ...
1
vote
1answer
45 views

How/when to normalize during ETL?

Let's say you're loading a denormalized flat file of purchase transactions that looks like this: | location_name | location_zip | product | product_price | |---------------|--------------|---------|--...
3
votes
6answers
200 views

Should I use entity framework for CRUD and let the database handle the complexity that comes with high end queries?

I am new to ef and liking it since it reduces the overhead of writing common queries by replacing it with simple add, remove functions. Agreed. Today I got into the argument with my colleague who has ...
10
votes
5answers
764 views

If passwords are stored hashed, how would a computer know that your password is similar to the last one if you try resetting your password?

If passwords are stored hashed, how would a computer know that your password is similar to the last one if you try resetting your password? Wouldn't the two passwords be totally different since one is ...
0
votes
1answer
59 views

Benefits of placing error logs in a database by itself

I am working on a project where logs of all kinds (e.g. errors, warnings, etc.) are stored in a database table, in the same transactional database used for the other business purposes. It is a MSSQL ...
0
votes
1answer
57 views

What to do with the unused identity after deleting a row?

Straight to the point, I have a user table that has 4 rows with id = 1, 2, 3, 4. I delete the row with id = 2 and insert another user and the user will get id = 5. What will happen to the id = 2? Will ...
1
vote
2answers
209 views

Should I use ISO country code for primary key, or integer ID?

I have or am going to have a database with countries and their emissions. Countries in the API have a 3-letter ISO Code. Should I use this for identifying the countries in database, or just a plain ...
-1
votes
1answer
60 views

Patterns for loading related objects in memory (without an ORM)

I am using ADO.NET to read a bunch of data from the database into in-memory objects. This is my domain model: // Question.cs public class Question { public int ID { get; set; } public ...
2
votes
2answers
108 views

How to structure database for daily events?

I'm storing data which logs whether or not a user has logged their attendance for a given day. Some days are unimportant (holiday, weekend), so those are also stored. The two requirements are that: ...
-1
votes
1answer
64 views

Combine Ids to a single field

I would like to ask if there is any powerful method we can use to combine the Id's to a single field for faster search and retrieval. My case is like this, I have a table that stores ID's of ...
-3
votes
2answers
237 views

Database Schema for a multiplayer quiz game

I'm trying to accomplish this scenario : There are 2 types of users, let's say Admin and Worker, and there have different roles. Admin can do a CRUD of questions, and also can create a room where ...
1
vote
1answer
43 views

Ruby on Rails: primary SQL db and secondary No-SQL db without models

I have in mind to develop a Ruby on Rails app with two different databases. In the primary SQL db - let's say MySQL, for instance - I'd keep my app items, e.g. user profiling, user-user interactions ...
1
vote
1answer
45 views

What is a good way to add extra info to data-entries from a website front-end?

I want users to be able to dynamically add 'columns' from the front-end of the website. I understand that it is probably not best practice to actually add columns to a table from the front-end, so I ...
0
votes
1answer
47 views

Using sql triggers over higher level scripts

I recently came across a set of possibilities for creating rows in a table in my database. the scenario is that I am trying to populate a notifications table by different types of notifications data ...
0
votes
1answer
61 views

Best way to encode a queryable number to another unique queryable number? (database outsourcing)

So lets say you want to outsource your database to a third party and be able to query on it on their server but you want to "encode" the salary column of the users on their server, aka hide the real ...
2
votes
4answers
131 views

Testing database insertion, removal, and modification from program code (i.e., rather than test code)

I want to ensure that my program code is correctly inserting, removing, and modifying data in my database. Full integration testing can be slow, and I have concerns about keeping mock objects and data ...
-1
votes
1answer
36 views

TEXT column as key for a table when there are other tables referencing that table?

I have a UNIQUE TEXT column (“name”) in SQLite for one of my tables (let’s call it “table A”) and i’m considering using that column as the key for the table The reason i can see for continue using a ...
-1
votes
2answers
78 views

How to append a chunk of fixed size data to a file and make sure this chunk doesn't get fragmented on disk?

So i want to understand how DBMS implementation works To give an example : MySQL implements each tables with its own pages, which are 16KB so each table is a file, and is a multiple of 16KB, ...
0
votes
2answers
134 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 ...
1
vote
3answers
70 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
64 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
70 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
41 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 ...
2
votes
2answers
61 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 ...
2
votes
0answers
23 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 ...
3
votes
3answers
179 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. A Microservice stores the User entity in its own DB if User is configured by an agent. There is no flag ...
1
vote
1answer
66 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
vote
1answer
25 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
48 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
16k 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
240 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. ...