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.

0
votes
4answers
5k views

In-memory data collection object(s) vs database

I have a couple of questions about the practicality of developing a WPF application that loads data into memory from a text file and then manipulates the resulting object(s) instead of transactions ...
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 ...
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 ...
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....
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
2answers
556 views

Socket Connection Data Insert

I have been working through a high-performance application where I have identified a bottleneck. The bottleneck is actually when the application must insert messages from a socket, it will record them ...
3
votes
1answer
266 views

Read Only Generic data access layer Best practice

I am trying to write some art of "generic" data access library to access the data of my company's ERP Software, which is our main/core application where all our related data is managed. I am a ...
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 (...
17
votes
7answers
23k views

Ways to have a history of changes of database entries

What are ways to allow the versioning of database entries (data)? Think of the content-managment-systems abilities to revert back changes of articles. What are their pros/cons?
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 ...
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 ...
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
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 ...
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
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 ...
5
votes
1answer
105 views

Transactional requests and failure recovery in database systems

Let's say we deal with a quite naive, simple version of a database, which uses the classic version of redo-undo logs for failure recovery. For a "classic" request transferring an amount from one ...
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 ...
1
vote
2answers
187 views

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

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 ...
-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 ...
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 ...
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 ...
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 | |---------------|--------------|---------|--...
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 ...
-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
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
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
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 ...
8
votes
1answer
2k views

Making API calls with celery

I'm designing a system for a client where the requirements are: they upload a JSON file (one object/line) make a call to an API with the JSON object as the payload record the state (success/failure) ...
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 ...
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 ...
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 ...
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
5answers
271 views

How to create a db schema for “if this then… elseif … elseif …” and so on?

I want to create an app where a user will go through a series of steps every day. All the subsequent step will depend on the previous ones, that is, 2 users can have different experiences depending on ...
0
votes
1answer
103 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 ...
2
votes
1answer
167 views

Designing database job monitoring

I have several Oracle database where my in-house applications are running. Those applications use both dba_jobs and dba_scheduler_jobs. I want to write monitoring function: check_my_jobs which will ...
22
votes
6answers
18k views

At what size of data does it become beneficial to move from SQL to NoSQL?

As a relational database programmer (most of the time), I read articles about how relational databases don't scale, and NoSQL solutions such as MongoDB do. As most of the databases I have developed ...
-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 ...
0
votes
2answers
103 views

Architecture of data logging and storage system

I've gotten myself a bit more roped into coming up with the design and architecture for a new system due to some departures and looking for some insights. The system has a bunch of different high ...