Stars
Forks
Watchers
Developer links
SpiceDB
'Can Maria edit this document?' is a simple question with a hard implementation, and SpiceDB is the open-source, Zanzibar-inspired database built to answer it and millions like it correctly. You model your product once in its schema language, defining object types like documents and organizations, relations like owner and member, and computed permissions built from unions, intersections, exclusions, and arrows through other objects. Your application then writes relationships as users join groups, create folders, and share files, and SpiceDB evaluates checks against that live graph in milliseconds. Check a single permission before rendering a button, check hundreds at once to filter a dashboard, look up every resource a user can open for search prefiltering, or list every subject who can access a file for an admin screen. Per-request consistency options, anchored by revision tokens, protect you from the classic race where a revoked user briefly keeps access, and caveats add conditional rules based on context like IP address or time. Relationships persist in PostgreSQL for simple deployments or CockroachDB and Spanner when you need multi-region scale, and the same schema files validate in CI with the command-line tool before they ever reach production. Running on a dedicated VPS on RepoCloud with guaranteed CPU, RAM, and SSD, full root SSH access, and a browser serial console. Apache-2.0 licensed.
Benefits
- Permissions As A Database
- Store relationships once and compute answers for any permission question, instead of scattering role checks and join tables across every service that needs an authorization decision.
- Safe Against Revocation Races
- Per-request consistency controls and revision tokens guard against the New Enemy Problem, so a user whose access was just revoked does not slip through a stale read.
- APIs For Every Question
- Check one permission, bulk-check a screenful, expand a permission tree for debugging, or look up resources and subjects, all over gRPC or HTTP with client libraries.
- Storage You Already Run
- Relationships persist in PostgreSQL, CockroachDB, Cloud Spanner, or MySQL, and an in-memory engine serves local development and integration tests without new infrastructure.
Features
- Schema Language
- Definitions, relations, and permissions are declared in .zed files with union, intersection, exclusion, and arrow operations, validated by the zed CLI in CI.
- Check And Bulk Check
- CheckPermission answers single access questions for hot paths, while CheckBulkPermissions evaluates many checks in one call for lists, tables, and dashboards.
- Lookup And Expand
- LookupResources finds everything a subject can access, LookupSubjects lists who can access a resource, and ExpandPermissionTree explains how a decision was reached.
- Consistency And Caveats
- ZedTokens anchor reads to a revision for fully consistent answers, and caveats attach contextual conditions like time windows or IP ranges to relationships.
- Distributed Graph Engine
- Checks dispatch in parallel across SpiceDB nodes following the Zanzibar architecture, with caching of subproblem results for high-traffic workloads.
- Deep Observability
- Prometheus metrics, pprof profiles, structured logging, and OpenTelemetry tracing expose the health and latency of every authorization decision.