Maintaining data concurrency in an "Ajax" environment
22 Mar 2006 - 6:01pm
10 years ago
I'm working on a thin client application which will be used by
multiple users concurrently and I'm having problems wrapping my head
around how we'll address overwriting of data that's being edited by
another user. Since this application will be using a lot of Ajax-type
interactions it will allow users to change individual attributes of
objects. In this case, the objects are financial data, so making sure
the user knows what the most up-to-date value (OR correct value --
these are two distinct options) is is of very high importance. A very
Users A and B happen to be looking at the same object (a transaction)
for which they'd both like to change an attribute (transaction date).
The application is built so that the user who's looking at the
transaction details can double-click to edit the attribute and
directly save the change. If both users elect to edit at the same
time, but user A saves first how can we be sure what the system will
do with user B's save?
Or another scenario, if neither user has started editing the
attribute. If user A edits the attribute and saves the change before
user B double-clicks to change the attribute then does user B, when
they're shown value to edit, see the value they expect to be there or
do they see the value that user A had entered?
Is some kind of system polling a possible answer? One where the
system checks for value changes in the background and alerts the user?
This sounds pretty expensive in terms of bandwidth. Or should the
user have to "Refresh" in some way to get the latest and greatest
I'm assuming that we will have messaging to alert the user of any
inconsistencies, but the system still has to perform some kind of
action with the data, whether to accept it or not. I was wondering if
anyone could point me to resources for best practices, etc. in this