Optimistic concurrency

Optimistic concurrency allows the concurrency conflict to occur and the application should respond appropriately, as mentioned in the following list:

  • Tracking the changes on every property/column of an entity, which allows us to persist changes without affecting the stale data in the database, provided both the changes were performed in different properties
  • Prevents the changes from being updated, by highlighting the current value from the data store and allowing the user to revisit his data for further persistence
  • Overwrite the changes with the latest ones, and ignore the updated data in the data store

Optimistic concurrency could be adopted in an application that is more focused on performance and only during conflicts; the user would be spending additional time. This ensures that the time is spent wisely on most occasions, since we do not have any overhead for regular operations. The trade-off in the optimistic concurrency approach is that we are leaving the developers and the users to handle conflicts and store appropriate data stored in the database.

We have learnt about optimistic concurrency; let's look into pessimistic concurrency in the next section.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset