Data access strategy for a site like SO - sorted SQL queries and simultaneous updates that affect th
Posted
by Kaleb Brasee
on Stack Overflow
See other posts from Stack Overflow
or by Kaleb Brasee
Published on 2010-05-19T15:06:25Z
Indexed on
2010/05/19
15:10 UTC
Read the original article
Hit count: 242
I'm working on a Grails web app that would be similar in access patterns to StackOverflow or MyLifeIsAverage - users can vote on entries, and their votes are used to sort a list of entries based on the number of votes. Votes can be placed while the sorted select queries are being performed.
Since the selects would lock a large portion of the table, it seems that normal transaction locking would cause updates to take forever (given enough traffic). Has anyone worked on an app with a data access pattern such as this, and if so, did you find a way to allow these updates and selects to happen more or less concurrently? Does anyone know how sites like SO approach this?
My thought was to make the sorted selects dirty reads, since it is acceptable if they're not completely up to date all of the time. This is my only idea for possibly improving performance of these selects and updates, but I thought someone might know a better way.
© Stack Overflow or respective owner