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

Fastest way to persist an append-only ordered event stream

I'm looking to persist a stream of events and I want it to be: fast in both latency and throughput, looking at at least 100k events per second ordered (not by timestamp, as multiple events within the ...
0
votes
2answers
122 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 ...
2
votes
0answers
123 views

Chronicle Queue: how to make a stack and how to limit disk usage

My server and several clients are different JVMs running on the same machine, they need to share persisted time series data: server reads a time series from somewhere, writes to a persisted embedded ...
3
votes
3answers
3k views

DB Queries in code or use Stored Procedures

Some of my colleagues tells me that using stored procedures in the database adds to much business logic in the database, and that you should keep the data separate from logic. Other colleagues tells ...
1
vote
3answers
936 views

Database per tenant approach, single or multiple database server(s)?

I'm tasked with investigating the different approaches for multitenancy. Currently I'm expanding my demo application to use the database per tenant approach. Now where I'm getting unsure is that in a ...
1
vote
4answers
95 views

How do I approach structuring when to read/write objects to db?

This is a problem I've faced in many languages over the years (js, go, c, f#, haskell, python, ...), but I haven't found a general approach to solving this yet. Learning about consistency models in ...
1
vote
1answer
45 views

Managing cache when matching datas

I'm retrieving values from 3 tables in database and trying to make them match. I was wondering how I could manage cache in an elegant way. I can't change the database structure even though one of the ...
0
votes
1answer
136 views

How do browser extensions interact with web apps?

I want to build a browser extension that can read/write from the database that is behind my web app. However, I don't really understand how that would work conceptually and what the best practices ...
3
votes
1answer
1k views

Microservices - sharing data through distributed in-memory cache?

I'm fairly new to both microservices and shared in-memory databases like Redis. I'm wondering though if it would be a good idea to combine the two to address the challenges of data duplication, ...
1
vote
0answers
106 views

Polling Postgres DB architecture

We are using Spring Integration DB polling which polls a table every second and executes some logic based on result. My questions are: What are some good practices we can implement to account for DB ...
5
votes
2answers
287 views

How is Eventual Consistency (EC) better than Strong Consistency (SC) when N = 3, R=W=2 when SC gives better consistency gurantee in same config?

In dynamo paper, it says that in production most of the users set N = 3, R = 2 and W = 2. The common (N,R,W) configuration used by several instances of Dynamo is (3,2,2). These values are chosen to ...
0
votes
1answer
400 views

In new project where you have ability to define DB and write app code, what is seen as best practice?

Good day When starting a new project and you have access to the db as well as writing the code. In this specific case it is PostgreSQL and Java EE with JPA and Hibernate. Should one: Aim to ...
12
votes
3answers
5k views

What is the proper way to synchronize data across microservices?

I am relatively new to microservice architecture. We have a moderately sized web application and I am weighing the pros and cons of breaking it out into microservices instead of a monolithic system we ...
0
votes
1answer
45 views

Encrypted ID to 3rd party application

I would like to ask you a questions that arose these days with GDPR new rules. What I have is a payments service which use BrainTree to make the payments. In my side I store some information ...
2
votes
1answer
294 views

Best practices for translatable models in Entity Framework Core 2.1+

I'm building an Entity Framework Core-backed ASP.NET Core RESTful service and I have entities / models such as Product, Document etc with description in multiple languages. I want to be able to ...
1
vote
1answer
90 views

How should I move auditing data periodically to another microservice?

I have been reading a lot about microservices and have been trying to logically split my system design up accordingly. For the most part, my system will have a central database whereby I will have ...
1
vote
1answer
147 views

Keep enumeration in DB when data associated with it is not storable in DB

I've seen several questions on this website explaining that enums should be kept in the database when there is one (this one for example). However, I feel like my case is different and there are extra ...
-1
votes
2answers
73 views

Should the TotalGrandPrice be property or Order or Invoice

I'm developing a shop. I'm trying to figure out: where should "total_grand_price" belong to? "total_grand_price" = price of all order items - discount + shipping + taxex +- etc.... Should ...
-2
votes
1answer
181 views

Difference between data Dictionaries and diagrams in SDD

I am writing a software specification and I got confused with the data dictionaries section. is it a full detail of the interfaces and stored models ( like of a database ) or a just a second step of ...
2
votes
1answer
137 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 ...
42
votes
6answers
14k 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
26 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
137 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
295 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
285 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
161 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
193 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
377 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
158 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
172 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
258 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
529 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
98 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
207 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
142 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
84 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
170 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
82 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
88 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
74 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
185 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
106 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
878 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 ...