skylite beta
Documentation menu

Decisions

Architecture decision records for skylite.

This section holds the project’s architecture decision records (ADRs). Each record captures one decision: the context that forced it, what was chosen, what was rejected and what follows from it. Records are kept after they are superseded, so the history of the design stays readable.

The sidebar lists the records in order. The architecture page summarises the choices they settled.

Adding a record

  1. Create a file in docs/content/docs/decisions/ named with the next number and a short slug, for example 0001-leader-fencing.md, and paste in the ADR template.
  2. Set its weight to the record number so the sidebar lists records in order.
  3. Open a pull request. The record is accepted when the pull request merges.
  4. To change a decision, write a new record that supersedes the old one, and set the old record’s status to “Superseded by” with a link to the new one.
  • 0001: Build new instead of reusing Litebaseskylite will not reuse or fork Litebase; it will be built as a new server embedding Litestream, with fencing and leader election implemented by skylite.
  • 0002: Durability spike against AzuriteResults of a spike that tested acknowledged-write durability and stale-leader fencing with Litestream as a library against Azurite. Accepted as evidence; the architecture decision follows separately.
  • 0003: JDBC transportskylite will ship its own JDBC driver over its HTTPS API, because a Spring Data JPA acceptance suite did not pass through the Arrow Flight SQL JDBC driver.
  • 0004: Build skylite's own storage engineskylite will build its own storage engine on ncruces/go-sqlite3, with a commit log whose names are never freed, a paged base and a manifest in object storage, and will not use Litestream in the product.
  • 0005: Client protocolskylite will define its own protocol between the server and its Go and JDBC drivers: JSON over ordinary HTTP requests, newline-delimited JSON results, and channels with sequence numbers for every request that can write, and resolution from commit headers when a channel is lost, so that, for a driver that alone holds its channel's token, no request takes effect twice and no driver reports an outcome it cannot prove.
  • 0006: AuthenticationClients authenticate to the query endpoint with OIDC JWT bearer tokens only, verified with go-jose against configured issuers, and are authorised by deny-by-default role rules.
  • 0007: SQL policyClient SQL runs one statement at a time under a default-deny SQLite authorizer, defensive configuration and limits that lower, but do not remove, the chance of overflowing the ncruces build's 64 KiB C stack, with a cooperative time limit, panic containment that turns an overflow into a broken connection, and a reset between principals, all applied by internal/sqlpolicy; the engine and the server carry the requirements the package cannot meet alone.
  • ADR templateThe template every architecture decision record starts from.