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

learn more… | top users | synonyms (1)

1
vote
1answer
231 views

Editing files without race conditions?

I have a CSV file that needs to be edited by multiple processes at the same time. My question is, how can I do this without introducing race conditions? It's easy to write to the end of the file ...
3
votes
1answer
249 views

Where should the database and mail parameters be stored in a Symfony2 app?

In the default folder structure for a Symfony2 project the database and mail server credentials are stored in parameters.yml file inside ProjectRoot/app/config/parameters.yml with these default ...
2
votes
3answers
181 views

How long should I wait to autosave user input?

I have a table where a User can edit data by simply choose a field, then edit its value. I want to fire an update function to automatically save the data to a MySQL database. However, I think that ...
3
votes
1answer
182 views

Best way to rename existing unique field names in database?

I have a database table that contains id, filename, userId id is unique identifier filename should also be unique table may contain >10000 records When a user uploads a file it should be ...
2
votes
2answers
826 views

Database model for keeping track of likes/shares/comments on blog posts over time

My goal is to keep track of the popular posts on different blog sites based on social network activity at any given time. The goal is not to simply get the most popular now, but instead find posts ...
2
votes
2answers
241 views

Implementing set of processes in a stored procedure or through the code?

I want to know what's the suitable method to implement the following case (best practice). If i make a set of processes like this: select data from set of DB tables. loop on the selected result. ...
5
votes
4answers
223 views

Get Info From Database, or Build Inferred Info?

Does it make more sense to store and retrieve properties or information directly related to an item in a database, or, say in such a case that a product's ID could describe information about it, ...
2
votes
2answers
91 views

Designing a user-defined list to be stored in a relational database - Should I include user index?

By index, I mean, as the user creates the list, each item receives an integer index for its place in that particular list. Since there will be a table of ListItems, I'd prefer to avoid using the name ...
0
votes
1answer
151 views

What is the disadvantage of using abstract class as a database connectivity in zend framework 2 instead of service locator

If I use database by creating adapter with drivers, initialize it in some abstract class and extend that abstract class to required model. Then use simple query statement. Like this: namespace ...
3
votes
2answers
117 views

Handling changes to data types and entries in a database migration

I'm fully redesigning a site that indexes a number of articles with basic search functionality. The previous site was written about a decade ago, and I'm salvaging about 30,000 entries with data ...
2
votes
0answers
95 views

Would a model like this translate well to a document or graph database?

I'm trying to understand what types of models that I have traditionally persisted relationally would translate well to some kind of NoSQL database. Suppose I have a model with the following ...
3
votes
2answers
4k views

Building a database class in PHP

I wonder if I should write a database class for my application, and if so, how to accomplish it? Over there on SO, a guy mentioned it should be written as an abstract class. However, I can't ...
1
vote
2answers
2k views

Storing large data in HTTP Session (Java Application)

I am asking this question in continuation with http-session-or-database-approach. I am planning to follow this approach. When user add product to cart, create a Cart Model, add items to cart and ...
1
vote
2answers
121 views

Configurable tables in sql database

I have the following tables in my database: Config Table: ====================================== Start_Range | End Range | Config_id 10 | 15 | 1 ...
1
vote
2answers
378 views

Should I close database connections after use in PHP?

I wonder if I should close any unnecessary database connection inside of my PHP scripts. I am aware of the fact that database connections are closed implicitly when the block stops executing and ...
7
votes
1answer
972 views

Is inline SQL still classed as bad practice now that we have Micro ORMs?

This is a bit of an open ended question but I wanted some opinions, as I grew up in a world where inline SQL scripts were the norm, then we were all made very aware of SQL injection based issues, and ...
3
votes
1answer
80 views

An extensible logging architecture for Android?

The end goal is to have a variety of data sets that can all be graphically plotted against eachother. All data should correspond to a date, so that when plotted against each other, they show the ...
0
votes
0answers
54 views

How to mitigate security risks when deploying a database to the web via automated migrations?

I'm looking at using built in database migrations frameworks (such as the migration framework included in EF Code First or migratordotnet) but I have concerns about the implications of allowing a ...
1
vote
3answers
242 views

How do the blogging sites or sites that host prose like contents store the data? [closed]

How do the blogging sites, Q&A sites (or any other sites host prose like content) store their data? That is, how do you store blogs and Q&A content in the database? I hope it is not good to ...
2
votes
1answer
144 views

content fingerprint algorithm

I have a database containing just simple URLs. It is as simple as it sounds for now and URL can link to a website or a document(i.e. anything parseable to text). Now I have a simple code which ...
7
votes
4answers
482 views

What exactly does it mean that storing “large blobs in the database reduces performance”?

To someone who knows database internals this may be an easy question, but can someone explain in a clear way why storing large blobs (say 400 MB movies) in the database is supposed to decrease ...
2
votes
2answers
228 views

How does aggregation work when databases are involved?

So I'm reading a book on Design Patterns (Design Patterns Explained 2nd Edition), and all throughout the book it says to "favor aggregation over inheritance". I'm trying to wrap my head around trying ...
6
votes
2answers
243 views

How does datomic handle “corrections”?

tl;dr Rich Hickey describes datomic as a system which implicitly deals with timestamps associated with data storage from my experience, data is often imperfectly stored in systems, and on many ...
0
votes
3answers
153 views

Modeling a Student Application/Committee Relationship

I'm developing an ERD for a graduate student manager program (it's for a university class, so it's a fairly trivial implementation). In this snippet of the model, I'm trying to work out the ...
1
vote
1answer
211 views

Unit-testing databases: test all possible permutations of read and write to table?

I am testing a resource management class that is interacting with a database or a file system, or a combination of both. I was wandering if it is the norm to test all possible permutations of read and ...
3
votes
4answers
2k views

Web App vs. Desktop App Regarding Deployment

I'm taking on an opportunity for a local business to develop a small, simple timesheet manager (they still record time by hand) and am currently in the planning phases. It will include basic ...
4
votes
2answers
378 views

Deduplication of complex records / Similarity Detection

I'm working on a project that involves records with fairly large numbers of fields (~15-20) and I'm trying to figure out a good way to implement deduplication. Essentially the records are people along ...
1
vote
2answers
193 views

Pattern / methodology for representing large database records as objects

A bit of background information: We have an old database application written in Access that lets users monitor their workload, and the code is... 'procedural' might be too kind. The vast majority of ...
1
vote
1answer
169 views

How should I handle two crons that update the database?

I'm working on a Bitcoin-clone block explorer (specifically Mincoin) which has a block timer of about 1 minute. For those unfamiliar with Bitcoin, basically a new data structure called a block is ...
2
votes
1answer
121 views

What is the preferred strategy for editing data from a database?

We are redesigning an old VB6 application in Net. The application makes extensive use of a database and includes management of club members and their results in the competitions that they partake in. ...
1
vote
1answer
149 views

How to Track File Uploads and Return Upload Status with REST?

The users for our software will want to upload potentially large amounts of files in bulk to our servers. It is then desired that we display the upload status any time the user views the upload ...
1
vote
2answers
2k views

Using Autoincrement Primary keys as Foreign Keys

When creating a table, there is an option for us to set the numeric primary key as autoincrement where it's value increases whenever a new data in inserted. This primary number can be used for ...
1
vote
1answer
315 views

Immutable Data Structure For Time Series Data

I'm wondering what the best data structure (for storing data on disk) is for storing immutable time-series data (99% of the data is truly immutable, the 1% is metadata that is separate from the ...
0
votes
1answer
142 views

Best practices when dealing with lots of empty table columns?

I have a schema that allows for multiple post types in my Django project (kinda like Tumblr). Users can make Posts of different types. One of those types is a photo, which I'll want the EXIF data for. ...
-1
votes
1answer
5k views

2 hour interview question for a senior software engineer [closed]

what kind of a question should be asked to test the programming and DB knowledge of a developer ? i am guessing 2 hours practical would be fine. This is for a senior PHP resource and can anybody ...
0
votes
0answers
79 views

Fixing data duplication in two similar tables in different databases

I'm currently doing maintenance on an old order system that has grown into the poster child for bad coding practice. One of the tings I'm dealing with is a lot of data duplication, which I want to ...
0
votes
1answer
151 views

Geographically Distributed (Data & App) Architecture

Is there any design patterns (or best practices) for implementing a geographically distributed system (mostly a database)? Description: There is a network of warehouses and a central office. Now I ...
2
votes
3answers
249 views

How to insert a database layer in PHP

I maintain and add features on a freelance basis to a website written in PHP. The application was started in PHP4 by a junior programmer back in 2006, and features some very insecure and ...
1
vote
2answers
140 views

Optimize database interaction through VPN

I have to develop a batch procedure with VB.NET. This simple procedure is going to read some data from a MS SQL database, execute some elaborations and the write the results on another Oracle SQL ...
2
votes
1answer
136 views

Incremental seek on MySQL result

When outputting data in a large file, I try to make it a habit to incrementally output data in chunks, to prevent reading the entire large file into memory. As an example to show what I mean: $fp = ...
0
votes
2answers
885 views

Entity Framework designer not effective anymore

At my current workplace, Entity Framework 5 is used for all data access/manipulation. It is a database-first approach using the model designer to add/edit/delete/update entities. Problem We now ...
0
votes
2answers
194 views

Best practices for rotating large datasets?

[edit]Turns out there's 1.5 million records... The SQL database is taking about 17-20 seconds to run the query. Would it be best to have Java handle the joins and rearranging in that case? Since this ...
1
vote
3answers
329 views

Should you write automated tests to check that data is correct (the contents of config files, databases, etc.)?

Simply put: is there a best practice for whether developers should write automated tests to check that data is correct (the contents of config files, databases, etc.)? If so, what is it? Assume that ...
1
vote
1answer
151 views

What's the best approach to building a db schema for profile, but to track changes?

I'm working on a site where companies can create a profile then add locations for each profile. Those first two tables are simple enough. But any changes to their profiles or locations have to go ...
4
votes
2answers
784 views

Logic design question for SQL query

Was wondering if you could help me on a SQL problem I’m having. I have a set of records of events where each event has a start time and end time. No event has the same start time, and the end time ...
3
votes
5answers
926 views

When should use of database be preferred over parsing data from a text file?

I was making a Python program to measure the growth of codereview.SE. My approach was to get the "Site stats" shown on the front page and store them on my hard drive. I plan to do this once every day. ...
0
votes
2answers
216 views

How can I conceptually model a craigslist search?

I'm trying to understand how something like this works, but I'm inexperienced and I'm trying to understand how the process would work. Say you have ten categories, a thousand zip codes, and ten ...
-4
votes
3answers
401 views

Is it a row or a record (or a tuple)

If I look at a database table for editing - is it made up of rows or records? If I write some sql and then look at the result is this made up of the same elements as the answer to 1.? Is it the case ...
0
votes
2answers
155 views

Should model / table names be as generic as possible?

When naming a model, should the name be as generic as possible-- even if that won't be the name displayed to users? For example let's imagine a Django model for liking another user's posts. Does it ...
5
votes
2answers
96 views

Tracking changes to posts

I'm currently in the process of writing a support ticket system... Let's say it's a small forum application, or something like Uservoice. Now I want my users to be able to edit their tickets, but ...