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
119 views

How to optimize a complex task with multiple DB calls

I have been working on a multi-layer, sale management application developed with WPF and partly refactored with EF6 (long story). The application has some very complex tasks which require multiple ...
41
votes
6answers
12k views

In microservice, is it single database or single database instance for each service?

I understand that a each service in a microservice architecture should have its own database. However, by having its own database, does it actually mean simply having another database within the same ...
-1
votes
1answer
25 views

Cursor select on 2nd Primary key on db2 sql field for embedded positional value - Unable to determine most efficient for longterm design

I have a SQL DB2 table where the first two fields are the primary keys (not including the third field which is date/time stamp). The table was designed by another team with the intent to make it ...
2
votes
2answers
132 views

Migrating from legacy database schema, rewrite legacy or sync to new

We're currently in the process of designing our new version of an existing application. This new version will not reuse any existing code as the old code is over 10 years old and tightly coupled. ...
0
votes
0answers
58 views

Do database CRUD operations dictate whether and application should be one-way or two-way binding?

I am confused (easily done). To me model is the data from the database sent back as JSON. When I think of that in an Angular context, when two-way binding is configured, it makes me think the ...
1
vote
1answer
71 views

In the context of nested database relations (A->B->C), what are the considerations for having an additional “shortcut” foreign key (A->C)?

I have a normalized relational database. I often find I need traverse multiple tables to get the related object of a related object and so forth. So by that I mean let's say I have related tables A->...
-3
votes
1answer
64 views

Creating a multiplatform (IOS, Javascript, and JAVA) linked user account database

I have done weeks researching this question for my App Idea. Background of the APP - Simply a multi crypto currency wallet which users sign up with ONLY username and Password - no email, FB, or ...
0
votes
2answers
128 views

design discussion, user experience first or correctness first in our case

We are discussing the system configuration module design in our Java medical device software. The system has a voice instruction function used to guide patient during the examination. Different ...
1
vote
4answers
275 views

Little value in unit-testing the database component

Having a component that represents the database is wonderful! You can use it from the business logic to read and write data. But should that component be unit-tested? I would argue that it should ...
1
vote
2answers
1k views

Should I use NoSQL (MongoDB) or SQL (postgresql) database for my application?

I am planning to build a live audience interaction webapp similar to Slido as practice/fun project. User groups: admins and anonymous users Admins: login create event (define event period and ...
3
votes
3answers
258 views

How can database-specific functionality, such as increment/decrement features, be used in DDD?

I have an entity that has a dollar balance property. Whenever an event occurs that causes the balance to change, such as a debit, within the same transaction the balance should be decremented by the ...
2
votes
1answer
145 views

Where to store config settings in a text file and when in a database?

I have several web applications. All of them have config files. I'm trying to figure out when it's appropriate to store data in a config file and when in database in json or free format? For instance, ...
1
vote
1answer
181 views

Is it usual to “re hydrate” DTOs into full objects with relationships when consuming web services?

We are designing a web API to transfer objects obtained from a database to a client application which is a front end GUI. The server side business logic will be implemented (for better or worse) in ...
1
vote
2answers
356 views

token authentication security best practice

So I'm trying a few token based authentication in Laravel, each user have token they can use to access certain database. But there is something I still don't understand from these tutorial. The ...
-1
votes
1answer
50 views

Implement Customizing records

I have the following tables: Organization. Articles Templates Organization is the parent of both articles and templates. On the articles index page, I display (by default) all templates for the ...
2
votes
1answer
157 views

Keeping a JSON copy of a database

I'm new to server-side programming and I'm building a small "test" web application in NodeJS. Each time the clients need to view data from the PostgreSQL database, NodeJS will execute a "SELECT" query ...
-3
votes
1answer
161 views

Using pattern “Repository” for table relations

Have read about "Repository pattern", before it, I have used pattern DAO (data-acess-object). How should I implement table relations with this pattern? Should I create entity for links between tables?...
3
votes
2answers
206 views

How to organize PL/SQL objects in git [closed]

In our organization, we have several databases. Each of them has lots of schemas with tons of packages, procedure, functions and so on. Now, I wonder what approach is best in terms of organizing those ...
0
votes
0answers
468 views

Use of UUIDs (Primary key) in a REST API

I faced the problem bellow when I designed our new app. We are thinking to have one extra column for some tables which is a UUID for security purposes. So, there are two different solutions. First ...
3
votes
2answers
97 views

Time series and unique users

I need to collect user data every few seconds where each user is unique. I've done some research and concluded that I should consider my data as time series data because I'm looking at how user ...
2
votes
3answers
191 views

Deal with Enumerations (Lookup tables)

I am trying to design the DB schema of my new project and I need some suggestions. I decided to create a lookup table in order to save the enumeration values. So I have a table Status with these ...
6
votes
5answers
2k views

Use UUID on top of auto increment ID

I am trying to design the DB schema of my new project and I need some suggestions. I am thinking to have one extra column for some tables which is a UUID. I wanted mainly for tables which contain data ...
1
vote
2answers
126 views

Interfaces for CRUD Classes

In an in-house solution I've been working on, I've been unable to understand the benefit of how interfaces are frequently implemented throughout the project. Which is as follows: Want to do CRUD ...
6
votes
0answers
83 views

Is the C in the CAP theorem the same as the I in ACID? [duplicate]

This article states that: Consistency in CAP actually means linearizability, which is a very specific (and very strong) notion of consistency. In particular it has got nothing to do with the C ...
1
vote
1answer
165 views

Which is best software design for heavy query based app

I am in charge of design an application (.NET) that has these features: It´s a desktop app (maybe in the future will be web-based) It´s functionality is to provide users analyzed data retrieved ...
1
vote
1answer
78 views

Backend - own database vs live parsing

I am developing a mobile app that depends on some nearly static data. I will gather that data initially from an existing website by doing some HTML parsing. I could now create a database from that ...
1
vote
2answers
87 views

How to model a status log that doesn't allow duplicate statuses sequentially

I need to model the status of an object over time. I'm looking for the best way to model this so that concurrent database connections can look at the current status and update the status if the newer ...
-4
votes
1answer
73 views

What options are there to administrate a database for an online business? [closed]

Say you create a small online business from scratch, a nice Rails or Django app or something to that effect. With luck, you end up with a database full of customer orders and things. Now, aside ...
1
vote
0answers
174 views

Are there any advantages of Cloud SQL Proxy over a DBaaS?

I'm currently migrating an app from Heroku to Google Cloud Platform (with Kubernetes Engine and Cloud SQL). In using Heroku, I've become used to the incredibly simple practice of defining a ...
3
votes
1answer
105 views

What is the better search system, user defined tags or pre defined attribute fields?

I'm developing a marketplace application that will eventually list a large number of different types of items. Currently our search system (powered by Algolia) is built on pre defined attribute ...
2
votes
4answers
711 views

Best practices for database backward compatibility

I am working on an app which has multiple versions deployed in the market. Different versions have modified databases and databases are to be synced between local storage and server storage by signed ...
-3
votes
1answer
173 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
95 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 ...
5
votes
2answers
181 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
1k 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
198 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
188 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
111 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
116 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
242 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
505 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
169 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
127 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
162 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
399 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
89 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
296 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 ...