Scrivio Interview library
LeadershipPrincipal6 min read · updated 13 November 2026

In your organisation, some teams use distributed transactions across five services for every order, causing latency and outages, while others use events with no reconciliation and finance finds mismatches every month.

As the senior technical leader, what guidance would you set for when to pay for strong consistency and how to keep invariants that span services?

I would make consistency a business decision per invariant: what an inconsistency costs, how long it may last and who notices. Invariants that must hold strongly should live inside one service and one database, by drawing boundaries around data that changes together. Across services, the default is sagas with compensations, idempotent steps and the outbox pattern rather than distributed transactions, and any eventually consistent flow touching money or inventory must include reconciliation. Patterns, reviews and metrics keep this honest.

Why this question is asked

This organisation shows both failure modes at once. Distributed transactions across five services make every order as slow and as fragile as the slowest participant, and events without reconciliation let errors pile up until finance finds them. Neither team is careless; each picked a tool without a rule for when it fits. Interviewers ask this to see whether a senior leader can turn that into guidance that teams can apply. In this answer, we will frame consistency as a business choice, look at why distributed transactions hurt here, describe the saga and outbox patterns that replace them, make reconciliation mandatory where money is involved, and set up the reviews and metrics that keep the guidance alive.

1Consistency Is a Business Decision

An invariant is a rule that must hold, such as 'an order is charged at most once' or 'stock never goes below zero'. For each invariant, the useful questions are: what does a violation cost, how long may it last before someone is hurt, and who notices it? A charged-but-not-shipped order that is fixed within a minute is very different from one that sits for a month.

The answers point to a mechanism. Some invariants must never be violated, even briefly, and need strong consistency. Many can be violated for seconds or minutes as long as they are reliably repaired, and are better served by eventual consistency with compensation and reconciliation.

Choosing a mechanism per invariant
InvariantCost of a brief violationMechanism
Payment captured at most oncehigh, customer charged twiceone service, idempotency key, unique constraint
Stock not oversoldmedium, apology and refundconditional update in the stock service
Order paid -> shipment createdlow if fixed in minutessaga with outbox and retries
Ledger matches payment providerhigh if found at month enddaily reconciliation with alerts

2Keep Strong Invariants Inside One Service

The cheapest strong consistency is a local database transaction. If two pieces of data must always change together, that is a strong hint they belong to the same service and the same database. Drawing service boundaries around those invariants, rather than around nouns in the domain, removes the need for most cross-service coordination.

When a team finds itself needing a distributed transaction for every request, it is often a sign that the boundaries are in the wrong place. Merging two services, or moving a table from one to the other, can be better than coordinating them forever.

3Across Services: Sagas and the Outbox Instead of Distributed Transactions

A distributed transaction, such as two-phase commit across five services, holds locks in every participant until the coordinator decides. Latency becomes the sum of round trips, and availability becomes the product of all five: if each is 99.9 percent available, the order flow is about 99.5 percent. A stuck coordinator can leave locks held for minutes. That explains the latency and outages the first group sees.

A saga instead runs each step as a local transaction in its own service and moves on through events or commands. If a later step fails, earlier steps are undone by explicit compensations, such as refunding a payment or releasing reserved stock. Each step is idempotent, so retries are safe. The outbox pattern makes each step reliable: the service writes its state change and the event to publish in the same local transaction, and a relay, for example Debezium or a polling publisher, sends the event to Kafka afterwards, so no event is lost or sent for a change that rolled back.

SQL
BEGIN;
UPDATE orders SET status = 'PAID' WHERE id = 551; -- 1
INSERT INTO outbox(id, topic, payload)
VALUES ('ev-9c2', 'order-paid', '{"orderId":551}'); -- 1
COMMIT; -- both or neither; the relay publishes ev-9c2 to Kafka later

Notice that the event id travels with the message, so consumers can deduplicate if the relay sends it twice.

4Reconciliation Is Required, Not Optional

The second group's mistake is assuming events always arrive and are always handled correctly. In practice, bugs, poison messages, manual fixes and third parties drift out of step. Any eventually consistent flow touching money or inventory must therefore come with reconciliation: a job that regularly compares the sources of truth, such as orders against payments against the provider's settlement report, raises alerts on differences, and feeds a repair process that a named team owns.

Reconciling daily instead of monthly turns a finance surprise into a small, routine fix list, and the drift rate becomes a quality signal for the flow.

Step throughGuidance for a new cross-service flow
  1. Can the invariant live in one service and database?
    YesUse a local transactionNoTreat it as a cross-service flow
  2. Is a brief, repaired violation acceptable?
    YesSaga with compensations, idempotent steps, outboxNoRedraw boundaries or escalate for review
  3. Does the flow touch money or inventory?
    YesAdd reconciliation with alerts and an ownerNoMonitor lag and dead letters
  4. Review against the published patterns

4 steps in order. Play them, or step through them one at a time.

5Making the Guidance Stick

Guidance works when it is concrete. I would publish the patterns with reference code: an outbox library, a saga example with compensations, an idempotency helper and a reconciliation job template. New cross-service flows would be reviewed against them by the architecture group, and existing distributed transactions would be put on a list to retire, starting with the ones causing outages.

Finally, track the results as metrics: mismatches found by reconciliation, time to repair, the cost of manual fixes, and latency and availability of order flows. Those numbers let teams and leadership see whether the trade-offs are working, and adjust the guidance with data rather than opinion.

6Follow-up questions

How do you retire the existing distributed transactions safely?

One flow at a time, starting with the one that causes the most incidents. First add idempotency keys and an outbox to each participant while the distributed transaction still runs, then add a reconciliation job that compares outcomes. Next run the saga version in shadow mode, recording what it would do, and compare with the real results. When they match over a period, switch traffic gradually with a feature flag, keep reconciliation running, and remove the coordinator only after the new flow has run through a busy period.

Are there cases where you would still allow a distributed transaction?

Rarely: a small number of participants, all in the same data centre, low volume and an invariant that truly cannot tolerate even a brief violation. Even then, I would first try to move the data into one service. If it remains, it needs explicit timeouts, monitoring of in-doubt transactions and a recovery runbook.

What makes a good compensation?

It is a real business action, not a database rollback: a refund, a cancellation, a release of stock, often with a message to the customer. It must be idempotent, it must be possible at any later time, and some actions, like an email already sent, can only be compensated by a follow-up rather than undone.

7Conclusion

In this answer, we saw that consistency should be chosen per invariant based on business cost. Strong invariants belong inside one service and database; cross-service invariants use sagas with compensations, idempotent steps and the outbox pattern instead of distributed transactions; and every eventually consistent flow touching money or inventory needs owned reconciliation. Published patterns, reviews and metrics keep the guidance grounded in data.

What to say in the interviewAbout 80 seconds aloud

Open with

I would start by making consistency a business decision for each invariant: what does a violation cost, how long can it last, and who notices. That tells us which mechanism to pay for.

Then, if they want more

Invariants that must hold strongly should live inside one service and one database, so I would draw service boundaries around data that has to change together; needing a distributed transaction on every request usually means the boundaries are wrong.

Across services, the default would be sagas: each step is a local transaction, steps are idempotent, failures trigger explicit compensations like refunds, and the outbox pattern makes sure events are published exactly when the local change commits. Distributed transactions couple the latency and availability of all five services, which is what is causing the outages.

For any eventually consistent flow touching money or inventory, reconciliation is mandatory: a daily job comparing sources of truth, alerts on drift and an owned repair process, so finance never finds the problem first.

Then I would publish reference implementations, review new cross-service flows against them, retire existing distributed transactions one by one, and track mismatches and repair costs as metrics.

About this answer

Last updated
13 November 2026
Checked
Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the official documentation for the version you use. What the checks cover
Where the question comes from
Written by Scrivio for practice. It is not taken from an interview.
Report an issue with this answer

Copy the line below and send it to the author with what you found. It carries the address of this page.

Issue with "As the senior technical leader, what guidance would you set for when to pay for strong...": https://scrivio-interview-library.netlify.app/architecture/sd-fundamentals/f2e01796c2/