Azure Cosmos DB vs Azure SQL Database: Where Must the Transaction Hold?

Start with Azure SQL Database when several related records must change together and the business needs to query those relationships in changing ways. Start with Azure Cosmos DB for NoSQL when the busiest operations naturally address a document or a small group of items under a known partition key, especially when regional distribution matters. Both can store structured data. Receiving JSON from a web client settles very little.
Table of Contents
Ask what would make the books wrong
A retailer moves ten units of a product from warehouse A to warehouse B. Under its immediate-transfer rule, it requires the debit, the credit and a transfer record to commit together. In one SQL database, those changes can share a transaction across tables. The team still needs constraints, appropriate concurrency handling and a unique transfer ID so a retry cannot move ten more units.
In a Cosmos DB container partitioned by warehouse ID, the two stock balances belong to different logical partitions. The standard transactional batch API groups operations with the same partition key in one container. Putting both writes into one client request does not extend that boundary. Choosing a stronger read-consistency level does not turn separate writes into an atomic transfer.
A retailer that models goods as “in transit” has a different rule. Separate dispatch and receipt events may then be legitimate business states. That could justify an asynchronous design, but the business must accept those states, including a transfer that stays in transit until someone resolves it.
Ask what the busiest screen knows
| Workload | Likely starting point | Question that could reverse the choice |
|---|---|---|
| Finance closes inventory across warehouses and products | Azure SQL Database | Are the reports actually generated from a separate analytics store? |
| A regional storefront fetches one product projection by market and ID | Cosmos DB for NoSQL | Can the application supply the partition key for nearly every high-volume read? |
| An application accepts variable product attributes | Either | Which attributes need constraints, joins or frequent updates? Flexible fields alone are weak evidence. |
| An operator must immediately see their own update in another client | Evaluate both configurations | Which session and region perform each read? What maximum staleness is acceptable? |
For Cosmos DB, spell out which consistency level meets the reader’s contract, where replicas will live and what happens during failover. For SQL Database, identify the write database, any read replicas and the application’s behavior if the connection drops after a commit. Regional deployments and retries deserve explicit tests on either platform.
Price one successful business operation
Build a small representative dataset with a popular product and a quiet one. Replay a sale, a transfer and a regional stock lookup. Record successful operations, duplicate transfer attempts, tail latency, stale reads and total cost over the same interval. On Cosmos DB record request charges and throttling by partition. On SQL Database record compute usage, waits and the execution plan of the expensive query. Include replicas, storage and the cost of any extra read model.
For a pilot handling 100,000 successful lookups, divide the cost attributable to serving those lookups by 100 to express cost per thousand. Keep writes and background work visible as separate line items or explicitly allocate them. A cheap lookup achieved by an expensive hourly rebuild is easy to misprice.
When using both services earns its keep
The retailer could keep its inventory ledger in SQL Database and publish product availability into Cosmos DB. The ledger owns stock. The storefront shows a projection with a stated freshness target. That adds work: updates need a durable delivery mechanism, a replayable identifier, a way to measure lag and a process to rebuild the projection. Start with one database if it meets both requirements. Add the second when the measured reading workload justifies those responsibilities.
For the underlying mechanics, see how Cosmos DB routes a point read and how SQL Database protects a relational booking.
Sources and further reading
Recent articles
Our editorial approach
Clear explanations, practical guidance and responsible research.





