7,363 open-source and SaaS tools, with GitHub stats refreshed every day.

5 alternatives ranked by real activity

Open-source Google Cloud Spanner alternatives

A curated, ranked list of the 5 best open-source alternatives to Google Cloud Spanner.

The best open-source alternative to Google Cloud Spanner is TiDB. If that doesn't suit you, other good options are CockroachDB, YugabyteDB, OceanBase and YDB.

Google Cloud Spanner alternatives are mainly databases. 5 of them shipped code in the last 30 days, 5 can be self-hosted, and 3 use a permissive licence.

Last updated October 2, 2026 · ranked by GitHub stars, growth and recent commits

TiDB

An open-source, MySQL-compatible distributed SQL database with horizontal scaling, ACID transactions, Raft-based high availability and support for analytics and vector search.

GitHub stars
41k
Last commit
today
Latest release
v7.5.8
Licence
Apache-2.0
Self-hosted
Yes
Hosted version
Available
tidb.ioTiDB homepage screenshot

TiDB is a cloud-native, open-source distributed SQL database from PingCAP. The name's Ti stands for titanium, and it is built for high availability, strong consistency and the ability to scale out as data and traffic grow, while staying compatible with MySQL so existing applications and tools can connect with little change.

Distributed transactions use a two-phase commit protocol to keep ACID guarantees even across nodes, through network partitions or node failures. It scales horizontally by adding nodes or vertically by adding resources, without downtime, and its architecture separates compute from storage so each can be adjusted independently. Built-in Raft consensus keeps multiple replicas in sync and handles automated failover. Topics also mention HTAP workloads, analytics and native vector search.

TiDB is written in Go under the Apache-2.0 license. It can be deployed on your own infrastructure or consumed as a managed cloud service, and it suits teams that have outgrown a single MySQL server and want horizontal scale without sharding by hand.

Key features

  • MySQL-compatible distributed SQL
  • Distributed ACID transactions
  • Horizontal and vertical scaling without downtime
  • Separated compute and storage layers
  • Raft-based replication and automated failover
  • Analytics and vector search support

Pricing: TiDB Community is free and Cloud Starter has a monthly free quota. Cloud Premium starts from $1800 per month and Dedicated from $0.22 per hour; Self-Managed is priced on request.

Read more about TiDBWebsite GitHub

CockroachDB

CockroachDB is a cloud-native distributed SQL database built on a strongly consistent key-value store that scales horizontally and survives machine and datacenter failures.

GitHub stars
33k
Last commit
8 days ago
Self-hosted
Yes
Hosted version
Available
cockroachlabs.comCockroachDB homepage screenshot

CockroachDB is a distributed SQL database for building, scaling and managing data-intensive modern applications. It is layered on a transactional, strongly consistent key-value store and offers a familiar SQL API for defining, changing and querying data, with ACID transactions across the cluster.

It scales horizontally by adding nodes and is designed to keep running through failed disks, machines, racks and even whole datacenters, with little added latency and no manual recovery. Control over where data is placed is part of the pitch, which matters for locality and compliance. Documentation covers installation, development, deployment and administration, client drivers, and a comparison with other databases, and the design is explained in a public architecture document.

CockroachDB is written in Go. Its license is listed as 'Other' on GitHub, so review the current license terms before using it commercially. You can run your own cluster or let Cockroach Labs run it as the managed CockroachDB Cloud service. It suits teams that need resilient, multi-region relational storage without sharding by hand.

Key features

  • Distributed SQL with ACID transactions
  • Horizontal scaling by adding nodes
  • Survives machine, rack and datacenter failures
  • Control over data placement
  • Built on a strongly consistent key-value store
  • Managed cloud service available

Pricing: Billing is per vCPU-hour: Standard is $0.092 and Mission Critical $0.162 on AWS us-east-1. New cloud organizations get a 30-day trial with $400 in credit; rates vary by region and cloud.

Read more about CockroachDBWebsite GitHub

YugabyteDB

A PostgreSQL-compatible, cloud-native distributed SQL database for transactional workloads that need scale, fault tolerance or multi-region deployment.

GitHub stars
11k
Last commit
today
Latest release
v2026.1.2.0
Self-hosted
Yes
yugabyte.comYugabyteDB homepage screenshot

YugabyteDB is a distributed SQL database that is compatible with PostgreSQL. It combines the relational features of traditional databases with the scale-out design of NoSQL systems, and is intended for cloud-native OLTP applications that need correct data and at least one of scalability, tolerance to failures or global distribution.

Its SQL layer, YSQL, reuses the PostgreSQL query layer and so supports most PostgreSQL features, including data types, stored procedures, triggers and extensions. Its transaction model follows the design of Google Spanner, using Raft consensus for replication and hybrid logical clocks for distributed ACID transactions, with snapshot, serializable and read committed isolation. Reads are strongly consistent by default and can be tuned to read from followers and replicas.

The database can be configured to withstand failures at the level of a disk, rack, node, zone, region or whole cloud, recovering on its own, and the topics mention multi-region, multi-cloud and Kubernetes deployments. The project is written mainly in C and C++, the repository lists its license as Other, and documentation covers architecture, roadmap and how to build applications.

Key features

  • PostgreSQL-compatible SQL layer
  • Distributed ACID transactions
  • Replication using Raft consensus
  • Snapshot, serializable and read committed isolation
  • Automatic failover and repair
  • Multi-region and multi-cloud deployments
  • Kubernetes deployment support

Pricing: The open-source database is free. The managed Aeon service starts at $125 (Standard) or $167 (Professional) per vCPU per month plus storage and transfer, with a free trial; Enterprise is quoted.

Read more about YugabyteDBWebsite GitHub

OceanBase

A distributed relational database developed by Ant Group, MySQL-compatible and built on Paxos, supporting transactional, analytical and vector workloads.

GitHub stars
10k
Last commit
2 days ago
Latest release
v4.4.2_CE_BP3
Licence
Apache-2.0
Self-hosted
Yes
en.oceanbase.comOceanBase homepage screenshot

OceanBase is a distributed relational database developed by Ant Group. It runs on a cluster of commodity servers and uses the Paxos protocol and a distributed architecture to provide high availability and scalability, without depending on a specific hardware architecture.

It is compatible with MySQL, which eases migration from MySQL databases, and supports hybrid transactional and analytical processing, so one engine can serve both OLTP and OLAP workloads. The project now describes itself as a unified, multi-model database for the AI era, with topics that include vector search and full-text search. Cloud-native operation is supported through a Kubernetes operator.

You can try it by deploying a stand-alone instance with an all-in-one package on Linux, starting a Docker container from images on Docker Hub, quay.io or ghcr.io, or running it on Kubernetes with ob-operator. OceanBase is written in C++ and licensed under Apache-2.0, with a developer guide for compiling the observer yourself.

Key features

  • Distributed architecture on Paxos
  • Compatible with MySQL applications
  • Hybrid transactional and analytical processing
  • Vector and full-text search
  • Docker and Kubernetes deployment
  • All-in-one stand-alone installer

Pricing: Free and open source under the Apache-2.0 licence.

Read more about OceanBaseWebsite GitHub

YDB

YDB is a distributed SQL database, open source under Apache-2.0, offering high availability, horizontal scale and ACID transactions with strong consistency.

GitHub stars
4.8k
Last commit
today
Latest release
26.2.1.14
Licence
Apache-2.0
Self-hosted
Yes
ydb.techYDB homepage screenshot

YDB is a distributed SQL database for workloads that need scale without giving up consistency. It offers high availability and scalability along with strict consistency and ACID transactions, and it was designed from scratch for scalable interactive web services with an OLTP-like profile, where effective transactions across rows are essential.

The README says the project was built by people with a deep background in databases and distributed systems, with experience building a NoSQL database and a MapReduce system at a very large search company. The code base is written in C++ and described as cloud-native, with documentation, a blog and community channels on Discord and Telegram.

YDB is licensed under Apache-2.0 and can be deployed on your own infrastructure. It suits teams that want a horizontally scalable relational-style database with strong transactional guarantees, for example for large online services, and are willing to run a distributed system.

Key features

  • Distributed SQL query layer
  • ACID transactions across rows
  • Strong consistency guarantees
  • High availability across nodes
  • Horizontal scale-out across nodes
  • Cloud-native C++ implementation

Pricing: Free and open source under the Apache-2.0 license.

Read more about YDBWebsite GitHub

Google Cloud Spanner alternatives: questions

What is the best open-source alternative to Google Cloud Spanner?
TiDB is the top-ranked open-source alternative to Google Cloud Spanner on Enlisted: An open-source, MySQL-compatible distributed SQL database with horizontal scaling, ACID transactions, Raft-based high availability and support for analytics and vector search. Other strong options are CockroachDB, YugabyteDB, OceanBase and YDB.
Are these Google Cloud Spanner alternatives free?
All 5 are open source, so the code is free to use under its licence, and all of them can be self-hosted on your own server or computer. 2 also offer a paid or managed cloud version if you'd rather not host it yourself.
How is this list of Google Cloud Spanner alternatives ranked?
By a score built from GitHub stars, star growth over the last 30 days and how recently the code changed. 5 of these projects shipped code in the last 30 days. Data is refreshed daily, and nobody can pay to move up.

People also look for alternatives to…

View all