About this project

bytdb is an embedded, pure Go relational database designed to occupy the niche of SQLite while speaking the Postgres dialect. It operates entirely within the application process, requiring no external server, no cgo, and no socket communication. Key technical features include: - **Postgres Compatibility**: Supports the Postgres wire protocol via `pgwire`, allowing tools like `psql`, `pgx`, and various ORMs (such as GORM) to connect directly. It implements a subset of the Postgres dialect, including window functions, CTEs, joins, and `jsonb` support. - **Embedded Architecture**: Built as a relational layer over `btypedb`, it encodes tables, rows, and secondary indexes into a single ordered key space. This allows for efficient key scans and atomic operations. - **Concurrency & Transactions**: Provides serializable transactions by default. It also offers an Optimistic Concurrency Control (OCC) mode for high-performance read-heavy workloads. - **Data Types**: Supports Postgres-grade types including `timestamp[tz]`, `date`, `uuid`, `text[]`, and `jsonb` with a full operator family. - **Durability & Security**: Features a write-ahead log (WAL) for power-loss durability, optional AES-256-GCM encryption at rest, and asynchronous replication to S3-compatible object stores (similar to Litestream). - **Schema Management**: Supports sparse row values, allowing for metadata-only schema changes like `AddColumn` and `DropColumn` without full table rewrites. The database can be used via a standard `database/sql` driver, a direct SQL API, or as a standalone server via the Postgres wire protocol.