Azure Cosmos DB vs CockroachDB: which fits your workload
Choose Azure Cosmos DB if your applications already run on Azure and need several data models, including document, vector, key-value, graph and table, behind one managed service. Choose CockroachDB if you need distributed SQL and can accept the CockroachDB Software License, which covers every release from 24.3.0 onward. The decision turns on three questions: what shape your data takes, where it must physically live, and how much database operation your team is willing to carry. Settle those before you weigh price, because license terms and billing models only matter once the workload fits.
Start with the data model and the access patterns. Azure Cosmos DB covers document, vector, key-value, graph and table models in one service, with a change feed and integrated vector and hybrid search, so it suits applications that mix those models under one roof. CockroachDB gives you a relational SQL schema with distributed transactions, which suits systems where joins and multi-row consistency matter more than model variety. Confirm which APIs and SDKs your services call today, whether any code depends on Cosmos DB request unit tuning, and which SQL features and drivers your services need. Map that inventory against both options, and plan for application changes, not only the data copy.
Data location and operations often settle the question. The published Azure Cosmos DB documentation describes no self-hosted edition, so if a residency rule requires your own data centers or an air-gapped network, confirm in writing with Microsoft whether it can be met. CockroachDB can run self-hosted or as a cloud service, but a self-run cluster puts upgrades, backups and failover testing on your team. Cosmos DB's multi-region writes carry a 99.999% availability SLA, and that is the operating load you would otherwise build yourself. Before you choose CockroachDB, read the licensing FAQ on the Enterprise Free terms, which are free for businesses under $10M in annual revenue, counting affiliates, and must be renewed every year. Cockroach Labs also stated in a September 15, 2026 post that new source code versions will no longer be published to its public repository, so ask how patches will reach a self-run cluster.
Which product fits which scenario
This table maps common scenarios to the platform that fits better and explains why. Read the last column first, because it names the condition that would change the answer, such as a need to self-host or to run relational transactions. Neither product wins every case, so match each row to your workload, regions and compliance constraints.
| Scenario | Better fit | Why | What would change the answer |
|---|---|---|---|
| Relational transactions across several tables | CockroachDB | Distributed SQL with relational schemas and transactions. Azure Cosmos DB centers on NoSQL, vector, key-value, graph and table models. | A workload that fits a document model read mainly by partition key favors Azure Cosmos DB. |
| Must run outside Azure or on your own hardware | CockroachDB | Self-hosted under the CockroachDB Software License. Azure Cosmos DB is an Azure-only service with no self-hosted edition. | A requirement to stay inside Azure with Microsoft operating the service keeps Azure Cosmos DB in scope. |
| Multi-region writes with managed failover on Azure | Azure Cosmos DB | Microsoft documents multi-region writes with a 99.999% availability SLA and automatic failover. | Needing direct control of failover design, or SLA terms that do not match your recovery targets. Confirm both with Microsoft. |
| Small Azure workload that starts on a free tier | Azure Cosmos DB | Lifetime free tier of 1000 RU/s and 25 GB storage, per Microsoft. Serverless bills only consumed RUs plus storage. | Needing several regions, since serverless accounts run in one region and cannot add regions after creation. |
| Local development and testing | Azure Cosmos DB emulator | Free local emulator intended for development and testing only. | Targeting CockroachDB in code. Then test against a local CockroachDB instance that matches your production version. |
| Team wants the vendor to operate the database | CockroachDB Cloud | Priced per vCPU-hour. Cockroach Labs' pricing page lists Standard at $0.092 and Mission Critical at $0.162 per vCPU-hour. | Data residency or exit rules that require self-hosting. Confirm current rates and regions before comparing. |
| Self-hosting for a business under $10M annual revenue | CockroachDB | Enterprise Free license costs nothing for businesses under $10M annual revenue, counting affiliates, per Cockroach Labs' licensing FAQ. It must be renewed yearly. | Revenue, including affiliates, reaching that threshold, which moves you to a paid Enterprise license. Paid licenses are never throttled. |
How the decision path splits between the two products
The path starts with one question: must the database run outside Azure? If it must, the next question is whether the workload needs relational SQL. Relational SQL points to CockroachDB, which is available as self-hosted software under a proprietary license or as a cloud service. Non-relational workloads in that branch lead to the self-hosted routes covered later on this page, because Azure Cosmos DB has no self-hosted edition. If Azure placement is acceptable, the path asks which data model the workload uses. Document, key-value, graph, table and vector models point to Azure Cosmos DB, while relational SQL points to CockroachDB.
Routes split first on Azure placement, then on relational SQL or other data models.
Azure Cosmos DB vs CockroachDB capabilities side by side
This table compares Azure Cosmos DB and CockroachDB on the capabilities that usually drive a migration decision: data model, search, change capture, backup, analytics, availability, deployment and licensing. Where a cell says to confirm, check Cockroach Labs' documentation against your version and deployment type before you decide. The main takeaway is that Cosmos DB is a managed Azure service with documented features, while CockroachDB is a self-hosted or cloud database whose feature parity needs verification.
| Capability | Azure Cosmos DB | CockroachDB |
|---|---|---|
| Data model | Document, vector, key-value, graph and table models in one service | Distributed SQL database with relational tables and SQL transactions |
| Vector and hybrid search | Integrated vector and hybrid similarity search using DiskANN | Confirm vector search support and index options in Cockroach Labs' documentation |
| Change feed | Built-in change feed, listed in Microsoft's documentation | Confirm change data capture options and delivery behavior in Cockroach Labs' documentation |
| Continuous backup and point-in-time restore | Continuous backup with point-in-time restore, per Microsoft's documentation | Confirm backup and point-in-time restore options for your deployment type |
| Analytics mirroring | Azure Synapse Link or Microsoft Fabric mirroring, without ETL | Not covered here; confirm analytics export options with Cockroach Labs |
| Multi-region writes and availability | Multi-region writes with a 99.999% availability SLA, per Microsoft's documentation | Confirm multi-region write topology and availability terms for your chosen deployment |
| Deployment scope | Azure service only; no self-hosted edition, though a local emulator exists for testing | Self-hosted or as CockroachDB Cloud, a managed service from Cockroach Labs |
| License and billing | Proprietary Microsoft service; capacity billed in request units (RUs) | CockroachDB Software License for 24.3.0 onward; free Enterprise license under $10M annual revenue, renewed yearly |
| Source code access | Closed managed service; no source code to self-host | New versions no longer published to the public repository, per Cockroach Labs' September 15, 2026 blog |
Azure Cosmos DB vs CockroachDB pricing: how each bill is built
Azure Cosmos DB bills in request units per second and stored data, while CockroachDB Cloud bills in vCPU-hours, so the two invoices use different units and cannot be compared directly. Before you request quotes, model peak and average RU/s or vCPUs, data size in GB, number of regions, backup retention and expected monthly growth.
Provisioned throughput billed per RU/s
Provisioned throughput means you reserve a fixed number of request units per second (RU/s) on a database or container, and Microsoft bills for what you provision. The bill follows the reserved figure, so idle capacity still costs money. Measure a typical day and a peak hour of queries before sizing, because a figure set for peak load pays for capacity during quiet periods. Ask for the hourly RU/s cost in your region and confirm how the figure changes when your workload grows.
Autoscale throughput ceiling
Autoscale moves provisioned throughput between a maximum you set and a lower level as load changes, so the bill follows load within that range. Set the maximum from measured peaks. Confirm with Microsoft's current pricing how autoscale is billed against the maximum, since that rule decides whether a quiet month costs much less than a busy one. Compare a peak hour and an overnight window separately before entering the figure in your model.
Serverless billed per RU consumed
Serverless accounts bill for the request units consumed plus stored data, so there is no reserved throughput to pay for when the database sits idle. Serverless accounts run in one Azure region and cannot add regions after creation. Check that limit against your availability and data residency design before choosing this mode, and confirm which throughput modes support multi-region deployment for your workload.
Serverless docsFree tier and Reserved Capacity
Microsoft's documentation describes a lifetime free tier of 1000 RU/s and 25 GB of storage, which suits development and small workloads. Reserved Capacity gives up to 63% off Azure Cosmos DB prices, but reservation discounts only help when your baseline usage stays steady across the term. Confirm the reservation term and which throughput modes it covers before you commit. Ask whether the free tier applies per account or per subscription, and whether it can combine with a reservation.
CockroachDB Cloud billed per vCPU-hour
CockroachDB Cloud bills compute per vCPU-hour, at $0.092 on Standard and $0.162 on Mission Critical. The pricing page's example of about $203 a month for 2 vCPUs and 100 GB on Standard is the vendor's illustration, so rebuild it with your own node count and storage. Mission Critical costs more per vCPU-hour, so the tier choice moves the bill. Ask which storage, backup and data transfer charges sit outside the vCPU rate. New Cloud organizations get a 30-day trial with $400 in credit.
CockroachDB pricingCockroachDB self-hosted licensing
Self-hosted CockroachDB versions from 24.3.0 onward fall under the CockroachDB Software License. The Enterprise Free license is free for businesses under $10M in annual revenue, counting the parent company and all affiliates, and must be renewed every year. Free and Trial licenses are throttled after expiration, while paid Enterprise licenses are never throttled. Confirm revenue counting and renewal dates with Cockroach Labs before production use, and note that a September 15, 2026 post says new source versions will no longer be published to the public repository.
Licensing FAQsWhat running each one asks of your team
For Azure Cosmos DB, the recurring work is throughput tuning and data-model discipline, while Microsoft runs the service. Your team picks a capacity mode per account or container: provisioned RU/s, autoscale, or serverless, which bills only for request units consumed plus storage. Uneven traffic is where this matters most, because capacity sized for peak load pays for idle time, and undersized capacity throttles requests. Review RU consumption per operation after each release, since a query that scans more items changes the bill without any infrastructure change. Partition key design is the decision hardest to reverse. A skewed key creates hot partitions that throttle even when total RU/s looks sufficient, and changing the key later means migrating data. Microsoft handles patching and the service itself, and multi-region writes carry a 99.999% availability SLA with automatic failover. Serverless accounts run in one region and cannot add regions after creation, so a team that needs regional failover should decide that at account creation.
Self-hosting CockroachDB adds five recurring duties for your team: clusters, upgrades, backups, monitoring and license renewals. If one platform engineer covers the database alongside other work (illustrative), name an owner for each duty before go-live, since a skipped backup test or missed upgrade usually surfaces during an incident. The Enterprise Free license is free for businesses under $10M annual revenue, counting affiliates, but it must be renewed every year. Free licenses are throttled 30 days after expiration and Trial licenses 7 days after, while paid Enterprise licenses are never throttled. The upgrade path changes as well. In a September 15, 2026 blog post, Cockroach Labs said new versions of its source code will no longer be published to the public repository, and the existing repository will no longer be maintained. Before setting an upgrade cadence, confirm with the vendor which binaries, source access and support you will receive under the CockroachDB Software License, which applies from 24.3.0 onward.
Where data lives and what leaving each product involves
Azure Cosmos DB runs only on Azure, so where your data sits is set by the account and region you choose at creation. CockroachDB can run on infrastructure you control, but its license and source access terms decide what you may run, patch and keep if you leave. The cards below cover where data lives, how it leaves and what an exit involves.
Azure-only hosting with no self-hosted edition
Azure Cosmos DB is a Microsoft Azure service only, and the documentation describes no self-hosted edition. A local emulator exists for development and testing, but it does not replace a production deployment. If a residency rule requires data in your own data center or an air-gapped network, this rules out the service before any price comparison. CockroachDB can run on infrastructure you control. Confirm with your compliance team which locations, support access paths and backup copies the rule covers.
Azure Cosmos DB overviewServerless accounts fixed to one region
A serverless Azure Cosmos DB account runs in a single Azure region and cannot add regions after creation. That matters if you need failover to a second region, lower read latency for users in another geography or a disaster recovery site with a different location rule. Microsoft's documentation ties its 99.999% availability SLA to multi-region writes, so check which SLA applies to the account type you create. Changing the region layout later means creating a new account and moving the data, which is an exit cost in its own right.
Serverless accounts docsSelf-hosting under the CockroachDB license
From version 24.3.0 onward, every CockroachDB release is under the CockroachDB Software License, and patch fixes for 23.1 through 24.2 released from that date are too. That license sets the terms for running, modifying and redistributing it, so have counsel read it against your deployment model. Check the exact version on each cluster in your inventory, because older releases may carry different terms that you must confirm. Include any managed or hosted use in that review.
Licensing FAQsFree license limits and telemetry
The Enterprise Free license is free for businesses with less than $10M in annual revenue, counting the parent company and all affiliates, and it must be renewed every year. Free and Trial clusters are throttled after 7 days without sending telemetry, and throttling limits open SQL transactions to 5. Paid Enterprise licenses are never throttled. A network that blocks telemetry therefore needs a written answer on how Free and Trial clusters will behave there.
Public source repository closing
In a September 15, 2026 blog post, Cockroach Labs said new versions of CockroachDB source code will no longer be published to its public repository, and the existing repository will no longer be maintained. If you expect to patch, fork or rebuild CockroachDB yourself, that change removes a source path you may have counted on. Ask in writing what source and binaries you will receive for future fixes, and whether that access depends on your license tier.
Cockroach Labs blogNative APIs and request-unit tuning
Applications written against Azure Cosmos DB's APIs and SDKs carry that dependency into any move, and workloads are tuned around the request units (RUs) the service bills. An exit means rewriting access code and re-measuring query cost, on top of copying the data. Microsoft's documentation also separates Azure DocumentDB, a distinct service on the open-source DocumentDB engine with MongoDB wire protocol compatibility, from Azure Cosmos DB, so confirm which product your code targets before you plan the exit.
When a self-hosted open-source option fits better than either product
If the workload must run entirely under your organization's control, neither Azure Cosmos DB nor CockroachDB meets the requirement. Azure Cosmos DB is a Microsoft Azure service with no self-hosted edition, and current CockroachDB releases fall under the proprietary CockroachDB Software License. For relational workloads that need distributed SQL, the open-source options to evaluate are PostgreSQL, the mature general-purpose choice, and YugabyteDB, which is designed to spread SQL workloads across nodes. Confirm YugabyteDB's license and feature fit before you choose it. List the high availability, geo-distribution and SQL features your queries depend on, then confirm with the project that each one is covered by the license you will run. Also note that Cockroach Labs stated in a September 15, 2026 blog post that new CockroachDB source versions will no longer be published to its public repository. Ask for written confirmation of how you would obtain and patch any self-hosted build before you plan around it.
For document workloads, FerretDB is the option to evaluate. It is an Apache-2.0 MongoDB alternative that speaks the MongoDB 5.0+ wire protocol and stores data in PostgreSQL with the DocumentDB extension, so MongoDB drivers can connect to it. Compatibility is the decision point. Cosmos DB's native NoSQL API is not MongoDB, so applications written against its SDK, query syntax and change feed need a driver and query review before any move. Azure DocumentDB (vCore) is a separate Microsoft service that uses the MongoDB wire protocol, but it is still a managed Azure service, so it does not meet the control requirement. Test the exact MongoDB commands, aggregation stages, indexes and transactions your application uses against the FerretDB repository and your own test suite, and record every gap you find.
Running either option yourself means your team, or a partner, owns what the managed service otherwise carries. Microsoft's documentation states that multi-region writes carry a 99.999% availability SLA, and no equivalent vendor commitment applies to a self-hosted cluster, so high availability is a design you must build and test. Plan for six areas. Infrastructure must sit in your own cloud account or data center and be sized for the replicas and regions you need. High availability requires replication, automated failover and a rehearsed failover runbook. Backups must go to a separate location, with restores tested on a schedule and point-in-time recovery configured and verified. Upgrades need compatibility testing against your queries. Security hardening covers TLS, authentication, audit logging and secrets handling. Ongoing testing includes load tests and failover drills. Ask any implementation partner for a written scope that names an owner for each area and the evidence you will receive.
Moving from Azure Cosmos DB to CockroachDB or back
This sequence moves data between Azure Cosmos DB and CockroachDB in six stages, from inventory through decommissioning. Each stage ends with a written artifact, such as a schema map, a cutover runbook or a reconciliation report, that decision owners can review. The same order applies when moving back, with an Azure account as the target because Azure Cosmos DB runs only on Azure.
Inventory data models, APIs and SDK usage
The platform team and each application owner list every Azure Cosmos DB account, database and container in scope. For each container, record the data model (document, key-value, graph, table or vector), the API surface, the partition key path, indexing and consistency settings, change feed consumers, and any Synapse Link or Fabric mirroring. Effort rises with multiple partition key designs across containers, graph or vector data, and application code tied to the Cosmos DB SDK, because each of these needs its own rewrite plan. The step is done when a signed inventory lists every container with its consumers and owner.
Map each data model to CockroachDB
Data architects and application owners translate each container into a CockroachDB schema. Document and key-value data usually becomes tables with a primary key chosen from the Cosmos DB partition key and access pattern, and nested or unbounded arrays need a deliberate choice between child tables and JSON columns. Graph and vector workloads need a separate feasibility check, and the team should confirm current CockroachDB support for each feature before committing. The step is done when every container has a target schema, a key design and a written gap list reviewed by the application teams.
Decide the cutover approach
The migration lead, application owners and the operations team choose how traffic moves. The main options are a planned write freeze with a one-time copy, or a continuous sync that keeps both stores aligned until the switch. The choice depends on how much write downtime the business accepts, whether the source change feed can drive the sync, and how long the rollback path must stay open. Serverless accounts run in a single region and cannot add regions after creation, and multi-region write setups make a clean freeze harder, so both shape the options. The step is done when a runbook names the method, the rollback trigger and the approver.
Build and validate the migration
Engineers build the export, conversion and load jobs, then run them against a non-production CockroachDB environment with production-like volumes. Validation compares row counts per table, checksums on sampled records, the results of the highest-volume query patterns, and the application integration test suite. Effort rises with application code tied to the Cosmos DB SDK and with query logic written around request unit costs, because those paths must be rewritten and retested in SQL. The step is done when reconciliation reports match for every container and the application test suite passes against CockroachDB.
Cut over the application traffic
The operations team runs the runbook: it drains or freezes writes, completes the final sync, verifies counts, and then changes application configuration to point at CockroachDB. Monitoring watches error rates, latency and connection behavior through the rollback window. Before production traffic, the platform owner confirms the CockroachDB license tier, since the licensing FAQ describes throttling for Free and Trial clusters and states that paid Enterprise licenses are never throttled. The step is done when reads and writes succeed on the target through the agreed window and the approver signs the cutover record.
Decommission the Azure Cosmos DB source
After the rollback window closes, the platform team repoints every remaining consumer, including change feed processors and Synapse Link or Fabric mirror pipelines, and then retires the source. Keys and connection strings are revoked, and a final export is stored under the retention policy the compliance owner sets. Continuous backup with point-in-time restore is a feature of the source account, so the team confirms how long those backups persist and removes them only when policy allows. The step is done when no consumer reads the account, the account no longer appears in billing, and the retention record is filed.
Azure Cosmos DB vs CockroachDB questions buyers ask before a move
How much does a move from Azure Cosmos DB to CockroachDB cost?
The cost depends on how much of your application is tied to Cosmos DB's API, data model and partition design, and on where CockroachDB runs. Price these components separately:
- Target platform: CockroachDB in your own accounts, or CockroachDB Cloud. Cloud Standard is listed at $0.092 per vCPU-hour, about $203 a month for 2 vCPUs and 100 GB, on the CockroachDB pricing page.
- Schema and application changes, since containers and partition keys map to SQL tables and keys.
- Data export, load, validation and a parallel run before cutover.
Platform fees recur. Redesign, migration and testing are one-time. DeployOpen does not publish a price list. Its fixed-scope engagements agree scope, deliverables and timelines in writing, and the quote follows from that scope, so ask for each component to be itemized.
Can our own engineers migrate off Azure Cosmos DB without outside help?
It depends on whether your team has redesigned a data model from documents into relational tables before. Engineers who know SQL, distributed databases and your application code can handle much of the work in-house. The harder parts are mapping partition keys and document shapes to a relational schema, rewriting queries and SDK calls, and replacing change feed consumers. Teams without that experience may want outside help for design and cutover. DeployOpen plans, implements, documents and supports self-hosted platforms in your infrastructure, so an engagement can cover the parts your team lacks capacity for, scoped in writing before work starts.
What does the buyer need to provide for a database migration?
Expect to supply access, decisions and named owners. The inputs to confirm early are:
- Inventory: containers, partition keys, indexes, throughput settings, and every service that reads the change feed or uses Synapse Link or Fabric mirroring.
- Access: read rights to the Azure accounts, a non-production target environment, and network paths inside your own infrastructure.
- Decisions: acceptable downtime, backup and retention rules, and who approves cutover and rollback.
- Compliance input: which data classes apply and which evidence your auditors expect.
Confirm each item in writing before the scope is signed, because missing inputs push the timeline back.
Is CockroachDB free to self-host for a small business?
Yes for qualifying businesses, but the free option carries conditions. Versions from 24.3.0 onward are under the CockroachDB Software License. The Enterprise Free license is free for businesses with under $10M in annual revenue, counting the parent company and all affiliates, and it must be renewed every year. Trial licenses require telemetry. Free and Trial clusters are throttled after 7 days without telemetry, and throttling limits open SQL transactions to 5. Free licenses throttle 30 days after expiration and Trial licenses 7 days after expiration, while paid Enterprise licenses are never throttled. Separately, a September 15, 2026 Cockroach Labs post says new source versions will no longer be published to the public repository. Check the CockroachDB licensing FAQ and your revenue position before you plan around it.
Can the Azure Cosmos DB emulator replace a test environment?
No. The Azure Cosmos DB emulator is a free local tool for development and testing against the Cosmos DB API, so it helps with source-side application work but cannot validate CockroachDB behavior. Microsoft describes no self-hosted Cosmos DB edition, so the emulator is not a stand-in for a target environment. Run a CockroachDB cluster in a non-production environment inside your own infrastructure, then test what matters to you: query results, transaction behavior under load, failover and restore procedures, and the services that consume your data. Ask your engineers which Cosmos DB behaviors your application relies on, and confirm how each one is verified before you sign off on cutover.
What should a contract or API lock-in review cover for Cosmos DB?
Review the terms that decide how hard an exit would be, since Cosmos DB is offered only as an Azure service. Cover:
- Commitments: reserved capacity terms, the length of any commitment, and what happens to unused capacity. Microsoft lists Reserved Capacity at up to 63% off Azure Cosmos DB prices.
- Data export: formats, export tooling, backup retention and the point-in-time restore window.
- Dependencies: change feed consumers, Synapse Link or Fabric mirroring, and Azure-specific SDK or identity code.
- Regional limits: a serverless account runs in one region and cannot add regions after creation, which affects any exit plan.
- Target terms: the CockroachDB license, renewal dates and any cloud contract.
Have legal and procurement confirm each term against the signed agreement.
How do Cosmos DB request units affect the cost of moving?
Cosmos DB charges in request units (RUs), so its bill cannot be copied onto CockroachDB line by line. Provisioned throughput bills the RU/s you provision, autoscale adjusts throughput, and serverless bills only for RUs consumed plus storage. Microsoft states the lifetime free tier provides 1000 RU/s and 25 GB of storage. Your move should replace RU estimates with measured vCPU, memory and storage needs on the target. Collect Azure Monitor data covering normal and peak load before you request a quote. Drivers that raise target cost include high peak concurrency, large data volume, multi-region replicas and long retention. Right-sizing, fewer always-on replicas and removing unused containers reduce it.
How DeployOpen helps you choose and run the option you pick
DeployOpen plans the database decision around your workload, then implements and runs the option you choose inside your own infrastructure. We scope the comparison against your data model, regions, licensing exposure and exit plan before any build starts. Where a self-hosted database fits, we deploy it with access control, backups and documentation your teams can review.
How we scope
- The written scope names which databases are compared, the workloads and regions tested, and what is out of scope.
- For Azure Cosmos DB, the scope records the Azure-only deployment model and each lock-in point.
- Engagements are fixed-scope, with deliverables and timelines agreed in writing before work starts.
How we build
- We customize, integrate and harden the chosen option in your own cloud accounts, data centers or air-gapped networks.
- For CockroachDB, we document license tier, yearly renewal and throttling rules, so risks are known before go-live.
- We build the backup, restore and upgrade procedures, then test restores before the platform goes live.
How we hand over
- Architecture, configuration and runbook documents cover the chosen option, written for your operations and security teams.
- Security testing of the deployment, with a retest after fixes, can be included where the written scope asks for it.
- Compliance evidence, such as control mappings and configuration records, is prepared for your independent assessor.
How we support
- Ongoing support, upgrades and continuous testing are available as a retainer after handover.
- Upgrade planning tracks license and release changes, including the September 2026 move to stop publishing new CockroachDB source publicly.
- Support terms follow the written scope, with response expectations confirmed in writing before signature.

