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
0answers
25 views

What is best as a database system for garnering historical election data? [on hold]

For a project in History and Political Science, I am collecting tons of electoral data, including Names of each, Votes cast to each, Turnout, Rejected Ballots... The data spans: - at least 70 years ...
-6
votes
0answers
23 views

Where to start: Sortable Databases and APIs [on hold]

First things first, I apologize if this is not the correct forum for me to ask this question. I like to consider myself as tech-savy; I have a general understanding of HTML, PHP, Sql, and CSS. I ...
0
votes
0answers
21 views

MS SQL DB retrieve two coloumns from one query [migrated]

I have two tables as below: Students table work table: My query is: select stud_name from students inner join work on work.library=students.stud_id where work_id=2 It returns name of ...
1
vote
2answers
86 views

Database Design for Inventory

I am starting to design a typical product based MySQL database but I keep running in circles on how to design the tables. I have many types of products Jeans Tshirts Dresses Which have many of ...
1
vote
1answer
55 views

How do auto generated stories/news articles work?

So there seems to be a new trend of auto-generated stories, a concept which I am struggling to understand. For instance, this article seems to indicate that sports articles will henceforth be written ...
0
votes
0answers
11 views

Is Event sourcing a good fit for database sync (master-multiple-slaves)?

I'm looking for a good way to maintain in sync local sqlite databases that could be offline to a master one, for a invoice app. Then I read about EventSourcing and Log structured storage and wonder ...
1
vote
1answer
79 views

is there a cleaner / simpler way to code this? [duplicate]

I have a web app that uses ajax to filter db results. So if you have a list of 1000 widgets, that have IDs ranging from 1-1000, by typing numbers into the ID field, you can narrow your search. ...
1
vote
1answer
112 views

How to optimize the application with huge number of database requests per minute

I have to provide free demo of some service to end users in my application. Free demo could be of 30 mins, 1 hours, 5 hours etc. (predefined time) for a new user for one time only. User can also ...
0
votes
0answers
54 views

How do I return the database rows in a custom order? [migrated]

I have a data base with two columns: a number and a name. The table is as follows: Am expecting the result of select * from table where num=6 or num=3 to be : But what I get is: How do I ...
1
vote
1answer
88 views

Am I planning my database/backend correctly?

I'm an iOS developer and to be honest I'm not really looking to become a database expert right at this moment, but I do need to know how to properly plan out what I believe to be a pretty cookie ...
0
votes
1answer
93 views

How to structure programs that interact with databases? [closed]

I've just finished a book on MySQL and I'm in the infantile stages of learning to couple that with Java. I know that the technology I need to learn is called JDBC and that it essentially allows you to ...
0
votes
1answer
70 views

Making a database and related operators using files and JSON in java [closed]

I'm trying to write a program that reads operations from a file. these operators look like below : CREATE TABLE student(id:integer, gpa:decimal, name:string, family:string,isMale:Boolean) INSERT ...
0
votes
1answer
89 views

Using XML to store and edit data records in Java

I want to use XML to store data for an assignment . In this Java assignment I'll get data from the user in form of lines in a file below INSERT INTO student(id,name,family,isMale) VALUES ...
1
vote
1answer
22 views

Sequencing distributed tasks with a distributed DB

Background I have two separate processes, WriteIt() and ReadIt(). One creates records, and the other processes the records in a DB cluster. Once WriteIt() creates a record, it queues a ReadIt() ...
0
votes
0answers
21 views

Is Python Logging in a WSGI application a best practice a production environment?

I am trying to log my webpage access to a database. It is a requirement. It seems to be a difficult thing to do outside of Windows IIS, and I do not wish to use Python with IIS. My options seem to ...
2
votes
4answers
175 views

why do people do REST API's instead of DBAL's?

At the past two companies I've been at REST API's exist for querying data via a web app. ie. instead of having the web app do SQL directly it calls a REST API and that does the SQL and returns the ...
2
votes
1answer
98 views

Integration testing and database connection string in app.config

I am working on a project where SqlConnection is created via a static method, lets say it's DatabaseAccess.GetSqlConnection(). This method reads the .config file to get the connection string and ...
2
votes
1answer
322 views

How should I handle database failures in a web application? [duplicate]

I'm developing a simple RESTful API using Go's Goji framework (although this question is language-agnostic), in which parameters from the URL are queried against a PostgreSQL database. Here's how it ...
0
votes
0answers
53 views

Abstracting the data in a relational database. [duplicate]

While working with data, which is in a relational database I came up with this issue. At first, I was just writing helper functions to retrieve A SPECIFIC data I needed for the current problem but it ...
0
votes
1answer
39 views

Recurring database migration

I'm importing data from older website to new one using database migrations. I have created first as one of first steps of development phase of new site. Then I planned to create another one, that will ...
0
votes
2answers
113 views

Getting to know my way around a database with hundreds of tables [duplicate]

I'm new to a small company that's pretty much run by one guy. He knows all the ins and outs of the system which is quite large. We have a database with about 300 different tables. I'm struggling to ...
4
votes
3answers
142 views

Algorithm that generates a group of men and women who are each interested in everyone from the other gender

In my dating app, I need to compile lists of men and women where all of the men in the list are potentially interested in all of the women in the list, and vice versa. That is, in a list of 10 men ...
0
votes
1answer
34 views

Tags DB structure - tags table using one join and GROUP BY, or pivot (join) table using two joins?

I'm implementing tags into my question and answer application. Users will be limited to the tags available by the app, so they can't choose their own. So maybe only 30-50 tags will be available. This ...
12
votes
5answers
1k views

How come the computer doesn't have to read the entire table when the column is indexed? [duplicate]

Let's say a table with two columns has 100 quadrillion records. And I want to find a record that has column #2 equal something. If column #2 is indexed it returns the result immediately, but if it's ...
1
vote
1answer
58 views

How to minimize database deadlocks in a load balanced web application?

I'm working on a web application hosted on multiple load-balanced web front ends (WFEs). This application has an API method that performs a database query and returns the results. This query only ...
0
votes
0answers
59 views

What is the design pattern name for a class that handles 2nd level caching? [duplicate]

I have a system where I want to start introducing some 2nd level caching. I want to abstract data access a bit and allow some type of other class to do the dirty work of fetching a DTO; it will check ...
0
votes
1answer
33 views

Planning complex Mongo (And possibly other NoSQL) Databases

There is no "right way" to do anything, but there are "better" and "worse" ways, as well as true and tested ways. I'm studying Mongo and considering it for a project. It's gonna start small but ...
1
vote
0answers
50 views

How to off load DB & API calls (PHP Heroku App) [closed]

I took over support for a PHP app that runs on Heroku. After analyzing the performance with New Relic, I'm noticing that the three bottles necks are the database and API calls to outside services. ...
2
votes
1answer
93 views

Strategies for handling or avoiding race conditions

I'm working on a .NET application where I off-load my DB work (save operations) to a separate thread (inspired by how NodeJS handles IO operations). A save operation comes down to this (using Entity ...
5
votes
4answers
248 views

Two Database Architecture : Operational and Historical

I thought about an uncommon database structure and wonder if anyone has seen it in use before. It's basically using 2 databases: First database hold only the data that is currently valid Second ...
0
votes
0answers
40 views

Hybrid Apps and Storage - how does it work with Native apps and which to use?

I'm using Ionic at the moment. I believe, like many others, that hybrid apps will become more more common/important than they are now simply because the frameworks are getting better and better. ...
0
votes
0answers
32 views

How can I model this scenario in a graph database?

I'm developing an application where users can tag resources and it's also important to know who tagged the resource with a specific tag. A graph database seems like a good fit for this and the rest ...
3
votes
4answers
120 views

How to save many changes to database data?

I'm working on a feature which will pull many (say, 1000-5000) rows from a database, display them to the user and allow the user to edit them. This editing may involve changing text; adding rows at ...
4
votes
1answer
215 views

How does the team ensure a good DB design? [closed]

We want to ensure that our team delivers a good performing DB design. But we are not quite sure how to achieve this. Couple of solutions have been suggested within the team: Adding DB indexes to ...
6
votes
7answers
282 views

How would you design a user database with custom fields

This question is around how should I design a database, it can be relational / nosql databases, depending on what will be the better solution Given a requirement where you'll need to create a ...
0
votes
1answer
123 views

Where should the following business logic be written?

I have a C# console application. This application has many different projects/C# class files, each of them dedicated to parsing a certain kind of XML and creating an object, called 'Response'. Now, ...
0
votes
2answers
104 views

Definition of the NHibernate Mapping by Code / EF Code First pattern?

Sub-questions: Does this pattern have a formal definition? Who invented it? Is it considered a DSL? The reason why I am asking is because I would like to better assess its applicability to ...
1
vote
3answers
188 views

OOP implementation doubts with databases

I was starting a project today and after designing the database structure and how the data would be stored etc, I started the implementation. I am doing this on php, but the language isn't really ...
3
votes
2answers
131 views

Design, how to utilize The Hardware (multiple threads and/or GPU) while indexing (via a database) a very large set of binary files

Problem How can design my file parser to maximize the hardware when processing (creating meta data for) a large file (i.e. how to avoid being blocked by IO and running out of memory) preferably ...
0
votes
1answer
47 views

REST and foreign key constraints

I have a rather complex database schema using foreign key constraints. This database schema will be accessed with REST services. Should REST or the database be responsible for referential integrity? ...
1
vote
0answers
22 views

How to use an Address Gazatteer in an application that contains addresses [closed]

Say I had access to the post office address file (http://en.wikipedia.org/wiki/Postcode_Address_File) and wanted to cleanse about one million addresses. I am trying to think of an "algorithm" to do ...
4
votes
1answer
87 views

Should I implement the consumer/producer pattern in my java video app, and if yes, how?

I built a small video frame analysis app with desktop Java 8. On each frame, I extract data (5 doubles now, but could expand to a 1920x1080x3 OpenCV Mat in the future). I would like to store this data ...
1
vote
1answer
85 views

how to decide when to use database replication vs. custom REST applications vs. message brokers (pub / sub)

We have a distributed solution that's currently under design. There are a few points of integration where some application needs data from someone else and vice versa. We could solve by either ...
58
votes
10answers
6k views

Is it premature optimization to add database indices?

A colleague of mine today suggested that we go through all of the queries in our application and to add indices accordingly. I feel this is premature optimisation because our application is not even ...
1
vote
0answers
24 views

Database data Bucketing Report Design

Here's the scenario: I have item x (item_id, customer_number, cost) which can be submitted to another system multiple times over months which may or may not reject item x before finally accepting it ...
1
vote
0answers
14 views

how to store program actively processing info for remote monitoring? Database?

So I have a program that processes a bunch of files. File in, start processing, file finished, next file. The question is, now I want to be able to monitor how that program is getting on, how? ...
1
vote
2answers
178 views

Is it possible to avoid SQL injection by not using a Query Language for most tasks? [duplicate]

I'm coming at this from a somewhat beginners viewpoint so if this is an obvious question it's because I didn't know the right terms to search for. Are there DBMS's that provide an alternative ...
2
votes
3answers
98 views

User roles in database [duplicate]

What would be the most efficient way to store a users role(in my case) in the database? What my user table looks like: id int(AI) username varchar(80) ...
0
votes
1answer
63 views

Design caching system

I am thinking about making my own caching system, mainly for C#, but this is more a design question, so the language doesn't really matter. Let me start at the beginning, I have a basic web api, ...
2
votes
1answer
43 views

Multitenancy and nested set trees

The application I work on utilizes nested sets1 to represent tree structures within our database. We need to expand a particular area of access control to support multiple clients who should not be ...