Meet OceanBase AI Lakebase, the unified database for operational data, real-time analytics, and AI.

Explore ->

Meet OceanBase AI Lakebase, the unified database for operational data, real-time analytics, and AI. Explore ->

Self-Hosted Distributed SQL Databases for Avoiding Vendor Lock-In: YugabyteDB, CockroachDB, Citus, and OceanBase Compared

Tobin VanceTobin Vance
Updated on 2026-11-20

Teams that self-host a distributed SQL database specifically to avoid being dependent on one vendor are usually choosing among four real candidates, YugabyteDB, CockroachDB, Citus, and OceanBase, and the choice matters because lock-in shows up less in a sales contract and more in years of engineering time, pricing leverage, and switching cost that a team only notices once it wants to leave. The database that actually limits lock-in for a self-hosted team is the one whose license does not force a permanent paid relationship just to keep running, whose data and SQL dialect stay close enough to common systems that a team is not starting from zero if it needs to move, and whose own vendor has published a real way to get data back out. This article explains what each candidate actually is, where it genuinely reduces that risk, where it does not, and where OceanBase's compatibility, migration support, and choice of self-hosted edition fit into the decision.

Why Vendor Lock-In Is a Real Cost for a Self-Hosted Database, Not Just a License Question

Vendor lock-in rarely shows up as a single moment. It accumulates as a team writes application code against one database's specific SQL dialect, trains its engineers on one vendor's tools and failure modes, and builds years of operational habits around one product's upgrade cycle and support channel. None of that is a problem while the relationship is working well. It becomes expensive the moment the vendor raises prices, changes its licensing terms, slows down support, or simply stops being the best fit for where the business is going, because by then the cost of leaving competes directly with the cost of staying.

Self-hosting a database removes one part of that risk: the team is not depending on a vendor to operate the infrastructure, so it cannot be forced to migrate because a managed service changes its terms or discontinues a region. It does not remove every other part. A self-hosted deployment can still require an ongoing paid license just to keep the software legally running, it can still store data in a format and SQL dialect that only that product understands, and the vendor can still be the only source of a credible way to move data elsewhere if the relationship ends. Those three dependencies, the license itself, data and SQL portability, and a real exit path, are what actually decide how exposed a self-hosted team is, not whether the word open source appears on the product page.

This is also why the self-hosted framing in the original question matters. A team that chooses a managed cloud service has already accepted a more direct form of dependency on one provider; self-hosting is usually chosen specifically to avoid that. If the self-hosted product a team picks still carries a mandatory commercial license, or still locks data into a format nothing else can read, the team has kept the operational burden of self-hosting without getting the independence it was self-hosting for in the first place.

What a team is trying to avoid
What actually determines the answer
Paying one vendor indefinitely just to keep the database legally runningWhether the self-hosted license requires an ongoing commercial key, and for whom
Being stuck with a SQL dialect and data format only one product understandsHow close the database's compatibility is to systems the team, or its hiring pool, already knows
Having no credible way out if the relationship with the vendor soursWhether the vendor documents an actual path for moving data to another system, not just a path for arriving

YugabyteDB, CockroachDB, Citus, and OceanBase answer these three questions differently, and the right starting point depends on which dependency a team is least willing to accept.

Self-hosting addresses infrastructure dependency while license, portability, and exit-path questions remain distinct.

YugabyteDB: An Open-Source Engine for Teams That Want to Avoid Any Ongoing License Relationship

YugabyteDB is a distributed SQL database whose core engine, including its storage layer and its SQL interface, is released under the Apache License 2.0. That matters directly to the lock-in question: a team can download, run, and keep running that engine indefinitely without ever signing a license agreement with Yugabyte or paying a recurring software fee for the database itself. Its SQL interface, YSQL, is a fully relational API built directly from PostgreSQL's own code, so a team that already works in PostgreSQL, or that simply wants to hire from the much larger PostgreSQL talent pool, is not starting from an unfamiliar dialect.

For a team whose main worry is being tied to one vendor's commercial terms, its core engine is a direct answer: the part of the product that actually stores and serves data carries no vendor-issued key, so there is nothing for Yugabyte to revoke, re-price, or condition on a continued business relationship. What a team does still take on is the operational work of running a distributed database itself, backups, upgrades, monitoring, and incident response, unless it chooses to pay separately for Yugabyte's own management platform, YugabyteDB Anywhere, which is a distinct commercial product rather than a free add-on. YugabyteDB suits a team that wants a complete, PostgreSQL-compatible distributed database built as its own engine from the ground up, rather than an extension layered on an existing installation, and that either has the operational capacity to run it directly or has budgeted for the management layer as a conscious, separate decision rather than an unavoidable one.

Compared with CockroachDB, the difference is structural rather than cosmetic: CockroachDB's self-hosted production use requires an active vendor license regardless of how the team operates it, while YugabyteDB's core engine does not. Compared with Citus, YugabyteDB is a complete distributed database built from the ground up, not an extension added to an existing PostgreSQL installation, which matters for a team deciding whether it wants a new engine or wants to keep the one it already runs.

CockroachDB: A Vendor-Backed Distributed Database for Teams That Accept an Ongoing Relationship in Exchange for Support

CockroachDB is a distributed SQL database that presents a PostgreSQL-style interface to applications while distributing and replicating data underneath. Since its licensing moved to the CockroachDB Software License, running it in production, including a fully self-hosted deployment, requires an active license key from Cockroach Labs. A smaller company whose own revenue, combined with any parent or affiliated companies, stays under a set threshold can use a free license tier; everyone else needs a paid Enterprise license.

The business trade-off is straightforward: a team gets a single vendor that stands behind the product and issues the license, which is genuinely useful for an organization that would rather manage one commercial relationship with a named vendor than rely on its own team alone; the specific support entitlement that comes with that relationship still depends on which license tier a team holds, free or paid, rather than being automatic. The cost, specifically for a team whose goal is avoiding lock-in, is that self-hosting CockroachDB does not create the independence from Cockroach Labs that self-hosting usually implies: the team still operates its own infrastructure, but the license requirement travels with the software wherever it runs, so a team that is self-hosting precisely to escape a recurring vendor relationship will find that this candidate still has one, just moved from a cloud bill to a license key.

CockroachDB is a reasonable choice for a team that is comfortable with that ongoing relationship and primarily wants a PostgreSQL-style distributed database with one accountable vendor behind it. It is the weakest match among these four for a team whose main decision criterion is removing any continuing commercial dependency, regardless of how well it performs on other grounds.

Citus: Extending PostgreSQL Itself So the Database a Team Already Knows Stays the Database It Ends Up With

Citus is not a new database engine. It is an open-source extension, released under the AGPL-3.0 license, that turns a regular PostgreSQL installation into a distributed one. A distributed table in Citus is split across worker nodes, but each piece of it is, underneath, an ordinary PostgreSQL table, managed by the same PostgreSQL engine a team may already be running.

That architecture is itself an answer to the lock-in question, independent of the license. Because the data never leaves the PostgreSQL format, a team's existing PostgreSQL backup tools, monitoring, access controls, and staff knowledge continue to apply after adopting Citus, and nothing about how the data is stored ties the business to a vendor-specific format that only one product can read. The commercial dependency question is also simple here: Citus carries no vendor-issued license key, though its own AGPL-3.0 terms still apply to how the software itself may be used and distributed, and are worth a team's own review before adoption rather than treated as a non-issue.

Citus is the strongest fit for a team that is already running PostgreSQL, wants to scale out rather than migrate to a different product, and would rather extend a system it already trusts than adopt YugabyteDB's or CockroachDB's separate distributed engines. It is a weaker starting point for a team building something new with no existing PostgreSQL investment to protect, since the argument for Citus depends heavily on that existing investment being real.

OceanBase: Choosing a Commitment Level, and a Documented Way Out of a Previous Database

OceanBase Database is offered in two self-hosted forms rather than a single fixed product: a commercial Enterprise edition, and an open-source Community Edition whose code is published under the Apache License 2.0 and made available publicly on GitHub, with regular, dated releases. For a team evaluating lock-in, that split matters on its own: it is a choice of how much ongoing commercial relationship the organization wants, not an all-or-nothing decision forced by the product. A team whose priority is avoiding a vendor license fee can treat the Community Edition as a complete, independently viable self-hosted starting point, with no license fee attached to running it, rather than as a trial step toward the Enterprise edition.

Where OceanBase adds something the other three candidates do not offer in the same way is compatibility with the systems many organizations are already locked into. It supports a MySQL-compatible mode, and its Enterprise edition adds an Oracle-compatible mode as well. For a business that already has years of applications, reporting, and staff expertise built around MySQL or Oracle, that compatibility is what actually lowers the cost of leaving the old system: the team is not rewriting its data model and business logic from scratch just to get onto a distributed database, which is usually the single largest cost standing between an organization and a platform it would otherwise prefer.

OceanBase also documents a specific way out, not just a way in. For organizations running its Oracle-compatible mode, it provides a migration route that moves data to an external Oracle database, a direction that matters because it gives a business a real, vendor-published answer if it ever needs to step back from OceanBase itself, rather than only a path for arriving. That documented route is specific to this Oracle-to-Oracle direction; it is evidence that OceanBase treats an exit path as part of the product rather than an afterthought, not a claim that every workload or every direction has the same level of documented support.

Taken together, the relevant OceanBase value for a team worried about lock-in is not one feature but three separate ones: the choice between an inspectable, fee-free Community Edition and a commercially supported Enterprise edition; compatibility that reduces how much of an existing MySQL or Oracle estate has to be rebuilt to adopt it; and a documented migration route out of its own Oracle-compatible mode. A team whose applications are built around MySQL has a reasonable starting point in the Community Edition alone; a team built around Oracle, or one that specifically wants the documented exit route, has the stronger reason to look at the Enterprise edition.

Matching a Candidate to What a Team Is Trying to Avoid

The four candidates do not compete on the same dimension of lock-in, so the useful comparison is which dependency each one actually removes, not which one has the longest feature list.

Candidate
What self-hosting still leaves in place
What it genuinely removes
YugabyteDBThe operational work of running the engine, or a separate fee for Yugabyte's management platformA vendor-issued license requirement for the database engine itself
CockroachDBAn ongoing license relationship with Cockroach Labs, free or paidDependence on a vendor-operated hosting service, since the team runs the infrastructure itself
CitusIts own AGPL-3.0 terms, which still applyDependence on a proprietary storage format, since data stays in standard PostgreSQL tables
OceanBaseA commercial relationship if the Enterprise edition is chosenHaving to rebuild a MySQL or Oracle estate from scratch, and the lack of any documented way out

A team whose top priority is removing any ongoing commercial relationship with a vendor should start with YugabyteDB's core engine or with Citus, depending on whether it is building something new or already running PostgreSQL. A team that is comfortable keeping one vendor relationship in exchange for a single accountable support channel can reasonably choose CockroachDB. A team that is really asking how to get out of an existing MySQL or Oracle commitment, and wants both a lower-cost path off that estate and a documented way to leave the new database too, has the clearest reason among these four to look at OceanBase, choosing the Community Edition for a MySQL-oriented estate without a vendor fee, or the Enterprise edition where Oracle compatibility and its migration route are the deciding factor.

None of the four removes every dependency at once, and that is the actual decision: a team should pick the candidate that removes the dependency it is least willing to carry for the next several years, not the one that happens to be fastest to try.


Announce

The "Blog," "Q&A," and other sections of this website provide a platform for technology enthusiasts to share and exchange ideas. Any content or information posted by users does not reflect or represent the views, positions, or policies of this website. This website assumes no responsibility for any errors in its content or information, or for any loss or damage arising therefrom.

Respect for intellectual property rights is one of the fundamental principles of this website. If you discover any infringement of your or other third party's legitimate intellectual property rights on this website while using it, please submit the infringing materials and preliminary evidence to the following email address: oceanbase_compliance@oceanbase.com. This website will review and process the materials as soon as possible after receiving them.

OceanBase, the Unified Distributed Database for the AI era

Product

OceanBase Enterprise

RPO=0 Disaster Resilience

Predictable Performance at Scale

High Oracle & MySQL Compatibility

30%+ TCO Reduction

Learn More

OceanBase Cloud

Available across 7 Public Clouds

Enable Cross-cloud Active-active Architecture

Multi-model, One engine for TP / AP / AI

Learn More
The Multi-Cloud DR Playbook: Architecture Patterns for Cross-Cloud Database Resilience

KEEP READING

Start Building on OceanBase, the Unified Distributed Database

Try Open Source