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.

1
vote
1answer
337 views

System Design: Chat Application and Polling

What would be the best way to add chat feature to an android, ios, and web app? Is polling really as bad as people say? The requirements are user to user messaging and chat rooms. Here is my thought ...
1
vote
0answers
44 views

Where do I store the record sources for a form's controls?

I'm working on a Windows application that is used for tracking document review and audit information for my company. The back end is a SQL server database and most of the user tasks are basic CRUD ...
4
votes
2answers
942 views

Querying from database inside a loop a bad practice? [duplicate]

First, I'm still learning to do things in the best possible practices. I would like to know what would be a best practice when dealing with database queries. I've seen codes that query inside the loop ...
1
vote
1answer
470 views

How to unit test database queries based on current date?

Is there a feasible way of testing SQL queries that contain things like CURRENT_DATE and NOW() in a unit test? For example: public function deletePastEntries(): bool { $sql = "DELETE FROM queue ...
0
votes
1answer
80 views

Architecture for distributed real time traffic capturing/viewer system

I have a scenario as following (you can think of it as a distributed Wireshark system): For a single capturing session, there are about 1 ~ 10 traffic capturing nodes distributed in a LAN network. ...
3
votes
2answers
168 views

DAL with logic?

Is it normal for a DAL to have actual logic? For example, my Repository implementation is in the DAL layer (IRepository in BLL), if the data it needs isn't in the Local DB, it needs to scrape various ...
3
votes
4answers
254 views

Web Applications REST API: Should the data be structured to meet the UI's requirements on the client or on the server?

For a web app I am working on I have a pretty basic relational database. I access this database through a RESTful API and generate the markup in React once the data is retrieved. If I find myself ...
-1
votes
2answers
571 views

What would be the best database schema for article(categories, tags) API [closed]

We are planning to create REST API which has main objects as User and Article. Article object has following fields Title - one line Description - it can expand to few paragraphs Image - one or ...
7
votes
3answers
401 views

System Design: Very Large CSV Imports Every Month

We have a webapp that will rely on large CSVs from external vendors every month. When I say large, we are looking at around 6gb so a few million rows. Probably, 2-5 CSVs. This webapp will also allow ...
1
vote
1answer
57 views

How to solve double withdrawal attacks on decentralized databases

I need a way to solve double withdrawal attacks in decentralized databases. For example, a banking infrastructure has multiple servers with their own databases, the advantage is that it lets citizens ...
3
votes
1answer
133 views

Database modeling. Many to Many relationships. Link tables

Consider a database table for user info like: id, name, email now consider I have another table for video something like: id, name, description, length Say a many to many relationship exists ...
1
vote
1answer
117 views

Where to put Database monitoring code?

I have a function that gets the statues of my databases and Redis instances to check that they are online: internal static bool IsOnline(ConnectionLocator connectionLocator) { try ...
-3
votes
1answer
950 views

c++ - implimenting an in memory database [closed]

I'm practicing various C++ exercises. In this particular exercise they are asking me to implement an in memory database. I guess they are not asking me to use something like SQLlite. Could anybody ...
1
vote
3answers
856 views

Why is a duplicate database Insert fault not considered a Concurrency Error?

A textbook I am teaching from about ASP.Net using ADO.Net in C# says: Note that concurrency checking isn't necessary here, because a concurrency error can't occur for an insert operation. The ...
0
votes
3answers
745 views

Can traditional SQL databases be fully replaced by NewSQL?

I've recently learnt about "NewSQL" databases like: Google Cloud Spanner (proprietary) Microsoft Azure Cosmos DB (proprietary) CockroachDB (open source) also see How does CockroachDB compare to ...
4
votes
1answer
277 views

Routing all SQL queries through a single micro-service

I currently have a website, made of about 20 micro-services and a (still too large) main monolithic web application. The monolith and multiple micro-services each run queries to the same database, ...
1
vote
1answer
708 views

Storing an id of a shopping cart in a cookie for unauthenticated user

I want to implement the "shopping cart" feature on my website. Both anonymous/unauthenticated and authenticated can have it. While it's clear how to implement it for an authenticated user, it's not ...
2
votes
1answer
131 views

Recommended methodologies for refactoring a large ISAM based DB structure to a RDBMS?

I'm meeting quite a challenge. We have an old grown software with mostly Delphi applications, and an underlying ISAM database server (ADS)1, used with a lot of free tables and manually programmed ...
3
votes
1answer
792 views

Managing Database Access for MicroServices

We currently have a work stream where we are splitting out a Monolith into microservices and there has been a debate as to how we will access and persist data. To give you a good idea of how most of ...
-2
votes
4answers
124 views

One Single Table or Two Smaller Tables

We currently have a Users table in the database, this has quite a few columns in it. Around 50% of the columns are barely used in the system (only on one or two pages). We've been discussing amongst ...
3
votes
3answers
842 views

Is it OK to have a many-to-many relationship where one of the tables involved is already a junction table?

When planning our database, we ended up with a setup like this: We have Company, Product and Person. There is a many-to-many relationship between Company and Product, through a junction table ...
2
votes
1answer
962 views

Enum or reference table when dealing with maps

I am storing information about Widgets in my database, and each Widget has one (non-unique) transformation function associated with it. My problem is how to associate Widgets with their transformation ...
1
vote
2answers
45 views

Simple question about status: CLOSE_MANUAL/CLOSE_AUTO vs CLOSE with boolean flag auto

I'm trying to figure out the best option to mark a database entity that could be closed manually or automatically. This entity already have a status that accepts OPEN or CANCELED. Now, I would like ...
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 ...
2
votes
3answers
166 views

Where to put the attributes of a relationship in a non many-to-many relationship?

Say that I have the following one-to-many relationship: If I don't want to store any information about the relationship, I can simply put the primary key of School as foreign key in the Student table....
3
votes
2answers
987 views

What's a recommended way to design a db schema for multi-language website?

I'm building a website where I plan to support multiple languages. Not only via UI, but via the content too. I have several tables where I have text columns such as "title", "name", "description", ...
0
votes
4answers
1k views

Concurrent database access on shared network drive

I'm part of a small team that currently uses an Access database for scheduling a larger team's availability. This has presented some issues with corruption of the Access database. Additionally, I want ...
-3
votes
1answer
1k views

NoSQL vs SQL for creating an inventory database [closed]

I've been reading a lot of comparisons between NoSQL and SQL. I feel like NoSQL might be the way to go but I'm still uncertain. So here's my example: I want to be create an inventory system. There ...
-4
votes
1answer
63 views

Is PHPmyadmin “SAAS”? [closed]

AFAIU a SAAS software is any software which is runs on a browser and performs a certain service, (aside of giving a way to contact the owner of that software) and is also aimed for reuse, whether if ...
1
vote
1answer
29 views

Imagers for a product in Internet Store — one to many or many to many?

I'm creating a database schema for a internet store and I wonder how to better create the tables "images" and "products". A simpler way will be to have it as one_to_many, that is: images(....., ...
1
vote
2answers
217 views

Dealing with stale data persistence

Currently implemented the model and working on the UI for a scheduling application. This is just an in-house application for work between ~5 people that may occasionally have the application running ...
1
vote
2answers
156 views

Save not-so dynamic data into a database and retrieve with changes in the future

Imagine this use case: I have a class with 50 attributes of which 10 are relationships plus 100 methods which perform calculations and return a value. I need to save that data (including ...
3
votes
1answer
287 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 ...
4
votes
1answer
371 views

Continuous Deployment Database Project VSTS

Looking for continuous deployment strategies regarding SQL server database projects targeting Azure SQL using VSTS. My scenario... Using VSTS for CI/CD Using a SQL Server Database Project to define ...
6
votes
3answers
1k views

Effecient algorithm for data deduplication in procedural code

I have written a data cleansing application which, for the most part, works well. It is not designed to handle large volumes of data: nothing more than about half a million rows. So early on in the ...
20
votes
4answers
3k views

What are the practices you follow to avoid wrong data updates in big databases?

A typical advice before any production deployments is backup the DB first. This way, if the new update has some issue that can lead to potential data loss or logical data corruption, then you still ...
1
vote
0answers
133 views

Location specific caching for read-heavy data (server architecture)

This project will serve many duplicate requests with location-specific answers. I.e. 10,000 people in New York will all get the same server response (a list of businesses in New York), but one person ...
-1
votes
1answer
76 views

How to design classes and db table in right way for recurring Order?

I have requirement like user can booked space (office, room, meeting room etc) for a rent for particular time period. But requirement is like user required to booked space every month 5th date, or ...
2
votes
1answer
85 views

Decouple service complex query building from datastore

We have a very large search service (written in golang if it matters) that runs on top of ElasticSearch, receive requests, builds the correspondent query, and returns the results (with some post-...
14
votes
6answers
3k views

What are the best practices around retiring obsolete database columns? [closed]

I'm designing an application which will in an early stage collect data A, B, and C from clients, but later on will instead collect data A, B, and D. A, B, C, and D are very related and right now ...
12
votes
2answers
346 views

Should I lock rows in my cloud DB while they're being edited by a user

I am creating a desktop application that persists the data in the cloud. One concern I have is a beginning to edit an item in the application and leaving it for a while causing the data to become ...
1
vote
1answer
71 views

Database Schema design of server running status log

I am working with 4 AWS EC2 instances (servers). Each Instance has Instance ID and Instance Name. Instance ID is unique. Each of them having multiple application servers, like on of them is running ...
2
votes
1answer
92 views

Where should my method(s) that connect to DynamoDB go?

I'm a Java developer working on a new module for my app that connects to, inserts, and updates DynamoDB information. For a lot of our projects, I used an MVC design pattern with a service layer to ...
1
vote
3answers
95 views

Architecture - External 3rd Party DB Queries

Our team is tasked with querying an external 3rd Party database to pull information. We don't own the database, so it could change without notice and our queries would stop working. We are currently ...
2
votes
2answers
113 views

Object that can set its own subclass/amend its methods with subclass?

I have a database that stores client data. All data is in one table. For each client, there is one row per day. Clients have different kinds of contracts, their data format remains the same, however, ...
2
votes
0answers
83 views

Idea on replacing DAO/Domain obj pattern

I know someone has probably already thought of this, but here is a way to replace DAOs and Domain objects: For example public class Bike { private int id; public Bike(String model) { //...
4
votes
3answers
300 views

Distributed database algorithm

I have a need for a distributed data store, where existing solutions may not work as the computers these will be running on will be extremely resource limited, for instance 64-128MB RAM. Plus, as a ...
0
votes
1answer
100 views

How to enforce business rules in a hierarchical container structure

So, earlier I asked this question about infinite-depth objects and arrived at using the Composite pattern to model that a freezer contains a rack contains a box and so on and so forth. There's now ...
1
vote
1answer
561 views

Proper modeling and name convention for an intermediate table between intermediates

I have 4 entities: Event, Message, Flow and Document. Event table stores a limited (seeded) number of records. Message has many events and each event can be related to many messages. The name ...
8
votes
2answers
2k views

How to safely run database migrations with multiple app instances?

We have an application that has a mix of both fast (< 1 second) and slow database migrations (> 30 seconds). Right now, we're running database migrations as a part of CI, but then our CI tool has ...