O'Reilly logo

Cassandra Design Patterns - Second Edition by Rajanarayanan Thottuvaikkatumana

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 4. CAP Patterns

 

"Your Coffee Shop Doesn't Use Two-Phase Commit"

 
 --Gregor Hohpe

Those who have worked on database applications will be familiar with two-phase commit. Whenever there are multiple application elements or components in a distributed system, there are two phases in order to perform an atomic transaction. In the first phase, all the participating components have to say "yes" for the transaction. If all of them say "yes," then in the second phase the changes have to be committed, which completes the transaction. This is an oversimplified description of the two-phase commit.

Note

A transaction is said to be atomic if it cannot be divided further. There is another way to interpret this: If there are multiple steps in a given transaction, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required