Getting startedInstall CobaltDB and run your first SQL query in Go.SQL & JSONTables, indexes, parameterized queries, JSON and transactions.ArchitectureExplore disk-paged B+trees, bounded memory and crash recovery.Server & clientsConnect MySQL 8.4 clients and ORMs to the standalone server.Production guidePlan TLS, security, backups, observability and deployment boundaries.Performance benchmarksPaged storage, memory measurements and benchmark methodology.FeaturesSQL, transactions, encryption and a pure Go runtime.Brand assetsDownload the CobaltDB SVG logo and icon.
K to open ESC to close
Documentation

Architecture

Explore disk-paged B+trees, bounded memory and crash recovery.

One engine, two entry points

Embedded applications call the Go engine directly. The standalone server adds network protocols, authentication and operational services around the same database foundation.

The embedded path avoids a network round trip. The server path gives other processes a connection over the MySQL 8.4 SQL and wire protocol.

From SQL to rows

LayerResponsibility
EngineDatabase lifecycle, query API and transaction entry points
QuerySQL lexing, parsing and statement representation
CatalogTables, expression evaluation and statement execution
B+ treeIndexed key storage and lookup
StorageBuffer pool, persistent pages and write-ahead logging

The repository organizes these layers under pkg/. Use that code and its regression tests as the authority for specific behavior.

Disk pages, bounded memory

Each table and index is a B+tree of 4 KiB pages with CRC-32C checksums. The buffer pool defaults to 128 MiB. Opening a database loads catalog metadata, not every row into memory.

Results stream to clients. Large transaction write sets, sorts, eligible GROUP BY groups and derived UNIONs spill to scratch files beside the database. Memory use still depends on the statement: the page cache is not a hard cap on total server memory.

Set -cache in pages and -memory-limit for a soft memory budget. The server also detects container cgroup limits.

Durability & recovery

Group commit batches WAL syncs. A rollback journal protects against torn page writes, while fuzzy checkpoints and a persistent free list support recovery and page reuse. Checkpoints run every five minutes or after 256 MiB of WAL by default.

Keep the database and associated files together. Use the supported backup facilities for consistent backups instead of copying a live database file by itself.

Pick the right persistence mode. In-memory mode is deliberately ephemeral. Measure persistent workloads separately from in-memory benchmarks.

Explore the internals

See the architecture overview and the detailed architecture guide. For practical deployment boundaries, continue to the production guide.

Source-aligned guide · CobaltDB v0.7.0Suggest an improvement