# TursoDB vs MySQL

> MySQL (InnoDB) is a proven, high-throughput client-server OLTP engine backed by decades of operational tooling and horizontal sharding ecosystems like Vitess. TursoDB is the better fit when you want in-process execution, local-first sync, native vector search, and lightweight per-tenant isolation without managing database servers or connection pools.
> Canonical HTML: https://tursodb.cn/compare/turso-vs-mysql/
> Language: en
> MySQL Official Site: https://www.mysql.com/

## Overview
MySQL powers a huge share of web applications through its client-server InnoDB architecture. TursoDB takes an opposite starting point—running directly inside the application process with SQLite file compatibility and optional cloud synchronization.

## Comparison Matrix
| Dimension | TursoDB | MySQL |
| :--- | :--- | :--- |
| Core Engine | Embedded Rust engine — SQLite-compatible core with non-blocking async I/O | C/C++ InnoDB server — Pluggable storage engines with clustered primary keys by default |
| Deployment Model | In-process single file — Zero daemon locally with optional synced Turso Cloud | Networked server daemon — Self-hosted, RDS, Aurora, or PlanetScale/Vitess accessed over TCP pools |
| Concurrency & Writes | Optimistic MVCC writes — BEGIN CONCURRENT tailored for embedded and per-tenant workloads | InnoDB row-level locking — Gap locks and high concurrent write throughput on multi-core servers |
| Sync & Edge Replication | Native local-to-cloud sync — Bidirectional sync with in-process embedded read replicas | Server binlog replication — Primary-replica and Group Replication; no native offline client sync |
| Multi-Tenant Isolation | Native database-per-tenant — Minimal memory and storage overhead per isolated database file | Shared tenant_id tables — Thousands of schemas strain InnoDB table caches and server RAM |
| Vector & AI Search | Built-in DiskANN vectors — Native vector types and open-source ANN indexing included | Commercial ANN indexing — VECTOR type in MySQL 9.0, but ANN indexes require HeatWave |
| SQL Dialect & Ecosystem | SQLite polyglot SDKs — Lightweight bindings across Rust, JS/TS, Python, Go, and WASM | Ubiquitous MySQL dialect — Supported by nearly every CMS, ORM, BI tool, and host |
| License | MIT permissive license — Commercial embedding allowed without copyleft or paid licenses | Dual GPLv2 / Commercial — Closed-source commercial embedding typically requires an Oracle license |

## When to Choose TursoDB
- You want to eliminate database servers, connection pool exhaustion, and cold-start TCP handshakes in serverless or edge apps.
- Your architecture benefits from local-first offline persistence or sub-millisecond embedded read replicas.
- You need open-source native vector search alongside relational tables without paying for proprietary add-ons.
- You prefer permissive MIT licensing for embedding a database inside commercial software or appliances.

## When to Choose MySQL
- You run a high-concurrency centralized web application requiring sustained heavy writes into a single shared database.
- You depend on existing MySQL ecosystem tools—WordPress, Laravel/Rails legacy stacks, ProxySQL, or Vitess sharding.
- Your organization requires mature binlog CDC pipelines, InnoDB Cluster HA, and deep DBA familiarity.
- You need server-side stored procedures, triggers, user grants, and strict relational schemas enforced at a central server.

## Architecture Deep Dive
### Connection Pools vs. In-Process Embedding
MySQL requires an always-on daemon, persistent connection pooling, and careful tuning of innodb_buffer_pool_size as traffic scales. TursoDB embeds straight into your binary or runtime, removing network latency for local reads and allowing serverless functions or desktop apps to open and sync databases without maintaining warm server pools.

### Open-Source Vector Search & Licensing Boundaries
MySQL Community Edition is GPLv2 and reserves key enterprise features—including managed vector indexing via HeatWave—for commercial tiers. TursoDB ships its core engine, async I/O, and DiskANN vector search under the permissive MIT license, making it straightforward to embed inside proprietary desktop tools, edge agents, and SaaS backends.

## FAQ
### Is migrating from MySQL to TursoDB straightforward?
Schemas using standard tables, indexes, and foreign keys map cleanly via ORMs like Drizzle or Prisma, though MySQL-specific features (ENUMs, stored procedures, unsigned ints, ON UPDATE CURRENT_TIMESTAMP) require adjustment to SQLite semantics.

### How does TursoDB compare to MySQL for write-heavy single-database workloads?
For thousands of concurrent writes per second targeting one massive shared table, MySQL InnoDB on dedicated hardware remains stronger. TursoDB shines when writes are naturally sharded across many per-tenant or per-agent databases.

### Why does licensing matter between MySQL and TursoDB?
Embedding GPLv2 MySQL components inside closed-source commercial software typically requires purchasing an Oracle commercial license. TursoDB’s MIT license permits commercial embedding without copyleft obligations.
