skylite

module
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 22, 2026 License: Apache-2.0

README

skylite

CI Docs

A SQL database server where object storage is the source of truth.

That sentence is the goal, not the current state. skylite is a pre-alpha Go project that aims to build a SQL server on SQLite for Kubernetes pods with no persistent volumes: all durable state will live in object storage (Azure Blob first, then AWS S3, Google Cloud Storage and the local filesystem), and clients will talk to it over HTTPS.

Status: pre-alpha

skylite does not work yet. Today the binary prints its version and help text, and skylite serve runs a server that authenticates requests, creates databases in object storage and answers read-only SQL queries on the databases it leads. It runs no writes. Everything below the quickstart is a roadmap, not a feature list.

Why

Running a SQL database in Kubernetes usually means persistent volumes, and persistent volumes tie a pod to a disk. skylite aims to remove that coupling by making object storage the only durable store, so a pod can be replaced or rescheduled without moving a disk.

Quickstart

Install with Go:

go install github.com/RandomCodeSpace/skylite/cmd/skylite@latest
skylite version

Or build from source:

git clone https://github.com/RandomCodeSpace/skylite.git
cd skylite
make build
./bin/skylite version

skylite help lists the available commands.

Design goals

These are goals, not features. The planned storage design is recorded in decision record 0004.

  • A write is acknowledged only after it is confirmed in object storage.
  • Pod disk is a cache only.
  • One leader per database, chosen by a lease in object storage, with stale leaders fenced by conditional writes.
  • Readers fetch pages on demand with a bounded cache.
  • SQL over HTTPS, so it works through Istio and ingress.
  • A Go database/sql driver, and a JDBC driver with a Hibernate dialect.
  • Authentication, authorization and SQL lockdown on the query endpoint.

Roadmap

  1. Evaluate Litebase as a base and run a durability spike against Azurite.
  2. Storage interface and four backends (Azure Blob, AWS S3, Google Cloud Storage, local filesystem) with an emulator test suite.
  3. Storage engine: commit log, paged reads, compaction.
  4. Leader lease and failover.
  5. Read replicas.
  6. HTTPS query API and sessions.
  7. Clients: Go driver proven with GORM, JDBC driver proven with Spring Data JPA.
  8. Endpoint authentication, authorization and SQL lockdown.

Directories

Path Synopsis
cmd
skylite command
Command skylite is the skylite server binary.
Command skylite is the skylite server binary.
Package skylite is the Go database/sql driver for skylite, speaking the client protocol of ADR 0005 (docs/content/docs/decisions/0005-client-protocol.md) over HTTPS, with bearer tokens as ADR 0006 requires.
Package skylite is the Go database/sql driver for skylite, speaking the client protocol of ADR 0005 (docs/content/docs/decisions/0005-client-protocol.md) over HTTPS, with bearer tokens as ADR 0006 requires.
internal
auth
Package auth authenticates requests to the query endpoint with OIDC JWT bearer tokens and authorises them by role, as decided in docs/content/docs/decisions/0006-authentication.md.
Package auth authenticates requests to the query endpoint with OIDC JWT bearer tokens and authorises them by role, as decided in docs/content/docs/decisions/0006-authentication.md.
engine
Package engine is skylite's storage engine: it keeps a database in object storage as decision record 0004 (docs/content/docs/decisions/0004-storage-engine.md) lays it out, in the objects package format encodes.
Package engine is skylite's storage engine: it keeps a database in object storage as decision record 0004 (docs/content/docs/decisions/0004-storage-engine.md) lays it out, in the objects package format encodes.
format
Package format defines the objects that make up one database in object storage: the commit log, the base, the manifest and the lease.
Package format defines the objects that make up one database in object storage: the commit log, the base, the manifest and the lease.
office
Package office takes and keeps office for one database on this node: it runs candidacies until one succeeds, serves the database through an engine.Leader while the node holds office, and leaves office when the leader stops, the node is deposed or the caller shuts it down.
Package office takes and keeps office for one database on this node: it runs candidacies until one succeeds, serves the database through an engine.Leader while the node holds office, and leaves office when the leader stops, the node is deposed or the caller shuts it down.
server
Package server is skylite's HTTPS server: the client protocol of ADR 0005 (docs/content/docs/decisions/0005-client-protocol.md) with the authentication of ADR 0006.
Package server is skylite's HTTPS server: the client protocol of ADR 0005 (docs/content/docs/decisions/0005-client-protocol.md) with the authentication of ADR 0006.
spike/durability
Package durability is a spike to validate the durability design: Litestream embedded as a library, replicating to Azure Blob Storage through a ReplicaClient that fences stale leaders with conditional writes.
Package durability is a spike to validate the durability design: Litestream embedded as a library, replicating to Azure Blob Storage through a ReplicaClient that fences stale leaders with conditional writes.
sqlpolicy
Package sqlpolicy restricts the SQL that clients may run on a SQLite connection.
Package sqlpolicy restricts the SQL that clients may run on a SQLite connection.
storage
Package storage defines the object storage interface that every skylite storage backend implements, the errors it returns and the key rules it enforces.
Package storage defines the object storage interface that every skylite storage backend implements, the errors it returns and the key rules it enforces.
storage/azureblob
Package azureblob is a storage.Store on one container of Azure Blob Storage with a flat namespace: every object is a block blob named by its key.
Package azureblob is a storage.Store on one container of Azure Blob Storage with a flat namespace: every object is a block blob named by its key.
storage/gcs
Package gcs is a storage.Store on a Google Cloud Storage bucket, through the JSON API and the official client, cloud.google.com/go/storage.
Package gcs is a storage.Store on a Google Cloud Storage bucket, through the JSON API and the official client, cloud.google.com/go/storage.
storage/localfs
Package localfs is a storage.Store on a local directory.
Package localfs is a storage.Store on a local directory.
storage/s3
Package s3 is a storage.Store on Amazon S3 and S3-compatible object stores.
Package s3 is a storage.Store on Amazon S3 and S3-compatible object stores.
storage/storagetest
Package storagetest is the portable part of the conformance suite for storage.Store backends.
Package storagetest is the portable part of the conformance suite for storage.Store backends.
wire
Package wire encodes and decodes the client protocol of ADR 0005 (docs/content/docs/decisions/0005-client-protocol.md): request paths and bodies, SQL values, response frames, done fields, the limits object and errors.
Package wire encodes and decodes the client protocol of ADR 0005 (docs/content/docs/decisions/0005-client-protocol.md): request paths and bodies, SQL values, response frames, done fields, the limits object and errors.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL