각한 문제가 발생할 수 있다. 일반적으로 사람들이 고려하는 첫 번째 선택지는 여전히 단일 트
랜잭션을 사용하지만 여러 프로세스에 걸쳐 있는 분산 트랜잭션을 사용하는 것이다. 앞으로 살
펴보겠지만, 불행히도 분산 트랜잭션은 올바른 방향이 아닐 수 있다. 분산 트랜잭션을 구현하
는 가장 일반적인 알고리즘 중 하나인
2
단계 커밋을 통해 분산 트랜잭션과 관련된 문제를 전반
적으로 살펴보자.
6.26.2
분산 트랜잭션 - 분산 트랜잭션 -
22
단계 커밋단계 커밋
2단계 커밋2단계 커밋
Two
-
Phase
Commit
알고리즘알고리즘
(줄여서 ‘
2PC
’라고도 함)은 전체 작업의 일부로 여러 개별 프
로세스를 업데이트해야 하는 분산 시스템에서 트랜잭션을 변경할 수 있는 기능을 제공하려는
시도로 자주 사용된다. 분산 트랜잭션, 그리고 더 구체적으로
2
단계 커밋은 마이크로서비스 아
키텍처로 전환하는 팀이 자신들이 직면한 문제를 해결하는 방법으로 자주 고려된다. 앞으로 살
펴보겠지만,
2
단계 커밋은 문제를 해결할 수도 있고 아니면 시스템에 더 많은 혼란을 가져올지
도 모른다.
2PC
는 투표
voting
단계와 커밋
commit
단계라는 두 단계(그래서
2
단계 커밋이다)로 나뉜다.
투표 투표
단계단계
에서 중앙 조정자
coordinator
는 트랜잭션에 참가할 모든 워커
worker
에 연락하고 일부 상태 변경
이 가능한지 여부를 확인 요청한다. [그림
6
-
3
]에는 ...
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.
O’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
I wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
I’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
I'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.