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.

-3
votes
1answer
190 views

Storing a Database for a JavaFX program

I am currently developing a JavaFx program for a friend's company. I need to store information, so I am using an embedded database (mostly likely derby). Since the database needs to be outside of the ...
0
votes
1answer
97 views

How to make an server side application independent of database

We have a server-side application (in JAVA, communicates via web services) that accesses a database. If we wish to sell just the application to a customer, so that he can use his own choice of ...
4
votes
2answers
201 views

Should I retry a query that failed because of a connection error?

Let's say I want to add a row to a table. I send the query from the client (the website, not the user) to the database which is on another physical server. The query is sent over the network. The ...
2
votes
5answers
2k views

How can a web app work correctly when Internet connection is lost for some hours?

Our team wants to design a Web-Based retail pharmacy management system. A web based solution is good because no user installations are needed. Some of the data fetched from central database are read-...
2
votes
2answers
210 views

How to correctly split a monolith and rely on the same domain

Context I'm developing a Spring Boot java application. Currently it is a monolith with the rest API and the front end (vaadin driven) in the same big project. Although this is very easy to develop ...
0
votes
1answer
208 views

Hexagonal Architecture and database concurrency

I have been reading Alistair Cockburn's article on Hexagonal Architecture. One question that occurs to me, is how to handle situations where there are database concurrency issues. An obvious example ...
1
vote
3answers
116 views

Flat File vs Relational Database for Single User Desktop Application

So I keep track of all my finances using an Excel document (and have been doing this for many years) and it's become quite a pain. So for a fun side-project I want to implement something to handle it ...
2
votes
1answer
121 views

When should desktop app save to database using UoW?

So one thing I didn't really think about when designing this personal finance application was WHEN (not HOW) to persist the data. I'm using DDD, a 4-tier architecture, and EF. It struck me when I ...
2
votes
1answer
77 views

DB concurrency issues with domain model IDs

So I've done a good job separating the DAL from the BLL. I use repositories for each aggregate root. The issue I'm having is database concurrency with IDs in the domain. I don't want to use the ...
1
vote
2answers
98 views

Using Autoincrement Primary keys as Foreign Keys vs. unique codes

i’d like to push discussion on the same named thread again. I also use auto increment primary keys as foreign keys - mostly for code tables. Every row also has a code for identifying entries for ...
2
votes
2answers
251 views

Should audit records have their own id?

I'm creating audit tables to track changes made to some of my crucial tables and I'm wondering whether there's a point to history rows having their own id. Here's how my interfaces look like: public ...
2
votes
4answers
617 views

Why can't clients query the DB directly using SQL?

Given that a lot of modern web applications just consume JSON data from the sever, what is the point in having a REST api at all instead of just using SQL's query language? Nowadays people are ...
0
votes
3answers
174 views

How to associate one type with another in multiple contexts?

An application has types Game (and other business units) and Message. (Message is not a simple class with text, but a composition of a variable number of blocks like texts, images, and videos). ...
2
votes
1answer
134 views

What is the best way to maintain synchronicity between a table that has a list of another table?

I used to do Java development and with JPA, I don't really have to worry about the synchronicity between a table and the lists it owns. For those who don't understand what I mean, here's an example. ...
0
votes
1answer
65 views

What abstraction to use for hiearchical sum from ordered list

I am looking for an abstraction from which to solve a class of problems similar to the following: I have this ordered ResultSet (in this case sorted for NATION,REGION,DISTRICT,COUNTRY): CITY' Table ...
3
votes
2answers
170 views

Storing calculation results in DB

What I was taught in the university was we don't save the results in the database, but only the raw data which need for the calculation. For a very basic example, if: a + b + c = z we only save a, ...
1
vote
2answers
501 views

Maintaining user avatars

The issue at hand is dealing with user avatars that come from their social media accounts. When a user signs up with our app, the user will use his/her social media account and we simply save the URL ...
-6
votes
1answer
101 views

Database design — what should be included in Order and not in Invoice and vise versa in a simple online store?

I'm developing a simple online store with simple functionality. Among others, there're 2 tables: Orders and Invoices. What exactly should be included in one and not in the other? For now I can think ...
2
votes
0answers
330 views

File upload sync for offline desktop application. (Electron)

We are making an offline desktop application in Electron that needs to sync when the user goes online. Sqlite is used as the database when offline and it gets synced to postgres on the server when ...
0
votes
1answer
350 views

Database migrations and Code deployment

Should Database migrations be in included in the same deployment project as the code? If they are not included in the same deployment, the Database deployment package and the Code deployment package ...
1
vote
1answer
377 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 ...
5
votes
2answers
1k 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
489 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
84 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
178 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
264 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
643 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
411 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 ...
2
votes
1answer
144 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
1k 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
904 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
815 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
286 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
785 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
136 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
870 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 ...
-3
votes
5answers
148 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
938 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
1k 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
172 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
1k 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
2k 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
64 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(....., ...