2010-04-26 6 views
2

Heres what Im thinking. MongoDB와 같은 무언가를 사용할 때 2 단계 커밋을 에뮬레이트하기 위해이 해결 방법에 문제가있는 것을 보시겠습니까? 각 작업은 원 자성이며 ​​그 밖의 트랜잭션에 대한 지원은 없습니다.MongoDB와의 2 단계 커밋

transaction_scope: 
    read message from servicebus - UpdateCustomerAddress 

    get customer aggregate from docdb, replay events where commited =1 

    call customer.updateAddress 
     validates 
     creates customer address updated event 
     apply event 
     event store as uncommitted events 

    do optimistic concurrency update against docdb pushing uncommitted events (single op     to ensure consistency) 

    publish event to service bus 

    update docdb set events just published to commited = 1 (again one 1 op - at least in mongodb) 

transaction_complete 

NServiceBus 또는 명령 처리기 인프라에서 외부 트랜잭션 범위를 관리하는 모든 것. 내가보기에 우리는 2pc와 거의 동일한 의미를 가져야합니다 -하지만 나는 뭔가를 놓치는 것을 느낍니다.

답변

2

two-phase commit wiki page이 최근에 mongodb 웹 사이트에 추가되었습니다. 2-PC 알고리즘을 설명하고 몇 가지 실패 시나리오에 대해 설명합니다.