Architecture
Understand the query engine, B+ tree storage and write-ahead log.
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.
SELECT * FROM ideas;The embedded path avoids a network round trip. The server path gives other processes a connection over the supported MySQL protocol surface.
From SQL to rows
| Layer | Responsibility |
|---|---|
| Engine | Database lifecycle, query API and transaction entry points |
| Query | SQL lexing, parsing and statement representation |
| Catalog | Tables, expression evaluation and statement execution |
| B+ tree | Indexed key storage and lookup |
| Storage | Buffer 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.
Durability & recovery
The persistent storage path uses a write-ahead log and checkpointing. Transaction commits and page flushing must preserve the ordering that allows recovery after interruption.
Keep the database and associated files together. Use the supported backup facilities for consistent backups instead of copying a live database file by itself.
Explore the internals
See the architecture overview and the detailed architecture guide. For practical deployment boundaries, continue to the production guide.