Skip to Content
Acing the System Design Interview
book

Acing the System Design Interview

by zhiyong tan
January 2024
Intermediate to advanced
472 pages
15h 11m
English
Manning Publications
Content preview from Acing the System Design Interview

Appendix D. Two-phase commit (2PC)

We discuss two-phase commit (2PC) here as a possible distributed transactions technique, but emphasize that it is unsuitable for distributed services. If we discuss distributed transactions during an interview, we can briefly discuss 2PC as a possibility and also discuss why it should not be used for services. This section will cover this material.

Figure D.1 illustrates a successful 2PC execution. 2PC consists of two phases (hence its name), the prepare phase and the commit phase. The coordinator first sends a prepare request to every database. (We refer to the recipients as databases, but they may also be services or other types of systems.) If every database responds successfully, the coordinator then sends ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Designing Data-Intensive Applications

Designing Data-Intensive Applications

Martin Kleppmann
Prompt Engineering for LLMs

Prompt Engineering for LLMs

John Berryman, Albert Ziegler

Publisher Resources

ISBN: 9781633439108Publisher SupportPublisher WebsiteSupplemental ContentErrata PageOtherPurchase Link