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

learn more… | top users | synonyms (1)

0
votes
1answer
140 views

Relationship between REST APIs and Databases [duplicate]

I've been studying databases and rest APIs lately and I have a question about the relationship between the two. Imagine I have a database with three tables, STUDENTS, ENROLLED, and CLASSES. STUDENTS ...
2
votes
0answers
64 views

Suggestions for Storing large collection of related words

I am trying to create a simple sentence generator that uses templates and a database of words. It will be a website where essentially a user could click a button to generate a sentence. For example: ...
0
votes
1answer
130 views

Best way to flatten an XML document

Say you have a document like this: <names> <first>Joe</first> <last>Smoe</last> <phonenumbers> <phonenumber type="home">123-567-9876</...
0
votes
1answer
61 views

Database searching for string across different tables

Scenario: application will search in database almost all columns across about 8 tables/views for defined string and return all rows containing that string (will return collection of objects or JSON). ...
4
votes
1answer
63 views

What's the advantage of storing database transaction changes in the log as well as data pages?

I know the basics of why a database uses a transaction log - fulfilling ACID properties, ability to rollback/restore, etc. The basic algorithm that I see for a transaction is as follows: ...
1
vote
2answers
57 views

DB Design for non static front-end

I have a question about best practices to design a database which have to hold the following data: There is a page with a questionnaire which has default questions like Firstname, Lastname, Street... ...
-4
votes
1answer
77 views

Migrating MYSQL functions and stored procedures to SQL Server

The company i'm working for is selling HRIS management software. It was built using ASP and mysql. But one of our client's demand is for it to be based on MS SQL Server. our team is made up mostly of ...
0
votes
0answers
30 views

Best way to create “attributes” for Neo4j node?

I have this node labeled "Person" and these various items from what would be a class, in a conventional DB. For example: Teacher, Lumber, Magician, Artist and Painter. They should all fit in the same ...
3
votes
1answer
65 views

How to delete user data that is referenced by another user?

Lets say a user has a set of data. This data is stored in user_data table. This user_data table is referenced by other users in some way. In case the user wants to delete a row from the user_data ...
1
vote
1answer
44 views

User account model with two or three possible profile

My application will have at least two types of users: clients and companies, these are the types of profiles. Because each type of profile requires different additional information, it will be ...
6
votes
5answers
590 views

How to design a complex REST API considering DB performance?

I've been following some tutorials on how to design REST APIs, but I still have some big questions marks. All these tutorials show resources with relatively simple hierarchies, and I would like to ...
2
votes
2answers
118 views

Database Design - lots of small tables or fewer, bigger tables?

So I'm designing a database for a project which is going to enable beauty businesses to create a profile, clients to create a profile and for the client's to be able to book appointments and for the ...
0
votes
0answers
40 views

Project that has no network involve, how can I update multiple databases?

I am working on a project that involves a very large area, for example this area is a big subdivision with 10 gates, because it is so big and we are aiming on producing a low-cost product and creating ...
5
votes
1answer
78 views

How can I better document these data relationships/transformations?

I'm working on a project that uses RxJS to perform data transformations on varying sources of data, and I'm in the process of writing some documentation for it. I want to find an effective way to ...
4
votes
4answers
258 views

Best practice for getting last record inserted in DB

Me and a couple of colleagues are having a discussion regarding the following case: In an OrderStatus table we're keeping track of all the statuses an order goes through in time, including "Pending",...
2
votes
2answers
77 views

Retrieving an incorrectly stored tree data structure

Way back in the hazy origins of our platform it was decided that we were going to need some hierarchical data structures stored in the RDBMS. The relationships between nodes were stored via a '...
5
votes
2answers
85 views

Junction table related to another junction table

I'm defining a DB structure, and I have a strong feeling I'm not doing it right. I have hotels that can be configured to offer some optional services (airport pickup, massage), that can in turn be ...
1
vote
0answers
31 views

Correlating Search Classifiers in a Database Scan for Sensitive Information

Problem Description I am working on an enterprise data discovery project that is designed to scan databases for sensitive information. The basic search unit is called a classifier and covers things ...
-1
votes
1answer
63 views

Is there a generally accepted definition of “Secondary Index” independent of DB product? [closed]

Is the definition for "Secondary Index" anything more specific than just "Any index that is not the primary index"? EDIT: Here is some research I have done: Search Google. I evaluated the first 20 ...
4
votes
1answer
77 views

How can we rollback a database synchronized over multiple systems?

On a mobile device, a set of operations has been saved in the local DB with a wrong date (because the system date was set in the future). Then the device regularly doing synchronisation with a server ...
42
votes
8answers
6k views

Is the use of NoSQL Databases impractical for large datasets where you need to search by content?

I've been learning about NoSQL Databases for a week now. I really understand the advantages of NoSQL Databases and the many use cases they are great for. But often people write their articles as if ...
0
votes
1answer
99 views

What is the significance of database host name while configuring database?

The name database host, how the name indicates "the server that hosts the database", should be the server ip, that hosts that database. I don't see any relation of it with the scripts that try to ...
2
votes
1answer
255 views

How to Manage Privileges in C# WPF applications

I'm writing my first "large" program in C# and WPF. It's a Database system (MySQL) that has three main items, Contracts, Companies and People. I have the main UI down for the Companies section of the ...
2
votes
1answer
115 views

Tracking online users with a stateless architecture

I own a stateless architecture, exchanging a JWT token between client and server at authentication time. I want to store in database (once per day) a timestamp related to the user access. Indeed, I ...
-1
votes
3answers
160 views

How likely are collisions of timestamp-based identifiers? [closed]

I overheard a discussion about using timestamps as unique identifiers when storing some data in a database. Person A pointed out that there's a risk of collisions. Person B replied that it's very ...
0
votes
2answers
197 views

DAO design for writing big XML file on database

I am currently working on JavaEE application (Spring, Hibernate). I have to put a big XML file (more than 1 gigabyte) on a relational database (Postgres). The application does not use batch ...
3
votes
2answers
96 views

Change database based on request origin

I am developing a web application which will be run by multiple companies. Each company will have its own instance of that web application and its own database. The web applications and databases ...
4
votes
2answers
91 views

How to represent a collection with capacity in a database?

Concerning normalization of a one to many relationship, I am not sure how to represent a collection with a specified capacity in a database. I can think of two ways to represent an entity A with a ...
-2
votes
2answers
97 views

Tables vs. Booleans: Which of the two are more secure for setting admin roles in an app? [closed]

I'm currently in the process of setting up roles where there are regular users, admins, and super admins, each of which have special permissions. I deferred to this post on how to do so. It ...
1
vote
0answers
39 views

Compiling data from multiple API sources, multiple languages, into a single database (MySQL or Mongo)

I'm thinking about a database schema, and would really appreciate if some of you could look at where I'm up to and offer some advice.. The mission - We have to write a program that will fetch data ...
0
votes
1answer
86 views

Is it advisable to create a single API to access the database? [closed]

Got an organization that its core work is acquiring various sources of data, validating it and integrating it to existing mostly financial data sets and then availing that data to many different types ...
4
votes
1answer
93 views

Can't I use an enum at application level if I have a NxN relationship?

After reading the answers to this question, and this and this related questions, I'm now confused about how/if to work with an enum having an NxN relationship. Let's say I have an entity Hotel, an my ...
34
votes
8answers
5k views

Why would you store an enum in DB?

I've seen a number of questions, like this, asking for advice on how to store enums in DB. But I wonder why would you do that. So let's say that I have an entity Person with a gender field, and a ...
5
votes
2answers
180 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 ...
2
votes
1answer
81 views

Executing queries against multiple separate database instances

Premise I have a number of database servers (different DBMS instances, installations in different physical locations), each of them contains data and uses the same schema. Most of the data is ...
3
votes
3answers
71 views

Handling Value Unit data

We have some data that is strongly bound to each other and we are using it for calculations. Its a value with a unit type and an optional relation. E.g. 1500 meter above sea level. The unit type ...
4
votes
2answers
158 views

What is the recommended strategy to deal with a frequently changing database model during development

A lot of projects have a to be determined database model during early development. This could mean that a lot of SQL will have to be rewritten frequently. What is the recommended strategy to deal with ...
5
votes
3answers
177 views

Is it a good practice to have a pre-filled embedded database for development?

I'm currently working on a project which only uses its database for data storage. This means there are no triggers or stored procedure in it, just tables and data to put into it. In this scenario I'm ...
1
vote
3answers
179 views

Enforce uniqueness of personal contact records in a system or not? [closed]

I have a contact table which stores all the contact information of a person such as name, address, phone number. The system would be more user friendly if it can prevent users from accidentally ...
0
votes
0answers
32 views

Where should user input be validated? [duplicate]

I am working on a webbased user interface using AngularJS. As a database I am using MongoDB which can be accessed through an Python-eve-API. The API is able to validate the passed data as stated in ...
3
votes
2answers
125 views

How do I model a sortable resource in sql database? [closed]

I encounter this issue when I create REST API. I cannot tell the exact scenario, but let's say it is for a website that has category and product resources. Each category has many products and both ...
12
votes
5answers
797 views

How to avoid violating the SRP in a class to manage caching?

Note: The code sample is written in c#, but that shouldn't matter. I've put c# as a tag because I can't find a more appropiate one. This is about the code structure. I'm reading Clean Code and trying ...
32
votes
6answers
4k views

What is a good security practice for storing a critical database on developer's laptops?

We have a few givens: Developers need a replica of the production database on their machines. Developers have the password to said database in the App.config files. We don't want the data in ...
2
votes
0answers
90 views

Upload, convert, and store multiple different product data feeds into a database

I'm not sure if this right location for this question, but here it is. I currently have about 30 different CSV or TXT product data feeds. I am trying to build a tool to 1) upload each feed 2) ...
4
votes
2answers
51 views

AutoIncrement Integer Column,Guid or PGuid, which to choose?

Guid has been a Global Unique Identification. Why does "PGuid" (Global Unique Identification) appear? 1) Is Guid NOT PERMENT for unique? (I sometimes wonder whether Guid is REALLY PERMENT generator ...
3
votes
1answer
102 views

Django Migrations: Binds data to code?

If you have custom code for models (custom validators and custom fields are examples), Django Migrations will import them directly into the migration files. An example: file web/models.py def ...
3
votes
2answers
188 views

One wide table or multiple themed tables?

I'm trying to design a database for a simple text based game where the player characters have a large number of statistics that I want to track. Currently I have a few groups of related statistics, ...
12
votes
1answer
312 views

Can domain models in the database be a sustainable solution?

I just started at a new job as a database developer for a medium-small sized, company based on Microsoft-technology. I noticed early on how much practices deviate from what I've been taught at school ...
2
votes
2answers
220 views

O(1) complexity array access

I have an array of heights, with irregularly spread stations, e.g.: arrH=[100 500 1000 2500 4500]. During run-time I receive some height, h, and I need to determine which cell (index) contains the ...
2
votes
1answer
180 views

Elasticsearch and relational database combination

Imagine I have a marketplace application - where users can search for products (we concentrate on clothes). Every product has an ID, name (text), description (text), price (numeric), size (numeric), ...