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

Comparison between TC/C and Saga

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

Contents


More Related Answers

  • Comparison between 2PC and TC/C

  • Comparison between TC/C and Saga

    0

    TC/C and Saga are both application-level distributed transactions. Table 5 summarizes their similarities and differences.

    TC/C Saga

    Compensating action In Cancel phase In rollback phase

    Central coordination Yes Yes (orchestration mode)

    Operation execution order any linear

    Parallel execution possibility Yes No (linear execution)

    Could see the partial inconsistent status Yes Yes

    Application or database logic Application Application

    Table 5 TC/C vs Saga

    Which one should we use in practice? The answer depends on the latency requirement. As Table 5 shows, operations in Saga have to be executed in linear order, but it is possible to execute them in parallel in TC/C. So the decision depends on a few factors:

    If there is no latency requirement, or there are very few services, such as our money transfer example, we can choose either of them. If we want to go with the trend in microservice architecture, choose Saga.

    If the system is latency-sensitive and contains many services/operations, TC/C might be a better option.

    Candidate: To make the balance transfer transactional, we replace Redis with a relational database, and use TC/C or Saga to implement distributed transactions.

    Interviewer: Great work! The distributed transaction solution works, but there might be cases where it doesn’t work well. For example, users might enter the wrong operations at the application level. In this case, the money we specified might be incorrect. We need a way to trace back the root cause of the issue and audit all account operations. How can we do this?

    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.