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

Allow client side direct access to the database [duplicate]

I am asking advice from the SQL graybeards. Because my following proposition goes against everything I have practiced. In this instance Let's assume we are developing a phone app. A social network ...
1
vote
0answers
88 views

How to store relational data belonging to different client customers?

My users will be businesses with a small number of accounts each: e.g. Business #1 with 3 users, Business #2 with 5 users, etc. I am trying to determine the best way to organise the relation (on ...
0
votes
0answers
20 views

ACL entity and microservices database relations

I would like to build a microservices architecture to handle the following scenario: I have a building. The building has some kinds of devices. And the devices can be used by the users. In the system, ...
2
votes
2answers
279 views

Should arbitrary numbers be stored as strings in a database?

I'm using Google as a login system for my latest project. So, my users table has a column named googleid, which stores Google's unique user id, which is a number, with a few dozen digits. For example, ...
1
vote
8answers
606 views

Is there a way to prevent developers leaking data while they are developing?

I am working with a startup company for a while now. They have been affected by some reckless developers in the past. One area they want a real and immediate improvement is when they assign a task to ...
8
votes
1answer
2k views

Making API calls with celery

I'm designing a system for a client where the requirements are: they upload a JSON file (one object/line) make a call to an API with the JSON object as the payload record the state (success/failure) ...
1
vote
2answers
67 views

Storing and searching a vast database of text

I am building an application to search through a large number of comments. Currently I am storing the comments in an sqlite database, but it has grown to around 40GB in size and even with FTS5 ...
2
votes
1answer
143 views

Unit conversion of data

My team is developing a web application, where we have in the requirements to display the data in multiple unit which is set by the end user. Where should we write down the unit conversion logic, on ...
-3
votes
5answers
147 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 ...
1
vote
1answer
80 views

Approach to handle network breakdowns in application dealing with database?

I have an application that writes data to database. In case of network breakdowns, the connection to database gets lost & my db queries freezes the whole application. So, in order to make it ...
0
votes
0answers
32 views

What architecture is the most adapted for a shared balance in Nodejs (and maybe Redis)? [on hold]

I need some kind of fast micro-services using nodejs to share a common balance between several services. Several services can change this balance , so the balance must guarantee that the operation ...
1
vote
1answer
75 views

About databases in docker containers

I'm trying to understand containerized apps and databases and I'm trying to understand the microservice architecture using kubernetes. One thing that I couldn't get my mind convinced is the database ...
126
votes
17answers
11k views

How do you store “fuzzy dates” into a database?

This is a problem I've run into a few times. Imagine you have a record that you want to store into a database table. This table has a DateTime column called "date_created". This one particular record ...
17
votes
3answers
6k views

How to store ordered information in a Relational Database

I am trying to understand how to properly store ordered information in a relational database. An example: Say I have a Playlist, consisting of Songs. Inside my Relational Database, I have a table of ...
0
votes
1answer
38 views

How do database storage engines handle new columns?

I really don't know which StackExchange site this belongs on. It didn't seem to match the "on-topic" list of DBA.SE or SO.SE ... so please let me know if I should move it. I also couldn't find a ...
0
votes
1answer
143 views

When is the point where a JSON text file storage is not enough?

I guess it was Robert C. Martin who campaigned against using SQL in one of his apps, where he was just fine without DB and SQL initially. Later, thanks to the abstraction a DB implementation could be ...
0
votes
0answers
27 views

Object Data must be built on SQL side or in Code Side?

I am thinking of a very flexible application that will build a single entity object from a lot of tables joins. example for an object "Car" with a code something like this SELECT e.id, a1.attr_value ...
-1
votes
2answers
192 views

Anonymize Public Health Records Database

I am working on a project to anonymize PHI in our health records database when databases are copied to our testing environments. Currently, the database is copied and fields in the tables (first name, ...
0
votes
4answers
117 views

Could you please recommend an approach on converting non-unique field to a unique field?

On our prod db we have two tables: companies invoices Relationship: A company has many invoices An invoice belong to a company The invoices table contains duplicate invoice_number for each company. ...
2
votes
1answer
171 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 ...
0
votes
1answer
62 views

Custom service layer logic vs Custom DB query

I am trying to confirm best practice around architecture I am working with. Frontend <-> API gateway <-> Service layer (Rest API) <-> DB I have an incoming request which is asking for huge ...
2
votes
1answer
115 views

Who (and what) should have direct access to a database, and why?

I am developing a chat application as my the first project. I have never had experience of establishing a connection to the remote database server before so I don't really understand who should have ...
0
votes
1answer
202 views

Appropriate design / technologies to handle dynamic string formatting?

recently I was tasked with implementing a way of adding support for versioning of hardware packet specifications to one of our libraries. First a bit of information about the project. We have a ...
0
votes
2answers
90 views

Database agnostic DAO (NoSQL + SQL)

Background While writing a new component, I m in middle of making a decision of SQL/NOSQL database (Mongo vs Mysql) for my storage layer. As of today, mysql seems to be a perfect fit for my use-case (...
1
vote
1answer
71 views

Does a microservice's individual database need to have complete data?

Say you have a Users and Orders service and they have their own database. Since microservices need to stand on their own even if another service is unavailable, does the Orders DB need to have all ...
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 ...
9
votes
3answers
3k views

Where to put business logic if using Firebase?

I'm about to start developing a single page web application that is very simplified a multi user documentation system. The front end will probably use Angular2. The project has a short deadline, so I'...
1
vote
1answer
43 views

Database structure for an app used to capture data in warehouses

I am in the process of creating an android app for our clients that would replace the paper-trail in their facilities with electronic inspections. Although I have coding experience, I have little ...
1
vote
1answer
116 views

Best way to model pricelist per customer for products in webshop

I am making a b2b-webshop system that will have multiple customers. Each customer will have a separate active pricelist which contains the products that they can buy and the prices that applies for ...
0
votes
1answer
67 views

Database schema for products and their packages

The product is water purifier, and we are selling packages included support for changing filters. Serial is a unique number identifying a single produced item and it's only for water purifiers not ...
0
votes
2answers
120 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
1answer
205 views

How to handle database connection password?

I have a question about using databases in my application. I have the User table which stores password for my users. I know how to handle user authentication, but how to handle the password for the ...
0
votes
0answers
26 views

How to store message content in a webservice

I am building a service responsible for sending email/sms communications. The service receives a request that contains information necessary to build an email/sms template and the recipient ...
0
votes
3answers
321 views

Should I use ISO country code for primary key, or integer ID?

I have or am going to have a database with countries and their emissions. Countries in the API have a 3-letter ISO Code. Should I use this for identifying the countries in database, or just a plain ...
92
votes
3answers
48k views

How is localStorage different from indexedDB?

localStorage and indexedDB are used for offline storage of data in HTML5. What are their key differences and which one is preferable in what situations?
1
vote
2answers
137 views

What is the best model to catch DB side error?

We have a web application that all update, insert and DB operation procedure handle via SQL Server DB 2017. What is the best way to handle and get error (in Web-app or SQL server error handler?). for ...
4
votes
3answers
1k views

Is it okay to use a non-ID column for foreign key reference?

I have my tables as below Role(Role ID, Name, Other_Columns) Command(Command ID, Name, Other_Columns) I have association table RoleCommand. Is it okay to have RoleCommand(RoleName, CommandName) ...
1
vote
1answer
53 views

different data connectors for different objects and users

I have an application which needs to store different objects in different data stores based on the user's authorization credentials. I.E. the user may need to save object 1 to their BI postgres ...
0
votes
0answers
40 views

Designing database relationships for a voting application

So I designed database relationships for a voting/polling application. I want a user to only be able to pick 1 option on a poll. I want multiple options per poll. So what I have here is this. User ...
0
votes
1answer
60 views

Multiple stored procedures or 1 with parameter

I need some advice... I started working at a financial business world recently. Looks like the DB architect uses auto generate function to create stored procs. At the end, we have way too many procs ...
4
votes
1answer
375 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 ...
2
votes
1answer
336 views

Three phase commit protocol

I'm trying to understand the three phase commit protocol by reading the wiki page (http://en.wikipedia.org/wiki/Three-phase_commit_protocol#Motivation). In the description for the diagram I posted ...
-2
votes
1answer
134 views

Mock db out or not during testing?

I am writing an app that mainly consists of just creating, editing and reading records in database. I was persuaded that any app has to be covered with tests. I was told that it's a good practice to ...
15
votes
4answers
2k views

Why not use SQL instead of GraphQL?

Recently I learned about GraphQL which claims to be superior to RESTful. However, I started wondering why don't we simply put SQL statements into an HTTP GET request. For example, in GraphQL I would ...
6
votes
4answers
595 views

Am I right in writing our own database migration/versioning software?

I have started work on writing a tool to version the database schemas we use at work and enable migrations under version control. My first research into existing tools turned out to be too cursory due ...
1
vote
2answers
140 views

Small databases online

This is to ask whether accdb databases are suitable for this application, and how to connect the user with the database (and the phone network with the database if anyone has a comment on this). I ...
-2
votes
1answer
73 views

Generate HTTP RESTful server from database schema

Today the job of most Java-based servers is to translate HTTP requests into SQL commands/queries and send a JSON-ed response back to the client. That's a pretty generic (and honestly boring) job. I ...
6
votes
3answers
571 views

How should I design database, where I have 30 users, each who needs full access to their data?

I work for something like a consulting company. I have a web application that I built for one client. Now around 30 other clients want about the same product. The problem is, I don't know where to put ...
0
votes
0answers
43 views

How to design database tables for complex build of materials as product models?

I need to redesign a 10 year old Product Management Portal and underlying Data-model. There are build of materials as products in the system. Product managers update pricing frequently for products. ...
0
votes
2answers
60 views

Is it worth to use a sql db for just two columns (possibly extensible)?

So, first of all hello to everyone, I hope you are having a good day :) I will give you a little context. I coded a program for my job, in which I save to a database Errors ID and their solutions. It ...