Breaking News: Grepper is joining You.com. Read the official announcement!
Check it out

Comparison between 2PC and TC/C

Sumit Rawal answered on May 21, 2023 Popularity 1/10 Helpfulness 1/10

Contents


More Related Answers

  • Communication between two programs in c language
  • Comparison between TC/C and Saga

  • Comparison between 2PC and TC/C

    0

    Table 3 shows that there are many similarities between 2PC and TC/C, but there are also differences. In 2PC, all local transactions are not done (still locked) when the second phase starts, while in TC/C, all local transactions are done (unlocked) when the second phase starts. In other words, the second phase of 2PC is about completing an unfinished transaction, such as an abort or commit, while in TC/C, the second phase is about using a reverse operation to offset the previous transaction result when an error occurs. The following table summarizes their differences.

    First Phase Second Phase: success Second Phase: fail

    2PC Local transactions are not done yet Commit all local transactions Cancel all local transactions Cancel all local transactions

    TC/C

    All local transactions are completed, either committed or canceled

    Execute new local transactions if needed

    Reverse the side effect of the already committed transaction, or called “undo”

    Table 3 2PC vs TC/C

    TC/C is also called a distributed transaction by compensation. It is a high-level solution because the compensation, also called the “undo,” is implemented in the business logic. The advantage of this approach is that it is database-agnostic. As long as a database supports transactions, TC/C will work. The disadvantage is that we have to manage the details and handle the complexity of the distributed transactions in the business logic at the application layer.

    Popularity 1/10 Helpfulness 1/10 Language whatever
    Source: Grepper
    Link to this answer
    Share Copy Link
    Contributed on May 21 2023
    Sumit Rawal
    0 Answers  Avg Quality 2/10


    X

    Continue with Google

    By continuing, I agree that I have read and agree to Greppers's Terms of Service and Privacy Policy.
    X
    Grepper Account Login Required

    Oops, You will need to install Grepper and log-in to perform this action.