Chapter 17. Implementing Concurrency Control
There is no I in agile. ;-)
Assume that you and I both read the same row from the Customer table, we both change the data, and then we both try to write our new versions to the database. Whose changes should be saved? Yours? Mine? Neither? A combination? Similarly, if we both work with the same Customer object stored in a shared object cache and try to make changes to it, what should happen? Concurrency control deals with the issues involved with allowing multiple people simultaneous access to shared entities, be they objects, data records, or some other representation. To understand how to implement concurrency control within your system you must start by understanding the basics of collisions — you can either avoid them or detect and resolve them. The next step is to understand transactions, which are collections of actions that potentially modify one or more entities. Examples of transactions include the transfer of funds between two bank accounts, the updating of all employee salaries to give them a 5 percent cost of living adjustment, and the updating of a customer's home phone number. In the case of the transfer, the transaction consists of debiting the source account, crediting the target account, and recording the fact that this occurred.
As you can see, modern software-development projects demand that concurrency control and transactions be not simply the domain of databases, but rather be issues that are potentially pertinent ...
Get Agile Database Techniques: Effective Strategies for the Agile Software Developer now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.