Scrivio Interview library
DesignPrincipal6 min read · updated 12 November 2026

Distributed SQL databases (CockroachDB, YugabyteDB, Spanner) promise relational features with horizontal scale. Should your company adopt one as the new standard OLTP database?

Not as a blanket standard. Most OLTP workloads fit comfortably on one large PostgreSQL node with replicas, so we first identify the few that truly need multi-region writes or scale beyond one node. Distributed SQL brings real trade-offs, higher latency for consistent writes, different performance behaviour and PostgreSQL compatibility gaps, plus licensing models that have changed in recent years, so we pilot it on a real workload with failure tests and adopt it for specific use cases with clear criteria.

Why this question is asked

Distributed SQL databases are attractive because they seem to remove the hardest limit of a traditional relational database: one primary node that handles all writes. Vendors show impressive scaling numbers, and the idea of never sharding by hand again is appealing. Interviewers ask this design question to see whether we can separate a technology's real strengths from the needs of our actual workloads, and make a measured adoption decision. In this answer, we will recap what distributed SQL is, check which workloads need it, look at the trade-offs in latency, behaviour and compatibility, consider cost and licensing, and plan a pilot and an adoption policy.

1A Quick Recap of Distributed SQL

A distributed SQL database splits its data into many small ranges or tablets, spreads them across nodes, and keeps several copies of each range on different nodes, kept consistent by a consensus protocol such as Raft or Paxos. Any node can accept a query; the database routes reads and writes to the right ranges and coordinates transactions that touch several of them. CockroachDB and YugabyteDB speak the PostgreSQL wire protocol (YugabyteDB reuses PostgreSQL's query layer), and Google Spanner offers its own SQL dialect and a PostgreSQL interface.

The benefit is that we can add nodes to add write capacity, survive the loss of a node, a zone or even a region without manual failover, and place data in specific regions. The cost is that every write must be agreed by a majority of replicas, which takes network round trips.

2Which Workloads Actually Need It?

A single modern PostgreSQL server with 64 or more cores, hundreds of gigabytes of RAM and fast NVMe storage can handle tens of thousands of transactions per second and many terabytes of data. With read replicas for read scaling, partitioning for large tables and good indexing, the vast majority of OLTP services never come near that limit. For them, a distributed database adds complexity without solving a problem they have.

The workloads that do benefit are specific. Those that need writes accepted in several regions at once with strong consistency, such as a global inventory or a user directory that must survive a region outage with no data loss. Those whose write volume or data size truly outgrows one large node and would otherwise need application-level sharding. And those with residency needs where rows must live in particular regions but be queried as one database. We look through our inventory and usually find a handful of such cases among hundreds of databases.

Step throughDoes this workload need distributed SQL?
  1. Need writes in several regions with no data loss?region outage survival
    YesCandidate for distributed SQLNoNext question
  2. Will writes or size outgrow one large node?with replicas and partitioning
    YesCandidate, or plan shardingNoNext question
  3. Rows pinned to regions but queried together?residency
    YesCandidateNoPostgreSQL with replicas is enough

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

3The Trade-Offs

Latency is the first. A write in a single-node PostgreSQL commits once it is flushed to local WAL, often in about a millisecond, or a few milliseconds with a synchronous standby in the same region. In a distributed SQL database, a write must reach a majority of replicas; within one region that adds a few milliseconds, and if replicas span regions, each consistent write pays at least one cross-region round trip, often 50 to 150 ms. Transactions that touch ranges on different nodes need extra coordination. Applications with many small sequential writes per request can become noticeably slower.

Performance characteristics also differ. Hot spots appear when many writes target one range, for example with a sequential primary key, so schemas often need different key designs such as UUIDs or hash-sharded indexes. Contention can cause transaction retries that applications must handle; CockroachDB, for example, defaults to SERIALIZABLE isolation and expects clients to retry on serialization errors. And compatibility is not complete: PostgreSQL-compatible systems may lack some extensions, certain functions, triggers, stored procedure features or isolation behaviours, so a migration from PostgreSQL needs testing rather than assumptions (check each vendor's compatibility documentation for your version).

Single-node PostgreSQL versus distributed SQL
AspectPostgreSQL primary + replicasDistributed SQL
Write latency, one regionabout 1 ms local commita few ms, consensus round trip
Write latency, multi-regionasync replicas, or sync with costcross-region round trip per write
Write scalingone primaryadd nodes
Region failurepromote replica, possible data loss if asyncsurvives with majority, no manual failover
Compatibilityfull PostgreSQL, all extensionspartial, check features
Operational familiarityhigh in most teamsnew skills needed

4Cost and Licensing

Distributed SQL usually needs more hardware for the same workload, because every range is stored three or more times and nodes spend effort on coordination. Managed offerings are priced in their own ways, by node, capacity unit or request. Licensing also needs attention: some vendors have changed licences in recent years, for example CockroachDB moved its core features to an enterprise licence model in 2024. A decision to standardise on a product ties the company to its future licensing, so we compare open-source and commercial options and read the current terms carefully.

5Pilot, Then Adopt for Specific Cases

Rather than deciding from documentation, we run a pilot on a real candidate workload. We take a production copy, run the real query mix, and measure p50 and p99 latency for the main transactions, throughput at peak, and cost per transaction against the current setup. Then we run failure tests: kill a node, cut a zone, and simulate a region outage, and measure what the application sees, how long writes stall, and whether any data is lost. We also try upgrades, backups and restores, because operations matter as much as features.

If the pilot succeeds, we adopt distributed SQL as an approved option for workloads meeting clear criteria, such as multi-region writes with an RPO of zero, or projected growth beyond what one node can handle within three years, and keep PostgreSQL as the default for everything else. That gives us the benefit where it matters without paying the latency, compatibility and skills cost across the whole company.

6Follow-up questions

Isn't it simpler to have one standard database for everything?

Simpler to describe, but not to run if the standard is a poor fit for most workloads. Every service would pay higher write latency and compatibility costs to solve a problem only a few have. Two well-supported options with clear criteria are simpler in practice.

What would you do for a service that outgrows one node but does not need multi-region?

Compare distributed SQL with alternatives: vertical scaling, archiving old data, moving reads to replicas, partitioning, or sharding with a tool like Citus. Distributed SQL may well win, but the pilot should compare it with these options.

How do applications need to change?

They should handle retryable transaction errors, avoid sequential hot-spot keys, keep transactions short and local to a region where possible, and be tested for latency with the real topology. ORM-generated SQL should also be checked for unsupported features.

7Conclusion

In this answer, we evaluated distributed SQL as a company standard. We recapped how it spreads ranges across nodes with consensus, identified the few workloads that truly need multi-region writes or more than one node, examined the trade-offs in write latency, hot spots, retries and PostgreSQL compatibility, considered cost and recent licensing changes, and chose to pilot on a real workload with failure tests and adopt it for specific use cases with clear criteria rather than as a blanket replacement.

What to say in the interviewAbout 80 seconds aloud

Open with

I would not adopt it as a blanket standard, but I would consider it for specific workloads. Distributed SQL splits data into ranges replicated with consensus across nodes, so it scales writes and survives node, zone or region loss without manual failover.

Then, if they want more

But most of our OLTP workloads fit easily on one large PostgreSQL node with replicas and partitioning, so first I would look for the few that truly need multi-region writes with no data loss, scale beyond one node, or region-pinned data queried together.

Then I would be clear about the trade-offs: every write needs a majority of replicas, so writes are slower, and across regions each consistent write pays a cross-region round trip; schemas need to avoid hot spots like sequential keys; applications must retry on serialization errors; and PostgreSQL compatibility is partial, so extensions and some features may be missing.

Cost is usually higher because of replication, and licensing has changed for some vendors recently, so I would check current terms. I would run a pilot on a real workload with latency, cost and failure tests including a region outage, and if it passes, adopt it as an approved option with clear criteria while PostgreSQL stays the default.

About this answer

Last updated
12 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 documentation below. 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 "Distributed SQL databases (CockroachDB, YugabyteDB, Spanner) promise relational features...": https://scrivio-interview-library.netlify.app/databases/database-operations/a8f445130b/