by perfmode · 1y ago · 0 comments
Preloading authorization data into memory does not, by itself, provide the specific security guarantee (consistency) that defines Zanzibar.
The Zanzibar model is famous not just because it is fast, but because it solves the "New Enemy" problem (or causal consistency). Simple in-memory caching (preloading) often fails this test unless it is paired with complex invalidation logic that mimics Zanzibar's Zookies.
Generally, the solution is to keep a timestamp of when the data changed (Zookies as you mentioned) or you can proactively reload or recompute the cache when the underlying data changes (sometimes in very smart ways), but yeah: it adds significant complications over a "simplified" approach to Zanzibar.
Disclaimer: I'm the cofounder and CTO of AuthZed and we develop the SpiceDB [2] and Materialize [3], which have quite a bit of logic around these exact problems
[1]: https://authzed.com/blog/new-enemies#the-new-enemy-problem [2]: https://spicedb.io [3]: https://authzed.com/docs/authzed/concepts/authzed-materializ...
Then, I'd take a look at the history of SpiceDB [2] for how we developed the system over time.
Finally, if you have any questions, feel free to jump into our Discord [3] and ask: we're happy to answer!
[1]: https://zanzibar.tech/ [2]: https://spicedb.io [3]: https://discord.gg/spicedb