Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm working on a website with typical CRUD web usage pattern: similar to blogs or forums where users create/update contents and other users read the content.

Seems like it's OK to set the database's isolation level to "Read Uncommitted" (dirty reads) in this case. My understanding of the general drawback of "Read Uncommitted" is that a reader may read uncommitted data that will later be rollbacked.

In a CRUD blog/forum usage pattern, will there ever be any rollback? And even if there is, is there any major problem with reading uncommitted data?

Right now I'm not using any replication, but in the future if I want to use replication (row-based, not statement-based) will a "Read Uncommitted" isolation level prevent me from doing so?

What do you think? Has anyone tried using "Read Uncommitted" on their RDBMS?

share|improve this question
add comment

2 Answers

up vote 1 down vote accepted

You can use row based replication safely, but not statement based.

share|improve this answer
add comment

The issue from READ UNCOMMITTED isn't that there might be a rollback - at least, that isn't the main issue. The primary concern is that you might get partial data. For example, using a blog, let's say that you had a summary table containing among other things the number of posts that existed. You also had a table with a row for each post. Obviously I'm making stuff up here - this isn't a structure you should probably ever have.

Anyway, in one thread you start a transaction, update the number of posts in the summary table from 4 to 5, insert a new post row, and commit the transaction. Works perfectly.

In another thread you read the number of posts and display the blog to a single screen. This query (a very fast one) occurred between the UPDATE and INSERT statements. The number of posts is shown as "5" and you have, if you're lucky, 4 blog posts. If you're unlucky in your coding, and actually used the summary number rather than just displaying it, you have an array overflow condition...

In most cases, READ COMMITTED is what you want to provide proper consistency.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.