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
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
687 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
893 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
5answers
720 views

For an ORM supporting data validation, should constraints be enforced in the database as well?

I have always applied constraints at the database level in addition to my (ActiveRecord) models. But I've been wondering if this is really required? A little background I recently had to unit test a ...
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
302 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
2answers
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. ...
11
votes
5answers
1k 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
4answers
309 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
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
870 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 ...
10
votes
22answers
6k 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
3k 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
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 ...
10
votes
6answers
3k 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 ...
10
votes
3answers
732 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
8answers
1k 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 ...
10
votes
4answers
2k 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
3answers
851 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. ...
10
votes
4answers
828 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? ...
9
votes
6answers
20k 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
8answers
440 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 ...
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
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 ...
9
votes
4answers
790 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
1k 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
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 ...
9
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. ...
8
votes
11answers
14k 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 ...
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
2k views

How much database access should developers have?

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
4answers
630 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
5answers
9k 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 ...
8
votes
6answers
817 views

Learn a NoSQL or become a badass with traditional RDMS - Where is/will the work be? [closed]

New Question Version: I've got the opportunity to spend 3 months getting good at something, its going to be either a NoSQL technology like Cassandra or optimising relational database systems. I ...
8
votes
4answers
3k 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
4answers
2k 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
3answers
4k views

Why aren't Object Oriented databases used as much as Relational Databases? [closed]

I have come across many relational database management systems (RDBMS). But recently I used hibernate which made me start wondering why Object Oriented databases aren't more popular. If object ...
8
votes
6answers
6k 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 ...
8
votes
3answers
218 views

What methods exist for handling DB Change Management?

I recently began working with version control in my web-development using subversion. This works great for managing the files I develop but does nothing for the changes I sometimes need to make to ...
8
votes
4answers
435 views

Staying OO and Testable while working with a database

What are some OOP strategies for working with a database but keeping things unit testable? Say I have a User class and my production environment works against MySQL. I see a couple possible ...
8
votes
4answers
588 views

Should database queries be abstracted out of the page itself?

When writing page generation in PHP, I often find myself writing a set of files littered with database queries. For example, I might have a query to fetch some data about a post directly from the ...
8
votes
3answers
422 views

Best way to model a singleton in a relational database

When designing relational database schema for web applications, I often find a case where I end up creating a table just to contain one row, and only one row. It feels like that is the wrong way to ...
8
votes
3answers
171 views

Cascading “Deleted” records that aren't really deleted

Just trying to get some ideas on what people do for this scenario. We have a system database(SQL Server 2008 R2) that has tables and every table has a field we can call "Deleted". It's basically a ...
8
votes
5answers
2k views

Writing Web “server less” applications

TL;DR What are the prospects of writing applications which are completely based on a REST database server (CouchDB) and web applications which directly access the DB instead of having a web server in ...
8
votes
4answers
6k views

Business Objects within a Data Access Layer

So I've been creating a data access layer via TDD and have approached somewhat of a concern. I'd rather not start down the wrong path, so I figured I'd ask you guys to see if my thoughts were in line ...
8
votes
2answers
314 views

When is cloud database right for me?

Some say that DBaaS (database as a service) -- aka cloud database -- is not suitable for Business Intelligence (BI), analytics (OLAP) or archiving. Is this true? More generally, when DBaaS is the ...
8
votes
3answers
426 views

How do you handle constantly changing database dimensions?

For the last two months or so I have been looking for solutions or practices to handle release management within databases. I'm looking for what people view as the best process for handling this. We ...