Skip to content
  • Recent
  • Categories
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (Yeti)
  • No Skin
Collapse

FastQA

  1. Home
  2. Categories
  3. Interview Questions
  4. How do you handle distributed transactions in a banking system?

How do you handle distributed transactions in a banking system?

Scheduled Pinned Locked Moved Interview Questions
backend engineerdevops engineersoftware architectdatabase administratorfull stack developer
1 Posts 1 Posters 22 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • fastqaF Offline
    fastqaF Offline
    fastqa
    wrote on last edited by
    #1

    Managing distributed transactions in a banking system involves ensuring data consistency and integrity across multiple services and databases. Here are some key strategies:

    Two-Phase Commit (2PC)

    • Prepare Phase: Each participating service prepares to commit and locks the resources.
    • Commit Phase: If all services are ready, they commit the transaction; otherwise, they roll back.

    Sagas

    • Choreography: Each service updates the transaction and triggers the next step. If a step fails, compensating transactions are triggered to undo previous steps.
    • Orchestration: A central coordinator manages the transaction steps and handles compensations if needed.

    Eventual Consistency

    • Event Sourcing: Changes are logged as events, and the system eventually reaches consistency.
    • CQRS: Command Query Responsibility Segregation separates the read and write models, allowing for eventual consistency.

    Common Pitfalls

    • Network Latency: Can lead to timeouts and inconsistencies.
    • Partial Failures: Handling failures in one part of the system without affecting the entire transaction.

    Use Cases

    • Fund Transfers: Ensuring money is debited from one account and credited to another.
    • Loan Processing: Coordinating between multiple services for credit checks, approvals, and disbursements.
    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Recent
    • Categories
    • Tags
    • Popular
    • World
    • Users
    • Groups