skylite

module
v0.0.2 Latest Latest
Warning

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

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

README

skylite

CI Docs

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

skylite is a beta Go project: a SQL server on SQLite for Kubernetes pods with no persistent volumes. All durable state lives in object storage (Azure Blob, AWS S3, Google Cloud Storage or the local filesystem), and clients talk to it over HTTPS.

Status: beta

skylite serve authenticates requests with OIDC JWT bearer tokens, creates databases in object storage, leads the databases it is configured for with a lease and fencing by conditional writes, compacts their commit logs, answers stateless reads on leaders and opt-in followers, and runs autocommit writes and transactions on write channels. With a peer listener, a pod forwards a request it cannot serve one hop, over mutual TLS, to the pod that serves it. The Go driver passes a GORM acceptance test, and the JDBC driver and Hibernate dialect pass a Spring Data JPA acceptance suite, both against the real server.

Not yet verified: the real Azure, S3 and Google Cloud Storage services (the cloud backends are tested against emulators only), a real Kubernetes cluster, a real Entra ID tenant as token issuer, driver failover across several pods, and a 24-hour soak. Batch requests, read-only channels, resolve, admission control and a container image are still planned; see the roadmap below.

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

The roadmap below says which goals are met. The 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

Done:

  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: stateless reads on leaders and opt-in followers.
  6. HTTPS query API with write channels and transactions, and one-hop forwarding between pods.
  7. Clients: Go driver proven with GORM, JDBC driver proven with Spring Data JPA.
  8. Endpoint authentication, authorization and SQL lockdown.
  9. Signed release binaries.

Planned:

  1. Batch requests, describe on a channel, read-only channels and resolve.
  2. The rest of admission control.
  3. Follower-owned read channels.
  4. A container image.
  5. Verification against the real cloud storage services, on a real Kubernetes cluster and with a real Entra ID tenant, driver failover across several pods, and a 24-hour soak.

The roadmap page has the details.

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