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

learn more… | top users | synonyms (1)

3
votes
2answers
281 views

implementing dynamic query handler on historical data

Context: I have historical data about property (house) sales collected from various sources in a centralized/cloud data source (assume info collection is handled by a third party) Planning to ...
3
votes
2answers
34 views

How should I handle test services not connecting to Production DB?

I want to verify that my services (used to collect data from database and handle it according logic) are not connecting to production database which can cause data loss. my first idea was to mark the ...
2
votes
1answer
774 views

Separation of retrieving data and business objects between DAL and BLL Layers

I did some research before posting this question. Among other questions or post, one of those is provided below. I could not get a clear mind how to determine.. Business Objects within a Data Access ...
2
votes
0answers
29 views

How to handle complex calculated fields in an ORM

In our API we've got a few central datatypes which need to be "decorated" (so to speak) after retrieval from the database with calculated values. The database is accessed through an ORM which follows ...
2
votes
3answers
46 views

Table design for holidays

I'm creating a system to store holidays and events. I have a basic understanding of the schema for the static dates (every 23rd of march for instance). My trouble lies with the relative dates (i.e. ...
-3
votes
0answers
17 views

Extracting from search results on a website [on hold]

After I do search query on a website, I get results grouped in a number of pages (1,2,3 etc), and on each pages they are presented in a table-like form, with each result shown in a horizontal column ...
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 ...
3
votes
1answer
242 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 ...
1
vote
0answers
21 views

Updating a video's view count. Should this happen client-side or server-side?

I built an iOS app similar to Vine, where a user can scroll a feed of videos that auto play. All of these video have a View_Count field in the backend to keep track of how many times the video has ...
11
votes
4answers
8k views

Database History Table / Tracking Table

Currently I want to structure a tracking/history table like this: PrimaryKey - ID OtherTableId - fk fieldName - name of the field its tracking OldValue NewValue UserName CreateDateTime So ...
3
votes
1answer
315 views

Is this database design good? What JPA Entities should I create for this design?

I am trying my hands on JPA. For this I am thinking of using the example of a student admission process as shown in the diagram below. Is this design good ? Any suggestions for improvement are ...
1
vote
3answers
97 views

DB Schema design : single table with more columns vs multiple tables with fewer colomns

What would be better DB design for a social network website. A single table with more columns and less rows or multiple table with fewer columns but more rows. For example: User can post an update on ...
1
vote
2answers
53 views

Abstracton layer to control services access to denormalized db entity

Our db is optimized for minimum join count (partially denormalized). E.g. our User entity contains account data (nickname, facebook id, etc), user numerical statistics (total games played, total wins, ...
1
vote
3answers
71 views

Using auto-increment clustered key and guid primary key together

My boss is the db administrator in a new software project and he came up with that design where every table will have both a auto-increment clustered key and a guid primary key (or possibly composite ...
0
votes
2answers
128 views

Why should I use lookup tables at all?

This question confirmed, what I was already aware of -- instead of directly storing strings in table, I should rather use integers or enums and join them with lookup table, to get, as a result, ...
2
votes
3answers
112 views

At which point using string-based enums can become a real problem?

This is a direct follower to this question. An answer given to that questions says (my understanding), that nowadays using string-based enums instead of integers isn't a much problem, because hosting ...
2
votes
1answer
97 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 ...
-2
votes
0answers
58 views

how to store audio files path in mysql database table [closed]

i am struggling to store mp3 files URL/path in my songs table url field. i am using xampp and mysql with phpmyadmin since i have very little knowledge about sql i have no idea how exactly i should ...
3
votes
4answers
1k views

Database is performing slow, even all the tables are having normalization

An interviewer asked me this question: Tables are created with appropriate normalization rules, However the database is performing slow. [Ie.: The select, insert statements are taking time to do ...
0
votes
0answers
24 views

What are some common patterns for managing a polyglot persistence layer?

I am pretty interested in the idea of using multiple datastores to support a single application and understand the benefits in theory but would like to know a little more about how things are done in ...
4
votes
3answers
190 views

Java & REST API: How do I check for duplicate before inserting record?

I am developing an application in Java to parse and upload records from a CSV to an online database, via a REST API. While I know for sure that there are no duplicate records in each CSV file, I ...
0
votes
1answer
57 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) ...
0
votes
1answer
27 views

How to scratch database that query faster for cloud computing

We are planning to develop a cloud based database driven web application which we would like world to use. Till date at the database side we have used fully normalized way to store the data and use ...
2
votes
6answers
282 views

What is faster? Using REST API or querying a database directly?

What is faster performance wise? Creating a REST API and having your web app use the REST API to do all interactions with your database OR querying your database directly (i.e. using whatever typical ...
3
votes
5answers
362 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 ...
1
vote
1answer
95 views

The correct way to use Sessions (PHP)?

I am making a website that requires logins, and would like to know what a good approach is. Right now, I am thinking of the following: User sends username and password to server, where it is ...
17
votes
5answers
3k views

Why don't Windows/Linux OS use relational Databases (RDBMS)?

Why don't Windows/Linux OS use relational Databases (RDBMS)? I know they use File Systems to store all data but don't you think it is more efficient to use databases like we use in Web site/web apps? ...
2
votes
3answers
59 views

Find all circles that cover one point

I'm not sure if I've been searching using the wrong keywords, but I've tried so many different ways of wording this and I can't find a relevant answer. Basically, given a set of circles defined by ...
5
votes
7answers
3k views

Ways to have a history of changes of database entries

What are ways to allow the versioning of database entries (data)? Think of the content-managment-systems abilities to revert back changes of articles. What are their pros/cons?
1
vote
1answer
74 views

Proper tree NoSQL structure with focus on full-text searching

I developing an app with tree(folder-file) structure, on which I should perform full-text searches with MongoDB. I did a research on the best tree structure practices and found this great article, but ...
0
votes
1answer
232 views

Like structure table with Laravel and showing the most popular content at top

I am using Laravel to creating a website, my users can post questions and other users can write their comments under the post, each comment have Up vote and Down vote, and users can voting for ...
1
vote
2answers
192 views

NoSQL or MySQL? [closed]

I'm developing an app that requires to save data that is not consistent across all rows. These database entries represent different kind of sport activities. Let's take an example: In football the ...
3
votes
4answers
379 views

Application development with fully dynamic controls and processes based on database

All software development projects are moving into separation of design, logic , data in patterns like MVC , MVVM and others. Strangely i got a very strange requirement for a new software; that is : ...
37
votes
11answers
2k views

Why don't relational databases support returning information in a nested format?

Suppose I'm building a blog that I want to have posts and comments. So I create two tables, a 'posts' table with an autoincrementing integer 'id' column, and a 'comments' table that has a foreign key ...
2
votes
1answer
63 views

Reuse already fetched data for request

I have action that fetches user model from db to check access. Then I have method that in some cases requires same model. function checkAccess(req, res, next) { var data = ...
0
votes
0answers
15 views

One Enum vs Multiple Enums [duplicate]

I am developing an application where a user submits a mission and other users accept the mission. Pretty simple. I want to keep a track of the mission progress status and store it into a database. ...
0
votes
0answers
23 views

Application/Database Design: using a table for workflow/content approval logic

Probably a poor choice of title but can't think how else to word it. I am developing an app for a company using CakePHP (MVC Framework). I have built a "Status" model which essentially has an an ID ...
1
vote
1answer
24 views

Should MVVM models contain complex objects

Let us say that I have a Book class, a book can have an object of another class like an Author or other complex objects like a list of Genres. My question is, in an MVVM model should I make the ...
1
vote
1answer
80 views

Composite Primary Key drawbacks

For website that I maintain (eCommerce) I now need to make a table that seems to require Composite Primary Key of 5 columns. I never used 5 column as primary key before, only 2 and rarely 3. I ...
3
votes
1answer
87 views

Business concept design vs logical database design

Good day. I need help for a specific case. A little background: We have an existing app, it is like a PDF viewer, and you can draw freehand, highlight, add highlight with notes, add action items, etc. ...
2
votes
2answers
194 views

Communication/Updates between units of works/entity framework contexts, colliding with user changes

I'm developing a WPF application using Entity Framework for my database communication. The application has a hierarchy of tabs where each tab has a db context. Each tab allows the user to view some ...
1
vote
2answers
202 views

Best approach for a server configuration data collection and reporting solution from a legacy script?

I have a project which involves collecting config data from windows servers in our (very large) server estate. My manager wants me to collect over 150 data items across all configuration areas ...
2
votes
3answers
144 views

How to use one web page to create and edit database entries

My team and I are developing a java web application which allows our admins to create and edit "methods" which can later be viewed by other users. We are currently discussing the best way to ...
14
votes
7answers
10k views

Is there any reason to use varchar over text columns in a database?

Is varchar just a remnant from before text came around, or are there use cases where you would want to use a varchar? (Or char for that matter..) (I use Postgres and MySQL (MyISAM) daily, so those ...
1
vote
1answer
46 views

Performance and data retrieving

I'm currently developing a mobile application in Objective C for iOS devices. While doing the application I reach the point where I have to retrieve data from a database and show it on a table (the ...
0
votes
0answers
35 views

Using Google for full text database search

I have a lot of text and I am storing it in Elastic search. Using Lucene, NLP and Wordnet filters the search is good but not as good as Google's because none of these methods use AI for the search so ...
1
vote
1answer
118 views

Java partial enum backed by the database

I have following problem: need to use enum in my java code, since I'll have to ask in my business logic things like if(someting == enumname.VALUE_ENUM){... but I don't have all the enum types at the ...
4
votes
2answers
812 views

How deeply programmer should know about internals of database engine? [closed]

I am learning SQL Server 2012 along with C#. In the past, I took database class in college, and have good grasp on SQL language and can write queries. However, looking at SQL Server documentation (or ...
2
votes
10answers
1k views

How do I determine if customers have already received a newsletter?

The problem: When we were sending newsletters to customers, there was no way to confirm if the customer already received the mail. We have come up with two different approaches: (Boss's Idea) Each ...
11
votes
2answers
469 views

Why store flags/enums in a database as strings instead of integers?

I've been browsing SQL dumps of some famous CMSes, including Drupal 7, Wordpress (some quite very old version), and some custom application based on Python. All of these dumps contained data with ...