# TursoDB vs MariaDB

> MariaDB is a strong open-source server RDBMS with pluggable storage engines, Galera multi-master clustering, and native HNSW vector search—ideal for teams running centralized server infrastructure. TursoDB targets a different model: zero-daemon embedding, MIT licensing, per-tenant file isolation, and offline-capable local-to-cloud sync.
> Canonical HTML: https://tursodb.cn/compare/turso-vs-mariadb/
> Language: en
> MariaDB Official Site: https://mariadb.org/

## Overview
Unlike MySQL Community Edition, MariaDB includes native open-source vector indexing and multi-master clustering via Galera. Even so, MariaDB remains a traditional C/C++ client-server database, whereas TursoDB is an embedded Rust engine designed to live inside your app and sync with the cloud.

## Comparison Matrix
| Dimension | TursoDB | MariaDB |
| :--- | :--- | :--- |
| Core Engine | Embedded Rust engine — SQLite-compatible core with non-blocking async I/O | C/C++ pluggable server — Supports InnoDB, Aria, RocksDB/MyRocks, and ColumnStore storage engines |
| Deployment Model | In-process single file — Embedded library locally or synced with Turso Cloud | Dedicated server daemon — Self-hosted Linux/containers or managed MariaDB Cloud over TCP |
| Concurrency & Writes | Optimistic MVCC writes — BEGIN CONCURRENT concurrency isolated per database file | InnoDB + Galera multi-master — High-concurrency row locking with optional synchronous cluster writes |
| Sync & Edge Replication | Native local-to-cloud sync — Bidirectional sync and in-process embedded read replicas | Server & Galera clustering — Async server replication and synchronous data-center clusters; no offline sync |
| Multi-Tenant Isolation | Native database-per-tenant — Near-zero idle memory and isolated single-file lifecycles | Shared server instance — Thousands of separate databases increase server memory and metadata overhead |
| Vector & AI Search | Built-in DiskANN vectors — Disk-friendly vector columns embedded inside the database file | Server-side HNSW vectors — Native VECTOR type with HNSW index in MariaDB 11.7+ |
| SQL Dialect & Ecosystem | Lean SQLite dialect — Minimal operational surface with modern polyglot SDKs | Extended MySQL dialect — System-versioned temporal tables, sequences, and Oracle compatibility mode |
| License | MIT permissive license — Zero GPL server obligations for commercial distribution | GPLv2 server / LGPL clients — Community-governed open-source server with LGPL connectors |

## When to Choose TursoDB
- You need an embedded database inside desktop apps, CLI tools, edge workers, or ephemeral AI agent containers.
- You want local-first offline reads/writes that sync automatically back to a cloud primary.
- You are scaling multi-tenant SaaS with thousands or millions of isolated databases rather than one shared cluster.
- You want permissive MIT licensing with no GPL server obligations.

## When to Choose MariaDB
- You want a centralized, community-governed MySQL-compatible server with native open-source HNSW vector search.
- You need synchronous multi-master high availability across data-center nodes using Galera Cluster.
- Your workload relies on advanced server features such as system-versioned temporal tables, stored routines, or ColumnStore analytics.
- You are migrating off MySQL and want broad drop-in compatibility with existing queries and connectors.

## Architecture Deep Dive
### Embedded DiskANN vs. Server-Side HNSW
Both MariaDB (11.7+) and TursoDB treat vector search as a first-class SQL feature rather than an external sidecar. The architectural split is where those vectors live: MariaDB indexes vectors inside a centralized server’s RAM and disk, while TursoDB uses DiskANN inside portable single-file databases that can travel with an edge node or local agent.

### Galera Clustering vs. Edge & Device Sync
MariaDB’s Galera Cluster solves server-room high availability across low-latency data-center links, where every node stays online and participates in certification-based replication. TursoDB’s sync engine targets intermittently connected clients, edge nodes, and per-tenant replicas that operate independently and reconcile with Turso Cloud over standard HTTP.

## FAQ
### How does MariaDB’s vector search compare to TursoDB’s?
MariaDB uses an in-server HNSW index well suited for centralized workloads with dedicated RAM, whereas TursoDB uses DiskANN designed to keep memory usage low across many small embedded or disk-backed databases.

### Can MariaDB run embedded like TursoDB?
MariaDB is designed primarily as a standalone server daemon. While legacy libmysqld existed historically, modern MariaDB deployments assume a client-server process rather than an in-process single-file engine.

### When should I pick MariaDB over both MySQL and TursoDB?
Choose MariaDB when you want a traditional centralized MySQL-compatible server with open-source HNSW vectors, temporal tables, or Galera clustering under community governance.
