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

learn more… | top users | synonyms (1)

12
votes
7answers
1k views

Why shouldn't you develop on production database? [duplicate]

I need help with organizing my arguments for why it's MADNESS to develop against production data. Backstory: I started working here six months ago and I noticed we're developing directly against ...
12
votes
5answers
3k views

Indexing a database

I am not so familiar with databases and now I am trying to understand the indexing mechanism. From what I know, in a RDBMS, indexing on a column makes searching by that column faster. This is also ...
12
votes
3answers
1k views

General thought process for “How would you build this website/app” interview questions

I've collected a bunch of interview questions like "Describe how you would design a photo album application", "Describe how you would design this particular feature of this particular website" (e.g. ...
12
votes
7answers
686 views

Whats the best way to determine when it is appropriate to use a database?

I began my programming career in web development using PHP and MySQL. I got quite accustomed to utilizing db for storage of most dynamic data as well as some setting/parameter data. Sometimes there ...
12
votes
4answers
1k views

What would you think about a new Java persistence tool, that's not really an ORM? [closed]

Persistence in Java Over the past years, I have gathered experience in the field of persistence abstraction in Java, using concepts such as EJB 2.0, Hibernate, JPA and home-grown ones. They seemed to ...
12
votes
3answers
739 views

Does ORM promote database de-normalisation?

Doctrine and Propel both make use of single and concrete table inheritance to map object relationships. The former sees all possible fields in the class tree mapped to a single table - whereas the ...
11
votes
9answers
2k views

My father is a doctor. He is insisting on writing a database to store non-critical patient information, with no programming background

So, my father is currently in the process of "hacking" together a database using FileMaker Pro, a GUI based databasing tool for his small (4 doctor) practice. The database will be used to help ease ...
11
votes
10answers
912 views

How could RDBMSes be considered a fad?

Completing my Computing A-level in 2003 and getting a degree in Computing in 2007, and learning my trade in a company with a lot of SQL usage, I was brought up on the idea of Relational Databases ...
11
votes
11answers
1k views

Is continuous creation and deletion of tables a sign of an architectural flaw?

Recently I had a discussion with a developer who mentioned that during program development, they routinely create and delete tables and columns on a regular basis while working on new features and ...
11
votes
3answers
1k views

How to create better OO code in a relational database driven application where the database is poorly designed

I am writing a Java web application that consists mainly of a bunch of similar pages in which every page has several tables and a filter that applies to those tables. The data on these tables comes ...
11
votes
8answers
1k views

Handling deleted users - separate or same table?

The scenario is that I've got an expanding set of users, and as time goes by, users will cancel their accounts which we currently mark as 'deleted' (with a flag) in the same table. If users with the ...
11
votes
4answers
328 views

Database design - Store state or compute state every time?

Let's say I have a relational database application and a "user" object and a "message" object. Now I want to show the number of unread messages to this user. What's the best way to archive this? Do I ...
11
votes
5answers
2k views

At what size of data does it become beneficial to move from SQL to NoSQL?

As a relational database programmer (most of the time), I read articles about how relational databases don't scale, and NoSQL solutions such as MongoDB do. As most of the databases I have developed ...
11
votes
6answers
4k views

Isn't SQLite a bit underestimated? [closed]

Before I ask the question, let me first describe my thoughts about SQLite. I happen to like tools that are small, fast and, more importantly, have only the really necessary functionality. That's why ...
11
votes
8answers
2k views

What qualifies “too many database requests” in code?

This is a discussion myself and some of my colleagues are having and thought I'd come out here and see what if there's a general consensus on it. It basically comes down to the following 2 opinions ...
11
votes
4answers
319 views

Can I use the database structure of an open source project?

I found a database structure for a CMS system and I want to copy it with the EF that this database is done in, is it OK to copy the database structure of open source software which is under GNU v2 ...
11
votes
2answers
2k views

What is the difference between collation and character set?

I have a general question about databases. We usually use the term collation with databases. I would like to know how its different from character set. I guess collation is a subset of character set. ...
11
votes
3answers
2k views

How to handle Real Time Data from a database perspective?

I have an idea in mind, but it still confuses me the database area. Imagine that I want to show real time data, and using one of the latest browser technologies (web sockets - even using older ...
11
votes
4answers
1k views

TDD with SQL and data manipulation functions

While I'm a professional programmer, I've never been formally trained in software engineering. As I'm frequently visiting here and SO, I've noticed a trend for writing unit tests whenever possible ...
11
votes
2answers
4k views

Data Synchronization in mobile apps - multiple devices, multiple users

I'm looking into building my first mobile app. One of the core features of the application is that multiple devices/users will have access to the same data -- and all of them will have CRUD rights. I ...
11
votes
4answers
1k views

Data architecture for event log metrics?

My service has a large ongoing number of user events, and we would like to do things like "count occurrence of event type T since date D." We are trying to make two basic decisions: What to store? ...
10
votes
22answers
7k views

Software Developer Interview Question - Fair or Unfair [closed]

I just phone interviewed with a company for a graduate software developer position and was asked the following questions. I should add that the company concerned are not a database vendor. How does ...
10
votes
9answers
4k views

Foreign key restrictions -> yes or no?

I would like to hear some”real life experience” suggestions if foreign key restrictions are good or bad thing to enforce in DB. I would kindly ask students/beginners to refrain from jumping and ...
10
votes
2answers
2k views

Will B-Trees and Other Data Structures Become Obsolete With The Advent of Solid State Drives?

Many (perhaps most?) database applications today use B-Trees and variations to store data, because this data structure optimizes the read, write and seek operations on a hard disk (and these ...
10
votes
3answers
818 views

How do I know my data is relational or object oriented in nature?

Just read these lines- If your data is object in nature, then use object stores ("NoSQL"). They'll be much faster than a relational database. If your data is relational in nature, the ...
10
votes
4answers
3k views

Weaknesses with different types of NoSQL databases

Here's my question: What are the weaknesses with different types of NoSQL databases? Specifically, what're the weaknesses of key-value stores, graph data stores and document stores? I've had an easy ...
10
votes
2answers
1k views

How do you handle database change deployments?

We have been discussing database deployment techniques today, having had a couple of recent failures in our current process and having seen situations where we would like to roll back a deployment but ...
10
votes
3answers
1k views

How do you put a database online? [closed]

I have a very beginner question regarding web development. I've had some experience with JSP, Hibernate, and MAMP to create a simple system for tracking inventory and sales. But this was all done ...
10
votes
5answers
2k views

Is there any reason to use VARCHAR sizes rounded to a 128/256/4096 byte offset?

In database schema's, I often notice VARCHAR sizes are rounded to the byte offsets 128/256 or 4096. I've done it before as well, and the idea behind it was probably something with efficiency. ...
9
votes
4answers
1k views

Why do relational databases only accept SQL queries?

As far as I know, most relational databases do not offer any driver-level API for queries, except a query function which takes an SQL string as an argument. I'm thinking how easier it would be if one ...
9
votes
11answers
18k views

Using XML as data storage

I was thinking about the XML format and the following quote: “XML is not a database. It was never meant to be a database. It is never going to be a database. Relational databases are proven ...
9
votes
6answers
24k views

what do database programmers do?

Every time I read about Oracle programmers etc, I get confused. I don't know what exactly they do. From my understanding, application programmers need to develop the core functionality. The libraries ...
9
votes
5answers
2k views

Agile methods and Databases at the start of the project

New to agile and I'm not sure how to start. The idea is to create small parts of the project in sprints. However the project I'm working of requires a database and the database must be almost ...
9
votes
5answers
14k views

How to quickly search through a very large list of strings / records on a database

I have the following problem: I have a database containing more than 2 million records. Each record has a string field X and I want to display a list of records for which field X contains a certain ...
9
votes
8answers
2k views

Scanning a billion rows in an ultra-fast database

Background A local database contains nearly 1.3 billion unique rows. Each row is indirectly associated with a specific latitude and longitude (location). Each row has a date stamp. Use Case The ...
9
votes
4answers
888 views

Benchmarking databases

I see lots of discussions flying around about performance of db 'x' or that moving from 'x' to 'y' improved our site performance. I'm yet to see proper benchmarking that works across different types ...
9
votes
4answers
2k views

Best Practices: Database app programming patterns

I have written many database (MySQL) web apps so far but I always think my structure is kinda clumsy. I want to improve the programming/design pattern I use, hoping for some advice here. Particularly, ...
9
votes
3answers
2k views

Should I use a config file or database for storing business rules?

I have recently been reading The Pragmatic Programmer which states that: Details mess up our pristine code—especially if they change frequently. Every time we have to go in and change the code to ...
8
votes
7answers
2k views

Copying a competitor's database schema? [closed]

I am going to be releasing some software soon which will require users to run a local database. There is a competitor in the space that is doing the same thing and they have a pretty sophisticated ...
8
votes
9answers
3k views

How much database access should developers have? [closed]

So I've worked in many different workplaces as a developer and my level of access to the database has been varied. I typically don't have production db access. Most of the time I have access to the ...
8
votes
8answers
455 views

Refactoring or upgrading databases to handle new features

Several responses to a database schema question, suggested an additional table to normalize a database for a feature that is not part of the current requirements (A UserDepartment table to allow for a ...
8
votes
3answers
1k views

what are the best tips for storing images in a database?

Is it appropriate to store the image files in the database? Or it would be better to store only the path of the file in the database, while keeping the file itself on the server? Are there any other ...
8
votes
4answers
675 views

Do startups need a dba? [closed]

I am a Database/ BI person with 5+ years of experience (SQL Server and Oracle). I would really love to work for a startup, but from the feeling I get from seeing the job postings, most startups are ...
8
votes
6answers
7k views

Is MongoDB the right choice in my case? [closed]

I'm going to build my first real project in Rails that consist in a web app made of 3 main parts: The static part where no database is used The User registration part which will require a database ...
8
votes
4answers
3k views

Are database schema migrations a problem in production environments?

In discussions about NoSQL vs SQL databases, I sometimes hear that companies prefer to use schemaless NoSQL databases because it is problematic to migrate the schema to a new version. But is that ...
8
votes
6answers
4k views

HTTP Session or Database approach

I am confused a little as what should be my approach, Working on a design of shopping cart and i need to store shopping cart either in session or in database but not sure which approach would be ...
8
votes
3answers
834 views

Creating a layer of abstraction over the ORM layer

I believe that if you have your repositories use an ORM that it's already enough abstracted from the database. However, where I am working now, someone believe that we should have a layer that ...
8
votes
4answers
5k 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 ...
8
votes
1answer
388 views

When allowing a user to change passwords, should I generate a new salt?

In my database, I have a column for the hashed password and the salt. My application allows users to change their password. Should I use the same salt for the password, or should I generate a new ...
8
votes
1answer
3k views

How is localStorage different from indexedDB?

localStorage and indexedDB are used for offline storage of data in HTML5. What are their key differences and which one is preferable in what situations?