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

learn more… | top users | synonyms (1)

2
votes
2answers
310 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
50 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
86 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
138 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 ...
2
votes
2answers
954 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
290 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
76 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
59 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 they'...
0
votes
1answer
113 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
184 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
49 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
289 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
2k 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
39 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
193 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
79 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
168 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 let'...
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 (e.g....
2
votes
2answers
132 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
79 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 ...
7
votes
5answers
688 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
105 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
233 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
243 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 ...
0
votes
1answer
131 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
118 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
485 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
114 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
96 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
633 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
98 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
282 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
126 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
217 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
129 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
581 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
374 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
94 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
53 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
27 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
487 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 ...
1
vote
1answer
41 views

Creating a specific table for shared columns among other tables (models)?

I'm creating a webapp that has a variety of models: Product, Category, ProductOption, etc. All of these models have a set of shared attributes: name, description, image, etc. There are two options I ...
0
votes
3answers
3k views

Is it bad to store data in JSON form or should I use mySQL? [closed]

I've been building an application and the whole thing is built around a simple data storage system. Create an array. Convert it into JSON. Add <?php die() at the beginning to prevent access. ...
1
vote
1answer
197 views

Qt/QML/C++ Application database connection object visibility

I am working on some Qt/QML/C++ app and I've got myself into some kind of dead end. Namely, this app uses mysql database and here is my questions: Is performance hurt if I instantate new database ...
5
votes
1answer
221 views

Command pipeline design question - where to place validation?

Here is the situation: I have a database and a class that is basically a representation of a set of fields of different tables in it. Let's call it Message. "Message" does not know of the database ...
3
votes
2answers
161 views

Database + Java Design for a scenario

Overview A central web application to supports other web applications(A) for user and its role/permission management. Applications (A) call the central application via API to get the user roles/...
2
votes
4answers
395 views

How to share data between web applications?

I have two web applications, say Application_1 and Application_2. Application_2 has a database table named table_2, which changes infrequently, and needs to be accessed by Application_1. Does it ...
4
votes
1answer
223 views

Message queue vs database for delayed tasks

I need to build a system that can handle a fairly high amount of delayed tasks (e.g. scheduled emails). For non-delayed tasks I would go for something like RabbitMQ. But, is it ok to let tasks ...
0
votes
0answers
40 views

Database search results by deviation from query in Java

When every i try something new, I always 'throw myself in the deep end'. I'm in the initial stages of an android app build (my first android app, and first attempt at anything java) I want to know ...