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

learn more… | top users | synonyms (1)

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
72 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
46 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 ...
0
votes
1answer
71 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
145 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
304 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
200 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 ...
1
vote
1answer
106 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), ...
2
votes
2answers
290 views

Why do some prominent web sites use alphanumeric strings for resource IDs instead of numbers?

For example, the video IDs that YouTube uses are not a simple number, but instead a case-sensitive, alphanumeric string (like dQw4w9WgXcQ). Why do some websites, such as YouTube and Dailymotion use an ...
0
votes
0answers
37 views

Designing how to add multiple items for a user in a database?

I'm relatively new into designing databases so this is my first project and I'm trying to understand better it's structure. I need to create a SQLite database where there will be a simple USERS table ...
2
votes
3answers
84 views

A pattern to find out if data in a dialog-window was modified by the user?

I think about if there is a pattern or another intelligent solution for that problem. I am searching for a more generalized and reusable solution. I load an existing and still persistent row/object ...
0
votes
4answers
130 views

How to avoid null in primary key? [closed]

I need to make table that seems to require two column primary key with one of the columns nullable. But according to questions I read on Stack Overflow that is undesirable and even against SQL ...
1
vote
2answers
213 views

How are abstract database interfaces written to support multiple database types?

How does one begin to design an abstract class in their larger application that can interface with several types of databases, such as MySQL, SQLLite, MSSQL, etc? What is this design pattern called ...
4
votes
3answers
286 views

How to avoid the LoadBy pattern?

In our codebase for a sophisticated system controlling many aspects of businesses, we have a certain unwritten law to not fudge around in code with complicated SQL, instead writing it into a function ...
1
vote
2answers
72 views

Working with local connections instead of global

In recent weeks I became very concerned that the way I've been working with database connections for the past years, is simply wrong. I exclusively create a new connection for each database operation ...
0
votes
0answers
37 views

Persisting and manipulating JS ArrayBuffer data on the server

My node.js app has to deal with (sometimes large; a few MB) tables of numerical data. I'm about to use JavaScript's native binary objects for this purpose (i.e. ArrayBuffer and friends), because ...
0
votes
0answers
63 views

Ruby best practices for Data Access layers

I'm starting my way into Ruby development and have some questions that I hope you can give your best opinion to better design some command line applications I'm developing. What are the best patterns ...
1
vote
3answers
147 views

Should I create a class for functions that uses of the database?

I have a PHP application which is pretty simple: It allows the user to create, edit and read a post. Basic stuff. I have a Database class which handles the connection and the queries execution. The ...
1
vote
1answer
44 views

Search by Location and Keywords [closed]

I have data set with ~5M entries/rows (~2GB). Every entry contains a location field (lat/lon coordinate-pair) and n keyword fields (keyword-1, keyword-2, ... keyword-n). The keyword-fields can all ...
31
votes
5answers
4k views

No central database

I have a client that is looking to get a website/mobile apps/desktop apps built that deal with very sensitive data (more sensitive than bank/card details). Because of the sensitive nature of the data, ...
2
votes
1answer
185 views

OOP - Should I set the database connection as `public` for other classes to use it, although it might be unsafe?

I have a basic Database class, and it has a mysqli property (an object itself) which contains the connection information. Other classes uses this class to read and manipulate the database. There are ...
8
votes
4answers
1k views

Will the Database connection be closed if we yield the datareader row and not read all the records?

While understanding how yield keyword works, I came across link1 and link2 on StackOverflow which advocates the use of yield return while iterating over the DataReader and it suits my need as well. ...
0
votes
1answer
34 views

Database multiple database query each time

I'm writing a rest service. For each request I use about 4-8 queries. Should I try to refactor those into a single query?
0
votes
1answer
137 views

Efficient way to store large number of image path per record into a database table? [closed]

I am trying to think of an efficient way to achieve this. We get a zip file that has a XML file containing around 1500-2000 items. Each of the item could have up to 20 images for it. The images are ...
0
votes
3answers
70 views

Identical Databases for Multiple Users Reading Efficiency

Our project utilizes a static database (no writes). With many users we don't actually have a problem per se reading it. If a database "locks" per read request by any user, then would it not be more ...
2
votes
3answers
116 views

Long running DB query with concurrent write at the same time [closed]

We have a big table with a lot of data and a select query which takes 3 seconds to run. However we are a highly concurrent environment and each second we get 100 new records in our database. So ...
0
votes
2answers
49 views

I'm looking for a way to add database update scripts to a “playlist” [closed]

I've got a group of scripts to run and I'd like to batch them all together. Rather than write a .cmd/.bat file to run the lot it feels to me like there ought to be something similar to a playlist ...
2
votes
2answers
76 views

Using ORMs in two separate programs which share a DB

I have an application that is divided into two main parts: A web crawler written in Python A REST API written in Golang They share a MySQL database, which is mainly populated/updated by the web ...
2
votes
3answers
72 views

How to properly store messages in a webservice?

We are building a multitenant webservice with PHP and MongoDB. There is a need for communication between service employees and clients, communication can be established in many different ways. Some of ...
6
votes
5answers
379 views

How do I balance 100 clients checking the same database table in a loop?

What I have This is a prototype. I have a pool of 100 clients connected to the server via websockets reporting things and awaiting for commands. The server polls the commands database table of type ...
0
votes
2answers
92 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, ...
2
votes
4answers
152 views

What is the best data model to represent mathematical range (in database, xml, json…)?

For example, greater or equal to 50 and smaller than 100 (>=50 && < 100) smaller than 10 or greater than 40 (<10 || >40) I have been thinking about how to represent ...
1
vote
3answers
191 views

UUID vs Integer

For a database. Should I use an UUID or an integer for the primary key? I will never exceed 2^32 in amount of rows, so an integer should be more than plenty. I would prefer to use an integer, as I ...
1
vote
1answer
99 views

PHP MySQL unique user data [closed]

I'm trying to create a php website that users log into and they can submit data to a MySQL database. How do I make it so the users can only see data they've submitted and not everyone else's data? ...
1
vote
2answers
98 views

anonymous/ghost users in database

This questions is related to this one : anonymous checkout My company bought a CRM software and I am concerned by the way it stores customers' information. The website allows anonymous users to have ...
0
votes
1answer
360 views

Improving performance with caching of files in C# [closed]

EDIT: You were right, the problem is not checking if a file with the same name exists but the connection. I made a mistake measuring the time with StopWatch and included a part which used the network ...
4
votes
0answers
75 views

RDBMS v/s NoSQL for analytics [closed]

While reading about this topic online I have found out that, in general, RDBMS are good for read heavy loads and NoSQL databases are good for write heavy workloads. This statement also seemed true ...
4
votes
2answers
76 views

Storing persistent data that only has a single instance but can change

I'm creating a website CMS in Rails (for fun and learning) and I'm trying to figure out how I'm going to store the data for an "about" page. Due to the nature of this page, the data will only have one ...
1
vote
2answers
273 views

Alternatives to cron jobs or other ways of improving scheduled task performance

I'm working on a social networking website where users gain ratings after specific actions taken and proper conditions are met on the tables. The ratings are calculated depending on 'total hours ...
2
votes
1answer
86 views

Adding new features to software while keeping the same database

My little team is just a few days from launching our web page. Its another user content type page so a lot of our data will be about user preferences and behavior. We decided to get it out of the door ...
2
votes
2answers
230 views

Is it OK to use (WTF) forms to validate against stuff from DB?

Form classes are intended (IMO) for submitted data against rules. For example: are passwords equal, is end date later than start date. submitted data--->|Form| Is it okay for Form classes to ...
2
votes
0answers
100 views

Architecture: mobile apps for different clients with their own dbs different servers?

My general feeling is that this is a question which must have been answered but I am struggling to find resources for it. I know little about mobile app dev but my knowledge of web services is pretty ...
1
vote
1answer
195 views

Why do I need to use recursion on the classic employee manager database relationship?

Take the data from the Oracle scott database. I have modified it to have multiple levels of management from the original, select * from scott.emp order by mgr desc; empno ename job ...
4
votes
3answers
106 views

When to load related database data in web request?

I'm trying to determine when a web application should query a database for related data that may or may not be used in the current request. As an example, consider a database that tracks assets for a ...
2
votes
2answers
341 views

matching usernames with their password

We are working on a simple login/registration form. Our login script checks to see if the username and password exist in the same row of the database. If it does exist, we bring the user to a welcome ...
2
votes
2answers
310 views

How do you sync changes to the data in your database? [closed]

I am new to a team developing a very large web application. Prior to my start, the team had 0 automation in place and just did everything by hand. This was possible because they were only a team of 2. ...
1
vote
0answers
79 views

Using a distributed system as an alternative to disk storage

So, one of the differences between "main memory" and disk storage is durability -- the data on hard disks will stay accessible and unaffected even if the host machine crashes or loses power. One can ...
1
vote
1answer
44 views

Table with 2 columns that are foreign keys. Only one can be set for every record

I have a table that is connected with 2 other tables like so: Main table ID_1 | ID_2 //Foreign key of table1 //Foreign key of table2 Table1 ID | Some ...
0
votes
0answers
23 views

boiler-plate/pattern for a db patch script

I'm looking for a pattern to follow for a database patch script. We've had problems with customers not running patches, or running them in the wrong order, patches failing etc. and we'd like to get on ...
3
votes
4answers
428 views

Where to store average value in db?

I have a restaurant review app which stores reviews in a db, MySql. There's 2 tables. 1 for Restaurant. Another for reviews. To increase the performance, I am considering to store the avg review of ...