In a blog post from December 2024 we announced that we had developed the initial foundations for composable schemas. Today, I'm excited to share that composable schemas are now generally available in SpiceDB 1.51.1.
What are Composable Schemas?
Composable schemas allow you to better manage and modularize your large schemas, which helps organizations scale. It also enables the open source community to design reusable data models for common problems and schema structures.
In practice, large schemas tend to become monolithic. Composable schemas solve this by enabling you to split your schema into well-defined, reusable components, so teams can move faster, make changes, and scale without everything becoming entangled. Just as importantly, this modular approach unlocks new possibilities for the open source community, making it easier to share, reuse, and build on common authorization patterns rather than reinventing them from scratch.
"AuthZed's composable schemas have been a blessing and have helped us better manage authorization at scale. Instead of wrestling with one massive monolithic schema, we're now breaking things into clean, reusable pieces that are actually readable and reflect how our systems and core components are built. It's made the development workflow faster, safer, and much easier to work with."
— Simon Bruno, Senior Security Engineer at Forter
How To Use Composable Schemas
The composable schemas feature required significant changes in our schema compiler around making it filesystem-aware so that, if an error occurs, we can tell you exactly which file contains the error. For similar reasons, we also updated our Language Server Protocol, which is used by the VS Code extension, to be filesystem-aware.
There are two breaking changes compared to the Preview to be aware of:
use importis now required if you want to useimport "foo.zed"syntax.use partialis now required if you want to declare or reference partials.
In order to enhance the developer experience, we have made a number of changes to our tooling, namely:
- We released the Zed CLI to v1. The various
zedcommands now support composable schemas. For example:zed validate <root.zed>is what you can call to validate across multiple files. It will resolve your imports and validate those files as well.zed schema compile <root.zed>is what will combine the multiple files back into one schema that you can then write in SpiceDB.
- We released VS Code extension 1.1.1 to work with composable schemas. For example, when you are hovering over a definition (or a caveat, or a partial) that is declared in another file, you will get the right tooltip; or if you press F12 to navigate to a definition, it will navigate to the file that declared it.
Note that our playground does not support import syntax as the Playground uses a singular editor (and doesn't support the notion of files). But let us know if this is something that you would like us to support!
Thank You, SpiceDB Community
We would like to thank the community for your patience in releasing this, and for your bug reports that allowed us to make a better experience for everyone.
If you run into issues or would like to request a feature, open an issue or hit us up in our Discord server. Happy modeling!
