Stack Exchange Network

Stack Exchange network consists of 174 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
Join us in building a kind, collaborative learning community via our updated Code of Conduct.

This tag is for general database questions; if you question is specific to SQL use that tag instead.

0
votes
3answers
24 views

Calculating Journey Summary made by a vehicle and Cache them to database

This is more of a point me in the right direction kind of question, I have 2 solutions but both of them are invalid because the data calculated is invalid in some scenarios. I am working on a system ...
1
vote
1answer
35 views

Which datastructure to use for temporary storage of intermittent and asynchronous sensor data?

Here an outline of the setup: Input data: I have several sources for sensor input data (GPS, and a bunch of other sensor data from different sources). All of those individual inputs consist of a ...
-1
votes
0answers
11 views

Connecting Apollo Server to OrientDB Graph Database — How to Connect? [on hold]

I'm attempting to create a web application that will rely on fetching data from a Graph Database. My graph database is hosted by OrientDB 3.0. I'm trying to set up Apollo Server on the same machine to ...
-1
votes
0answers
78 views

Can data insertion be made to two related tables at once? [on hold]

I've created two tables named: evaluation_details and visits. Users can make an evaluation within the website to any department they want and while doing so, they can put date and the time they ...
-1
votes
1answer
102 views

Pros and Cons, use REST api vs querying directly to database with different client platforms [on hold]

We want to figured out, whats are the pros and cons, when you use a REST api vs querying directly to a database, if you have different client platforms (Web-Application, Android, iOS). Edit: I know ...
-1
votes
1answer
13 views

Data store for sequential key-value, time limited event “journal”

I'm designing a system in which a key component acts like a "journal", in the sense that it stores a list of sequential events that can change the state of the entire system. Upon request, any other ...
0
votes
0answers
19 views

Edit List attribute in JPA when null?

I am using EclipseLink as my JPA implementation and Postgresql as my DB. JPA: @Struct(name="label,.....") @Entity @Table(name="\"XYZ\"", schema="\"XYZ\"") @NamedQuery(name="...
1
vote
0answers
91 views

How to maintain table relationship across services in with a micro-service architecture

I have a scraper service that looks for media online. For every source type, there are two tables. A common source table and a source_type_media table that are related by source.id to ...
0
votes
1answer
27 views

Extending photo album app with videos

I have a personal photo album application where I upload my photos. However, I'd now like to extend it with videos as well, and I'm unsure how to properly perform this extension. The current design ...
-2
votes
0answers
24 views

react native - to db or json

I am building a front end app in react native. The app is content managed. The app will pull down a zipped version of it's data (json) from a web based CMS as it needs to be usable without internet ...
1
vote
1answer
53 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 ...
2
votes
1answer
88 views

How to design a storage backend for a cloud spreadsheet?

As a personal project to learn key technologies, I am trying to build a spreadsheet on the cloud (something like Google Sheets). How would you design the storage backend to power something like this? ...
2
votes
1answer
54 views

Data points to use cache or database for these three major features under scalable ecommerce?

Auto-completion :- When we start typing, does system suggest the product from cache or hit the DB every time or hit the DB only when no result found in cache ? Search:- When enter any product, does ...
2
votes
2answers
83 views

Should methods be part of your persisted entities?

We are coding a small game and have a Player class. This Player class has certain properties which you would persist in a database like Id, Level, Health. We would like a Player to be able to kill ...
-3
votes
0answers
57 views

How should I handle a change of prices of an order?

Say, I have a site-shop where some products are sold. Each product has the price and the price can change. A purchase can also include shipping, discounts, taxes, etc. And they all are subject to ...
0
votes
1answer
78 views

Does primitive obsession apply to columns of tables in database?

For example, in a Student object, in order to avoid primitive obsession, I should change public class Student{ public String name; public int age; } into public class Student{ public ...
0
votes
0answers
17 views

How to implement dynamic settings in a web app — db table design?

In my web app I want to be able to use Settings as an admin that I can edit/remove/add via my admin page I think I'll create a table like this: settings(id: int, key: string, value: string) I ...
1
vote
1answer
49 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
1answer
53 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
31 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 ...
2
votes
3answers
140 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 ...
0
votes
2answers
97 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
89 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 ...
0
votes
0answers
102 views

Ontology optimization

I have a pretty complex ontology of an application which is used for decision making. By ontology here, I mean basically how entities are related and how they are composed and structured (the context ...
1
vote
1answer
40 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
46 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 ...
-1
votes
0answers
42 views

Database table that would lot of data

What would the best aproach be for table that contains lot of data? Let me demonstrate the example: Imagine you have website, and you track position of mouse of every logged user, so you would have ...
0
votes
1answer
71 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, ...
0
votes
0answers
36 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
1answer
187 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
383 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 ...
1
vote
3answers
238 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
0answers
21 views

Implementing Products, Purchases and Payments and Statuses

I have Products, Purchases and Payments. I'm trying to figure out how to deal with Payments and statuses and the ultimate status of Purchase - "paid", "failed", "refunded", etc.... My requirements: ...
0
votes
1answer
42 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
67 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
37 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
89 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
66 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
73 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
80 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 ...
31
votes
6answers
5k 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
21 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
107 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
49 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
70 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
60 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
119 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
193 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 ...
0
votes
2answers
181 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
165 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 ...