Quick revision
The short answer
A central authorization service gives consistent rules, one audit trail and features such as sharing across products, but it becomes a critical dependency with strict latency and availability targets, and building one is a multi-year platform investment. Open-source and commercial Zanzibar-style systems exist and should be compared before building. Applications still need local enforcement points, for example custom AuthorizationManagers that call the service. I would decide from product needs, such as sharing and cross-product permissions, and pilot with one product first.
What to remember
In this answer, we recapped relationship-based authorization and weighed a central service's consistency, cross-product sharing and audit against its cost as a critical, latency-sensitive dependency and a long platform investment. We compared building with adopting open-source or commercial engines, kept local enforcement points such as custom AuthorizationManagers in each application, and decided from product needs with a measured pilot on one product.
Your turn
Answer it aloud as you would in the interview, or type your answer below. Then show one part at a time and compare.
A central authorization service gives consistent rules, one audit trail and features such as sharing across products, but it becomes a critical dependency with strict latency and availability targets, and building one is a multi-year platform investment. Open-source and commercial Zanzibar-style systems exist and should be compared before building. Applications still need local enforcement points, for example custom AuthorizationManagers that call the service. I would decide from product needs, such as sharing and cross-product permissions, and pilot with one product first.
Why this question is asked
Google's Zanzibar paper described a single system that answers who can do what for products like Drive, Calendar and YouTube, and many companies now ask whether they need the same. The question is a classic senior leadership decision: it touches every product team, it is expensive to reverse, and the arguments on both sides are strong. Interviewers ask it to see whether we can structure a decision rather than follow a trend. In this answer, we will recap relationship-based authorization, weigh the benefits and costs of a central service, compare build and buy, describe the local enforcement that remains, and lay out the decision process with a pilot.
1A Quick Recap: Relationship-Based Authorization
In relationship-based access control (ReBAC), permissions come from relationships stored as small facts, often called tuples: document 42 has viewer user anne; folder 7 is the parent of document 42; group finance has member bob. Rules then say how relationships combine, for example anyone who is a viewer of a folder is a viewer of its documents. A check asks a single question: does user anne have permission view on document 42? The service walks the relationships and answers.
This model is excellent for sharing, nested folders, organisations and teams, which are hard to express with roles. Zanzibar also tackled consistency: after a user is removed from a document, a later check must not use stale data, so checks can carry a consistency token that says how fresh the answer must be.
2What a Central Service Gives Us
The benefits grow with the number of products. Rules are defined once, so sharing a project means the same thing in every product. A user's access can be answered across products, which matters for features like a single share dialog or an admin seeing everything a departing employee could reach. Audit and access reviews read from one place instead of twenty databases. And product teams stop building their own sharing model, which is often several engineer-months per product.
Some features are almost impossible without it: cross-product permissions, such as a project in one product granting access to its files in another, need one shared graph of relationships.
3What It Costs
The service sits on the path of nearly every request in every product. If it is slow, everything is slow; if it is down and enforcement fails closed, as it must, every product is down. So it needs availability at least as high as the most important product, typically 99.99 percent, and check latency of a few milliseconds at the 99th percentile, which means caching, replication across regions and careful capacity planning.
There are also migration costs. Each product must write its relationships into the service and keep them in sync, often through dual writes or events, and must move its existing permission data. List queries, such as all documents anne can see, need special support. And the team running it becomes a platform team with an on-call rotation for years.
| Factor | Central service | Per application |
|---|---|---|
| Consistency across products | High, one model | Each product its own |
| Cross-product sharing | Natural | Hard, custom integration |
| Latency and availability risk | Shared critical dependency | Contained to each app |
| Up-front cost | High, platform team for years | Low, grows per product |
| Audit | One place | Many databases |
| Team autonomy | Lower, shared schema | Higher |
4Build or Buy?
Building a Zanzibar-style system from scratch is a large project: a storage layer with consistency guarantees, a graph evaluation engine, caching, a schema language, tooling and client libraries. Before anyone writes code, we compare existing options. Open-source systems inspired by Zanzibar, such as OpenFGA, SpiceDB and Ory Keto, can be self-hosted, and several vendors offer managed services. Policy engines like OPA or Cedar are an alternative when rules are mostly attribute-based rather than relationship-based.
The comparison should use our own workload: number of relationships (often hundreds of millions), check rate at peak, latency target, regions, how list queries are served and the cost of the operations team. In most companies, adopting an existing engine and running it well is far cheaper than building one, and the remaining work, integration and migration, is still substantial.
5Local Enforcement Still Lives in Each Application
A central service makes decisions; it does not enforce them. Each application still decides where to ask and what to do with the answer. In Spring, that is a custom AuthorizationManager or an authorization bean used from method security, which calls the service's check API with the user, the permission and the object, and returns the decision. Applications also keep coarse local checks, such as authentication and scopes in the filter chain, so a basic request does not need a remote call.
A thin shared client library helps: it handles retries, timeouts, consistency tokens and a short local cache, and it fails closed. Because the enforcement point is a single class, a product can move onto the central service, or off it, without touching business code.
6How I Would Decide
I would start from product needs, not architecture taste. If the roadmap needs sharing between users, nested organisations, or permissions that span products, a central service pays for itself. If products have simple role checks and little sharing, a shared library and standards give most of the consistency at a fraction of the cost.
- Sharing or cross-product permissions on the roadmap?YesEvaluate a central serviceNoShared library and standards
- Compare open-source, managed and buildour workload, latency, regions
- Pilot with one productone with real sharing needs
- Pilot meets latency, availability, effort targets?YesPlan the next productsNoStop or change option
- Migrate product by productdual write, then switch reads
5 steps in order. Play them, or step through them one at a time.
The pilot is the key step. We choose one product with a genuine need, define success up front, for example p99 check latency under 10 ms, no availability incidents caused by the service for a quarter and migration effort under two engineer-months, and measure. A pilot that fails these targets is a cheap lesson; a company-wide mandate that fails is not.
7Follow-up questions
How do you avoid every request paying for a remote call?
Keep coarse checks local, cache recent decisions briefly, batch checks for lists, and place the service close to applications, in the same region or as a sidecar cache. Consistency tokens let us use cached answers except where freshness matters, such as right after a permission change.
What happens when the authorization service is down?
Enforcement fails closed, so affected features stop. That is why the service needs the highest availability tier, multiple regions and a clear runbook. Some products choose a degraded mode, such as read-only access from a cached decision, but only for explicitly approved low-risk actions.
Who owns the authorization model?
The platform team owns the service and the schema language; product teams own their parts of the schema, reviewed by the platform and security teams. Without that split, either the platform team becomes a bottleneck or the schema becomes inconsistent again.
8Conclusion
In this answer, we recapped relationship-based authorization and weighed a central service's consistency, cross-product sharing and audit against its cost as a critical, latency-sensitive dependency and a long platform investment. We compared building with adopting open-source or commercial engines, kept local enforcement points such as custom AuthorizationManagers in each application, and decided from product needs with a measured pilot on one product.
Open with
I would frame it as a product decision, not an architecture preference. A central, Zanzibar-style service gives one consistent model, one audit trail, and features like sharing and permissions that span products, which are very hard to build product by product.
Then, if they want more
But it becomes a dependency of almost every request, so it needs top-tier availability, low single-digit millisecond check latency, multi-region operation and a platform team for years, plus migration work in every product. So first I would ask whether the roadmap really needs sharing, nested organisations or cross-product permissions. If not, shared libraries and standards per application are cheaper.
If yes, I would compare open-source options like OpenFGA or SpiceDB, managed services and building our own against our real numbers, and building from scratch would need a strong reason. Either way, applications keep local enforcement: coarse checks in the filter chain and a custom AuthorizationManager or method security bean that calls the service and fails closed.
Then I would pilot with one product that has real sharing needs, with targets set in advance for latency, availability and migration effort, and only roll out further if the pilot meets them.
About this answer
- Last updated
- 12 November 2026
- Checked
- Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the documentation below. What the checks cover
- Where the question comes from
- Written by Scrivio for practice. It is not taken from an interview.
- Official documentation
- Spring Security reference
Report an issue with this answer
Copy the line below and send it to the author with what you found. It carries the address of this page.
Issue with "Should your company build a central authorization service (for example...": https://scrivio-interview-library.netlify.app/spring-boot/authorization/560a131f43/