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

learn more… | top users | synonyms (1)

33
votes
6answers
12k views

How much business logic should the database implement?

I've worked in some projects where most of the business logic was implemented on the database (mostly through stored procedures). On the other side, I've heard from some fellow programmers that this ...
12
votes
6answers
2k views

In plain English, what is a database index most similar to? [duplicate]

Setup: Suppose you are teaching an introduction to Databases class, the students are CS students that have a working knowledge of tree structures, how they can speed up searches, and have probably ...
1
vote
1answer
92 views

Identifying Users

We have a site that allows users to generate their own content. If users generate illegal content, we'll be submitting a report to the authorities. In the event that we do have to report a user, we ...
107
votes
16answers
6k views

How do you store “fuzzy dates” into a database?

This is a problem I've run into a few times. Imagine you have a record that you want to store into a database table. This table has a DateTime column called "date_created". This one particular record ...
0
votes
1answer
219 views

Storing User Form Data

I am trying to come up with a data schema/methodology for storing the data collected from various different user application forms. All forms contain the basic info like name, address, etc but then ...
12
votes
6answers
9k 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 ...
3
votes
2answers
359 views

java classes and database queries

Can someone please explain the best way to solve this problem. Suppose I have three classes Person Venue Vehicle I have a DAO method that needs to return some or all of these attributes from each ...
4
votes
5answers
2k views

Suggested Web Application Framework and Database for Enterprise, “Big-Data” App?

I have a web application that I have been developing for a small group within my company over the past few years, using Pipeline Pilot (plus jQuery and Python scripting) for web development and ...
0
votes
2answers
654 views

Mapping a legacy database to ORM using wrapper classes

I want to use an ORM with a legacy database, but I don't want to expose some of the underlying data types. For example, some of the columns are nullable doubles or floats and I want my domain model to ...
2
votes
1answer
723 views

Best way to lazy load blob from database in Java?

I have a database table that stores uploaded files (excel files) in a blob field. Each record contains the uploader, upload-time, the upload ID (primary key) and of-course, the blob itself. At some ...
4
votes
1answer
503 views

Application Design with a Shared Database

I have a generic design question that relates to enterprise applications but I think that software developers from other types of projects may have experience with this as well. The scenario is ...
0
votes
6answers
405 views

For a web-application, should I programmatically create the database tables or provide a schema file and instructions?

The few LAMP web applications I have installed require me to create the necessary database tables myself, with a schema file, instead of doing it automatically with a script or setup page. Is this a ...
-2
votes
1answer
771 views

How do I create a web service with high amounts of traffic that works effectively with lots of different users? [closed]

I have created web services before that are used by a small number of users but have a new project that would have lots of users. For each user that uses the services, this is what they would do: 1) ...
5
votes
4answers
2k views

NoSQL and BIG DATA

I am doing an internship on Big Data technologies so I am new to this area. My question is about the use of NoSQL in the Big Data architecture. Do we need always to use a distributed storage (like ...
0
votes
3answers
154 views

Search on multiple values

I have a database having around 15 tables.Currently I am working on a report generation page, which is having 16 criteria.The values are distributed among multiple tables.User can select any number of ...
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 ...
0
votes
2answers
128 views

Language design suggestion on database query [closed]

I am designing a new programming language. I am designing a syntax to implement queries. Currently this is how it works. The database is accessible through entity object. on this sample I have ...
2
votes
3answers
663 views

Using a database for each module in a system [duplicate]

I was reading this question: I was trying to standardize and modularize some functions (Email Management Module, CMS Module & etc) by implementing a 3-tier architecture concept where each ...
1
vote
1answer
215 views

Is there a name for this kind of database constraint? “Functional foreign key”? And is it a good idea?

Say we want to enforce that a table represents a tree. I have found this method for doing so: create table tree ( id integer[] primary key, parent integer[] references tree (id), item text not ...
2
votes
2answers
144 views

Should I check integrity in my application code or defer to the database? [duplicate]

At work we have a lot of code like this (pseudocode): response form_submit(string username, string password) { if ( username == "" || username.contains(invalid_chars) || password.length ...
1
vote
0answers
163 views

Designing a loosely coupled app -> stored proc interface for PostgreSQL. A couple of questions

I am in the middle of designing a next generation database access class for one of the programs I am building. We use PostgreSQL exclusively. Our current approach is procedural (largely inspired ...
132
votes
13answers
69k views

Why use a database instead of just saving your data to disk?

Instead of a database I just serialize my data to JSON, saving and loading it to disk when necessary. All the data management is made on the program itself, which is faster AND easier than using SQL ...
3
votes
4answers
459 views

Plugin Architecture: How to Handle Databases and Logging?

I am in the process of designing an architecture for a plugin based application and I have some questions about how to handle database access and logging. The goal of my application is to allow a ...
2
votes
2answers
769 views

Moving from local storage to a remote database: how should I cache the data locally?

I have a .NET (C#) application that I am releasing soon, which also has some support files. Right now I am storing those files as .txt files, and I update them as necessary whenever the application ...
1
vote
1answer
168 views

Testing interaction with large CRM database

In our company we have two large systems, basically they are scoring and CRM. Both have large SQL Server databases running on Windows servers on the intranet. These two databases are managed by other ...
2
votes
1answer
478 views

Domain Driven Design with an EAV database model

How can one apply DDD to a EAV database model? Consider this EAV database model: How am I supposed to build a domain model if all my entities and their attributes will be stored in the database? ...
1
vote
1answer
446 views

Database data structures for RESTful api

I am creating a RESTful API. I am struggling to decide on the best way to design my database tables around my resources. Initially, I though a table per resource would be a good way to go, but I'm ...
1
vote
1answer
384 views

Table scaling with partitions or with separate databases?

Let's say I have a table (let's call it BigTable) which could experience 5,000,000 INSERTS per day (with possibly just as many SELECTs). Each row inserted is about 50kb. These daily INSERTs are ...
1
vote
1answer
56 views

Multiple Display of a Document and persist each viewer change in a single document

i have a scenario where i have to make available a document for viewing and editing to multiple users, the users can edit and view the document at the same time. Now the problem arises here if for ...
7
votes
5answers
5k views

Database connection - should they be passed as parameter?

We have a system whereby the database connection is get once using a common method, and being pass throughout the relevant class to be used. There are doubts that passing the database connection as a ...
5
votes
1answer
642 views

Entity Framework as a type checking/verification system for database code

When I read pro and con lists of using Entity Framework (or any modern ORM really), I'm surprised that the following point doesn't arise (self quote): Using strongly-typed domain entities allows ...
3
votes
4answers
323 views

Senior team members want to move query-relevant persistent data from DB to cache. Does this make sense?

I am a young engineer recently employed at a small company that sells products to the general public. We use Ruby On Rails and MySQL. Our database has a lot of customer data, but a great deal more of ...
5
votes
1answer
190 views

What is the common approach to component template databases?

My Project: I have employees who are required to go through a checklist when they encounter a duck, a cat, and a human. In our business, we have a set number of ducks, cats, and humans that come in ...
1
vote
3answers
358 views

Single-Tenant Databases - creating and updating new tenants via PHP

We've built a single-tenant webapp in PHP and as it stands each hosted 'site' has its own database. However we need to be able to run a script to create their database, assign a mysql user, and ...
19
votes
9answers
2k views

In agile development, should I try persistence in flat file before database?

Somebody explained to me that since in agile development, policy and the application logic should be more important than details such as persistence method, persistence decision should be taken at the ...
3
votes
2answers
2k views

Why is NoSQL better for this scenario?

Hypothetical scenario: Let's say we are downloading JSON from Facebook with details of a user's friend's checkins, posts, etc... These come in as one document per friend per activity, so with 8 ...
4
votes
2answers
445 views

Do I really want a dynamic Enum, or something else? Better caching? A Struct?

This question is asked on SO and this site often it looks like. "How do I do a dynamic enum?" Answers range from you shouldn't to possible compile time solutions. Now my question is do I want a ...
3
votes
2answers
1k views

Scalability: How does splitting a database table work on different replicated SQL Servers?

I would like to know more about the general concepts behind dividing data of a database into different servers. For example, suppose I have a SQL Server database which has a massive table. Assume one ...
5
votes
1answer
235 views

What is “the right way” to do search on a website?

I'm talking the kind of search that auto-suggests your query as you type, the way Google does, the way Wikipedia does, the way Stack Exchange suggests other questions as you type the title, etc. And ...
4
votes
2answers
2k views

Why shouldn't you use JDBC in Java applets?

I've heard people saying usage of JDBC (Java Database Connectivity) isn't recommended in Java applets. All I they say is: 'because of the security reasons'. What 'security reasons' do they mean? What ...
2
votes
1answer
310 views

Is Neo4j graph database sufficient to itself for all query types? [closed]

Neo4j eases relationship traversals => especially useful for a social network for instance. But are there any scenarios when it's advised to associate an additional relational database (or other ...
1
vote
2answers
241 views

Referential integrity in a database where tuples are not physically deleted

Many modern Relational Database Management Systems automatically support referential integrity, i.e. when you try to delete a tuple which has a reference (in the form of foreign key, for example), the ...
5
votes
3answers
315 views

Establishing an API to provide end-user apps/scripts access to multiple types of databases

Question and Context I am currently working on a project where the main question is, how do we insert an API between the database and end-users who may develop applications/scripts of their own that ...
11
votes
4answers
11k 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 ...
2
votes
2answers
796 views

Data representation with C# and WPF

I'm developing an application handling DB parts. I retrieve the data from the DB with stored procedures and prepared statements. Now I want to display the data in the GUI. What is the current ...
13
votes
6answers
2k views

Do You Still Need Indexing After Database Normalization

After you have done a good normalization, do you still need to index the table? How is this going to affect the performance? Will it even affect the performance in some way after a good normalization? ...
7
votes
2answers
6k views

Are these SQL concepts for beginners, intermediate, or advanced developers? [closed]

I've been learning SQL recently and practicing with MySQL/Postgres and soon Oracle DB. I've also search the web for a 'road map' study of databases but couldn't find one, unfortunately. I want to ...
3
votes
6answers
710 views

Should a database table(s) structure match its intended data structure(s) in the logic?

This question branches out of this question, What are the differences between algorithms using data structures and algorithms using databases?. The General Question Should a database table(s) ...
8
votes
4answers
3k views

What are the differences between algorithms using data structures and algorithms using databases?

The General Question What are the differences between algorithms using data structures and algorithms using databases? Some Context This is a question that has been bugging me for some time, and I ...
2
votes
1answer
128 views

Reporting and handling asynchronous process errors to a client

I have a product with two separate applications. The core of the product lives in the database (oracle) and runs according to a schedule. The other is a client application (currently ASP.NET MVC3) ...