skylite beta

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

skylite is a SQL server built on SQLite that keeps all durable state in object storage, with Azure Blob Storage as its primary backend. It needs no persistent volume: its own disk is scratch space. Applications connect over HTTPS with a Go database/sql driver or a JDBC driver.

Beta. The server runs reads, writes and transactions, with leader failover and follower reads. The Azure backend has been tested against a real storage account, failover included; S3 and Google Cloud Storage only against emulators. It has not run on a Kubernetes cluster yet. Releases are signed binaries; there is no container image.

Quick start Documentation Source on GitHub

Architecture of skyliteGo and Java services call skylite over HTTPS through ingress or Istio. One database is served by a group of skylite pods without persistent volumes: one leader takes all writes, uploads each commit and reads pages on demand; followers forward writes to the leader and fetch pages on demand. Object storage holds the lease object, the commit log, the base page groups and the manifest. A write is acknowledged only after the upload is confirmed. Conditional writes fence a stale leader; the lease only helps a takeover make progress.ClientsGo servicesdatabase/sql driverJava servicesJDBC driverHTTPS through ingress / Istioskylite pods for one databaseNo persistent volumesLeaderTakes all writesPages on demand, local cacheFollowers (N pods)Forward writes to the leaderFetch pages on demandServe reads from a bounded cacheforward writesObject storageAzure Blob, S3, GCSor local filesystemLease objectCommit logBase page groupsManifestAll durable state lives here.pages on demandFence: conditional writesLease: takeover progressAcknowledged only afterthe upload is confirmed Architecture of skyliteGo and Java services call skylite over HTTPS through ingress or Istio. One database is served by a group of skylite pods without persistent volumes: one leader takes all writes, uploads each commit and reads pages on demand; followers forward writes to the leader and fetch pages on demand. Object storage holds the commit log, the base page groups, the manifest and the lease object. A write is acknowledged only after the upload is confirmed. Conditional writes fence a stale leader; the lease only helps a takeover make progress.ClientsGo servicesdatabase/sqlJava servicesJDBCHTTPS through ingress / Istioskylite pods for one databaseNo persistent volumesLeaderTakes all writesPages on demand, local cacheforward writesFollowers (N pods)Forward writes to the leaderFetch pages on demand, cachefrom the leaderAcknowledged only afterthe upload is confirmedFence: conditional writesLease: takeover progresspages on demandObject storageAzure Blob, S3, GCS or local filesystemCommitlogBase andmanifestLeaseobjectAll durable state lives here.
Drawing Architecture Status Beta, tested on emulators Revision Current design
Read the diagram as text
  1. Go services (through the database/sql driver) and Java services (through the JDBC driver) send SQL over HTTPS, through ingress or Istio.
  2. A group of skylite pods serves one database. The pods have no persistent volumes.
  3. One pod is the leader. It takes all writes. Its ephemeral disk holds only a cache and its local write-ahead log; it reads pages from object storage on demand.
  4. The other pods are followers. They forward writes to the leader and serve reads by fetching pages from object storage on demand, with a bounded cache.
  5. The leader uploads each commit to object storage as one commit-log object and later folds the log into base page groups named by a manifest. A write is acknowledged only after the commit object is confirmed.
  6. Object storage (Azure Blob, S3, GCS or local filesystem) also holds the lease object. Conditional writes fence a stale leader; the lease only helps a takeover make progress.

Why it exists

Teams on Kubernetes often want a small relational database for their services, without running a stateful database tier or attaching persistent volumes to pods.

Object storage is already durable, cheap and replicated, and it comes with cloud-native authentication. skylite makes it the source of truth, so that anything inside a pod can be thrown away and rebuilt.

It builds on SQLite rather than a new engine, so the SQL dialect is SQLite’s own.

Design goals

Goals. The roadmap below says which are built and what is left.

Acknowledged means stored
A write is acknowledged only after object storage confirms it.
Disk is only a cache
Pod disk and memory make it faster. They are never required for capacity.
One leader per database
A lease object in object storage chooses the leader; other pods forward writes to it. Conditional writes, not the lease alone, fence a stale leader.
Reads scale with pods
Readers fetch pages from object storage on demand, with a bounded cache. Add pods to add read capacity.
Relational SQL over HTTPS
Full SQL from SQLite, carried over HTTPS so it passes through ingress and Istio without a raw TCP port.
Drivers you already use
A Go database/sql driver that works with GORM. A JDBC driver and Hibernate dialect that work with Spring Data JPA.
Locked down by default
Authentication and authorisation on the query endpoint. No extension loading, no attaching arbitrary files, query time and size limits, no secrets in logs.
Every cloud auth method
Each method each cloud supports. For Azure: Entra ID managed identity, workload identity, service principal, CLI login, shared key, SAS token and connection string.

Try it

Each release has signed binaries for Linux and macOS on amd64 and arm64. The quick start verifies the download, runs a server on a local directory and connects to it from Go and from Java.

With a Go toolchain you can also run go install github.com/RandomCodeSpace/skylite/cmd/skylite@v0.0.3.

gh release download v0.0.3 -R RandomCodeSpace/skylite \
  -p 'skylite_0.0.3_linux_amd64.tar.gz' -p 'SHA256SUMS*'
tar -xzf skylite_0.0.3_linux_amd64.tar.gz
./skylite version

Status and roadmap

Done items first, then what is planned, in order.

  1. Bootstrap: repo, CI, docs site Done

    Project scaffolding, CI, this site, and a binary that prints its version and help.

  2. Evaluate Litebase and run a durability spike Done

    Evaluate Litebase, an existing MIT-licensed SQLite-on-object-storage database, as a base. Against Azurite: acknowledge only after upload, kill mid-write, restore on an empty disk, and prove that no acknowledged write is lost and a stale leader cannot commit.

    skylite does not reuse Litebase or embed Litestream; it has its own storage engine, below.

  3. Storage interface and four backends Done

    One storage interface whose writes are create-if-absent, compare-and-swap and an unconditional delete, with Azure Blob, AWS S3, Google Cloud Storage and local filesystem backends, plus a test suite that runs against emulators. The interface, its conformance suite and all four backends exist. Each cloud backend is tested against an emulator: the S3 backend against RustFS, the Google Cloud Storage backend against fake-gcs-server and the Azure Blob backend against Azurite. The Azure Blob backend has also been run by hand against the real service. `skylite serve` can use all four backends (local filesystem, S3, Google Cloud Storage and Azure Blob Storage with a shared key or Entra ID).

  4. Storage engine: commit log, paged reads, compaction Done

    A storage layer under SQLite (ncruces/go-sqlite3) that uploads each commit from the write-ahead log as one create-if-absent object before acknowledging it, reads pages on demand from a paged base with a bounded cache, and folds the commit log into the base behind a compare-and-swap manifest. Database creation, paged reads, the leader's commit path, and compaction with retirement and garbage collection exist as a library package, tested against the local filesystem backend. The server leads its configured databases through it, compaction included.

  5. Leader lease and failover Done

    One leader per database. A lease object lets a new leader take over without downloading the database; create-if-absent commits and the manifest compare-and-swap fence a stale leader. The takeover, the lease and a loop that takes office, renews the lease, steps down when deposed or stopped, and drains and releases on shutdown exist, and skylite serve runs the loop for each database it is configured for. The server in office serves writes. A standby can serve stateless reads when enabled, and keeps serving them during a takeover. A failover soak of three servers on one machine against a real Azure storage account lost no acknowledged write; a graceful failover took 5.6 to 8.8 seconds to the first successful write, and a killed or paused leader 48 to 52 seconds, bounded by the 60-second lease. Not yet run on a real Kubernetes cluster.

  6. Read replicas Done

    The engine follower polls the durable log and pins each read-only SQLite connection to one transaction. It fetches pages on demand and supports a bounded page cache. With `follower_reads`, on by default when a peer listener is configured, a standby serves stateless query and describe requests while its snapshot is fresh, and with a peer listener forwards to the leader a read it cannot serve. Follower-owned read channels are planned, below.

  7. HTTPS query API and sessions Done

    Relational SQL over HTTPS, so traffic passes through ingress and Istio without a raw TCP port, with sessions for transactions that span requests. Exists now: skylite serve with TLS or plaintext HTTP/1.1 and HTTP/2, bearer-token authentication, the checks before acceptance, database creation (PUT), the stateless query and describe requests on leaders and opt-in followers, and write channels on the leader: open, close, cancel, autocommit writes, ping and transactions (begin, commit, rollback, savepoints, the aborted state and the transaction timers) on a channel, with sequence numbers, receipts and replay, so that a resent write never runs twice. With a peer listener, any pod takes any request and forwards it one hop, over mutual TLS, to the leader or the channel's owner, located through a leader record in object storage. Batch, describe on a channel, read-only channels and resolve are the channels milestone below; what remains of admission control is planned below.

  8. Clients: Go driver, JDBC driver and Hibernate dialect Done

    A Go database/sql driver that works with GORM and a JDBC driver with a Hibernate dialect that work with Spring Data JPA. Exists now: the Go driver, with queries, prepared statements through describe and ping, autocommit writes, transactions and savepoints on write channels, read-only transactions on read-only channels, resends under the same sequence number, retries with jittered backoff of what the server refused before it ran, resolve of a write whose channel was lost, a commit bounded by its transaction's deadline, monotonic reads across a pool, and unknown outcomes reported as such, with a GORM acceptance test against the real server (AutoMigrate, CRUD, associations, transactions, nested transactions, batch create, errors); the JDBC driver, with reads, autocommit writes, transactions and savepoints on a write channel per connection, resends with the same sequence number, generated keys, batches on the channel's batch request, read-only transactions on read-only channels, retries with jittered backoff, resolve of a write whose channel was lost, getTables and getColumns, cancel and query timeout, tested against an in-process fake server and against skylite serve; and a Hibernate dialect on the community SQLite dialect. The Spring Data JPA acceptance suite passes all 33 of its tests through the JDBC driver, the dialect, HikariCP and Hibernate against skylite serve, in CI. Driver failover across several pods has not been tested end to end.

  9. Endpoint auth and SQL lockdown Done

    Authentication and authorisation on the query endpoint; no extension loading, no attaching arbitrary files, query time and size limits. The server authenticates every request with OIDC JWT bearer tokens, authorises it by role, and runs every client statement under its SQL policy, with a statement time limit and a result size limit. Tested with locally signed tokens, not yet with a real Entra ID tenant as the issuer.

  10. Signed release binaries Done

    A version tag publishes tar.gz archives for Linux and macOS on amd64 and arm64, a SHA256SUMS file, an SBOM for each archive and a Cosign signature of SHA256SUMS. v0.0.1 is the first release.

  11. Channels: batch, describe, read-only channels, resolve Done

    The rest of the client protocol on the server: batch requests, describe on a channel, read-only channels, and resolve, so that a driver can settle a write whose outcome it lost. The leader serves all of them, and GET status. The Go driver uses read-only channels and resolve; the JDBC driver uses batch, read-only channels and resolve. Neither sends describe on a channel yet.

  12. Admission control Done

    Request bounds per pod and per principal, separate capacity for closes, cancels and resolves, a memory budget from the container's memory limit with a request body limit that scales with it, SQLite connection limits, channel bounds, a reservation for resolve's commit headers, and large response frames that wait for room. HTTP connections and response frames up to 1 MiB stay outside the budget by design, bounded by the 1,024-connection limit.

  13. Follower-owned read channels Done

    Read-only channels served by a follower rather than the leader. Exists now: with a peer listener and follower reads, a standby owns a read-only channel opened on it, once its peer record is written, when its follower reaches the open's min_txn within 500 ms and the principal has room there, and otherwise forwards the open to the leader. Each pod writes a peer record, through which every other pod forwards the channel's requests to it. A transaction reads the snapshot its begin pinned, within the read-only transaction limits and the pod's connections. The channels end when their pod takes office, shuts down or stops following, not when another pod takes office. Not yet: peer records of crashed pods are never removed, the page index an open follower transaction keeps is not charged to the memory budget, and a channel that fell back to the leader stays there.

  14. Verification beyond emulators Planned

    Runs against the real S3 and Google Cloud Storage services (the Azure Blob backend has been run by hand against the real service, not yet in CI), on a real Kubernetes cluster, with a real Entra ID tenant as token issuer, driver failover across several pods end to end, and a 24-hour soak.

Roadmap and status in the docs