OpenFGA vs SpiceDB in 2026: ReBAC, Zanzibar & PG17 RLS TCO
Engineering and 36-month TCO teardown of OpenFGA vs SpiceDB alongside Cerbos and Permit.io in 2026: Google Zanzibar NewEnemy consistency, 50k-row ListObjects SQL joins, and PostgreSQL 17 FORCE RLS materialized ReBAC.

On this page

The OpenFGA vs SpiceDB question (or SpiceDB vs OpenFGA, depending on who asks) usually comes up when flat admin / editor / viewer flags stop being enough, often next to Cerbos vs Permit.io. Enterprise buyers want nested folders, inherited teams, guest shares, clinical overrides, and temporary support access. Coarse RBAC can't express those without piling LEFT JOIN checks into every controller, so fine grained authorization becomes an architecture decision.
OpenFGA and SpiceDB are open-source Zanzibar-style authorization engines. Both store relationship tuples and answer "can user X do Y on object Z". SpiceDB adds ZedToken consistency control, while OpenFGA is the CNCF Incubating project behind Auth0 FGA.
Clerk vs Auth0 and WorkOS vs Auth0 cover authentication (AuthN) and SAML/SCIM. Relationship-Based Access Control (ReBAC), modeled on Google's Zanzibar paper, covers object access (AuthZ). Zanzibar authorization was designed for many datacenters and many storage systems. Run it next to a single-database SaaS and you take on two costs: dual-write outbox lag, and the ListObjects SQL join bottleneck on 50,000-row tables.
At Idealogic, our SaaS development, custom software development, JavaScript development, and product development squads build authorization engines across fintech and healthtech. This teardown compares OpenFGA, SpiceDB, Cerbos, and Permit.io, then an owned PostgreSQL 17 FORCE RLS engine with a materialized ReBAC closure, and ends with a worked 36-month TCO model at 80M checks and 5M feed queries a month. Vendor prices were checked in November 2026.
The short version
- SpiceDB wins causal consistency (
ZedToken); OpenFGA wins CNCF & Auth0 ergonomics: SpiceDB (Apache-2.0) implements Zanzibar zookie-style ZedTokens to avoid the New Enemy Problem. Managed options are AuthZed Cloud (from$2/hr, resource-based) and Dedicated Cloud. OpenFGA (Apache-2.0, CNCF Incubating since January 2026) powers Okta Auth0 FGA with readable DSL/JSON models. It has no revision token, so you choose per request betweenMINIMIZE_LATENCYandHIGHER_CONSISTENCY. - Cerbos & Permit.io solve a neighboring problem: Cerbos (Apache-2.0 stateless PDP + Cerbos Hub at
$25Dev /$933/moProduction including the first 5,000 Monthly Active Principals) runs local YAML/CEL ABAC and stores no tuple graph. Permit.io (free Community tier to 1,000 MAU, Startup to 25K MAU, then Pro and Enterprise) puts policy UIs over OPA and Cedar. - Watch the 50,000-row
ListObjectsjoin trap: A point check over gRPC is quick, typically low single-digit milliseconds. PaginatingORDER BY created_at DESC LIMIT 50across 50,000 permitted rows is the slow part, because the permission set and the SQL index live in different systems. - At 80M checks + 5M feed queries/mo, owned PG17 ReBAC saves
$32.1kto$153.6kin our model: Over 36 months with SOC 2 + HIPAA BAA controls, an owned PG17 FORCE RLS closure engine comes to$73,800at CEE rates. OSS on EKS lands at$105,900, Auth0 FGA / Permit Enterprise at$200,700, and AuthZed Dedicated at$227,400. The managed monthly fees are our assumptions, since neither vendor publishes enterprise prices.
2026 engine internals: OpenFGA vs SpiceDB vs Cerbos vs Permit.io
Three things decide which authorization engine fits: the consistency you need after a revocation, how many databases your data lives in, and whether your traffic is point Check calls or paginated ListObjects joins.
OpenFGA vs SpiceDB at a glance
1. SpiceDB (authzed.com): .zed schemas, CEL Caveats & ZedToken fencing
Built by AuthZed under Apache-2.0, SpiceDB closely tracks Google's Zanzibar design:
- Causal
ZedTokenconsistency: Say an admin revokes Dr. Smith's access tochart:991att=1and adds confidential notes att=2. A cache still serving thet=0graph would leak thet=2notes. That's the New Enemy Problem from the Zanzibar paper, which solves it with tokens it calls zookies. SpiceDB returns aZedTokenon every write. Store it onchart:991, passat_least_as_fresh(token)on the next check, and SpiceDB evaluates against a snapshot at least as new as that write. - Consistent-hash dispatch & CEL Caveats: SpiceDB routes graph sub-problems across K8s pods via consistent hashing, so repeated sub-checks land on a pod that already cached them. Google CEL Caveats evaluate runtime ABAC rules (
ip_cidr,time_window,approval_limit) on tuple edges. - AuthZed pricing: The pricing page lists self-service AuthZed Cloud from
$2/hr, resource-based, which is about$1,460/moif it runs continuously. Dedicated Cloud is priced on reserved vCPU capacity and adds isolated VPC peering, HA CockroachDB, and BAAs. AuthZed doesn't publish a Dedicated number. We budget$4,500 to $8,000+/mofor it as a modelling assumption.
2. OpenFGA (openfga.dev & Auth0 FGA): CNCF ecosystem & consistency trade-offs
Donated by Auth0/Okta as a CNCF Incubating Apache-2.0 project, OpenFGA (github.com/openfga/openfga) runs a Go binary over PostgreSQL, MySQL, or SQLite:
- Readable DSL + JSON & CEL Conditions: Modular schemas (
define viewer: [user, group#member] or editor from parent_folder) and CEL Conditions plug cleanly into TypeScript CI/CD and Okta Auth0 FGA docs. - No
ZedTokenequivalent: OpenFGA doesn't expose a ZedToken-style revision token onCheckcalls. You pick a consistency mode per request instead: cachedMINIMIZE_LATENCYreads, which can be briefly stale after a revocation, or uncachedHIGHER_CONSISTENCYreads that hit the database. - Commercial Auth0 FGA: The managed service is built on OpenFGA. It comes with a free developer tier and custom Okta Enterprise contracts, and the Enterprise rates aren't public.
3. Cerbos vs Permit.io & the 50,000-Row ListObjects Join Bottleneck
- Cerbos vs Permit.io: Cerbos runs a stateless Go PDP sidecar that evaluates YAML/CEL policies locally, with no network hop to a central service, and its
PlanResourcescall emits SQL AST filters. Cerbos Hub has a free tier,$25/moDev,$933/moProduction including the first 5,000 MAPs, and custom Enterprise. Permit.io (Community free to 1,000 MAU, Startup to 25K MAU, Pro to 50K, Enterprise) puts visual RBAC/ReBAC editors over OPA and Cedar and syncs them with OPAL. - Why external ReBAC stalls on SQL pagination: On
GET /loans?status=underwriting&order=created_at.desc&limit=50across 50,000 workspace rows, external gRPC engines either stream 50,000 UUIDs viaListObjectsintoANY($1::uuid[])or run N+1Checkloops. Materialize the permissions inside PostgreSQL and the same query enforces OWASP API1:2023 BOLA andORDER BY created_at DESC LIMIT 50in one index scan.
OpenFGA vs SpiceDB vs Postgres RLS: PG17 materialized ReBAC closure blueprint
Most B2B SaaS and enterprise software development teams we meet keep nearly everything in PostgreSQL. For them there's a third option besides OpenFGA and SpiceDB: a materialized permission closure maintained in the same transaction as the data. There's no outbox to lag, no gRPC hop, and the feed query filters and sorts in one place. We target PostgreSQL 17 here, and the same SQL runs on 18. Nothing below is new to 17 either: FORCE ROW LEVEL SECURITY has been around since 9.5 and restrictive policies since 10.
The blueprint rests on cycle-guarded PostgreSQL WITH RECURSIVE CTEs and PostgreSQL row-level security. A restrictive policy builds the tenant wall, and a permissive policy checks the actor's view bit in the materialized closure. The core of it fits in two policies, with row-level security forced on the table so even its owner role is bound by them. The restrictive policy ties every row to the tenant set in the session. The permissive policy lets a SELECT through only when the actor has the view bit, with an unexpired grant, in the materialized closure. The feed query itself carries no permission logic.
With both policies in place, a plain "latest 50 documents" feed query enforces the tenant wall and Zanzibar-style visibility through one B-tree semi-join. If either session variable is unset, it returns zero rows instead of leaking. That's the property multi-tenant SaaS and API integrations need, and we cover the wider pattern in multi-tenant SaaS architecture.
Design decisions behind the owned ReBAC engine
OpenFGA vs SpiceDB cost: worked 36-month TCO benchmark (80M checks, 5M ListObjects)
Model a B2B SaaS or health/fintech platform over 36 months: 2,500 workspaces, 80,000,000 Check calls/month, and 5,000,000 paginated ListObjects queries/month, under private VPC isolation, SOC 2 Type II, and a HIPAA BAA. Every input is an assumption you should replace with your own quotes. The Option A and B monthly fees in particular are our estimates, because AuthZed and Okta price those tiers by quote. For the wider build budget, see SaaS development cost.
Labor compares Idealogic's $75/hr Senior CEE vs $165/hr US agency rates (2.2x), with Eurostat's hourly labour cost levels (lc_lci_lev) and the O*NET Software Developers (15-1252.00) occupation profile as background for the regional gap:
- Option A: AuthZed Dedicated Cloud (assumed
$5,500/moVPC SpiceDB + HA DB + BAA):- Setup (140h @
$75/hrCEE =$10,500;$165/hrUS =$23,100):.zedschema, CDC outbox sync,ZedTokenmiddleware, and reverse-index sync. - 36-mo Dedicated Cloud (
$5,500/mox 36 =$198,000): Private VPC peering, multi-AZ SpiceDB + CockroachDB, and SLA/BAA + 7h/mo (252h) sync ops ($18,900CEE /$41,580US) =$227,400($262,680US).
- Setup (140h @
- Option B: Okta Auth0 FGA / Permit.io Enterprise (assumed
$4,800/mo85M ops + sync + BAA):- Setup (120h @
$75/hrCEE =$9,000;$165/hrUS =$19,800): Tuple dual-writes,ListObjectssync or OPAL webhooks, and CEL conditions. - 36-mo Managed FGA (
$4,800/mox 36 =$172,800): Enterprise tier + HIPAA BAA + 7h/mo (252h) sync ops ($18,900CEE /$41,580US) =$200,700($234,180US).
- Setup (120h @
- Option C: Self-Hosted OpenFGA / SpiceDB on EKS (Apache-2.0 + Multi-AZ DB):
- Setup (260h @
$75/hrCEE =$19,500;$165/hrUS =$42,900): EKS Helm, Envoy hash ring, Multi-AZ CockroachDB/RDS, CDC outbox, and OTel alerts. - 36-mo EKS + Dedicated DB (
$1,350/mox 36 =$48,600): Multi-AZ DB ($780/mo), Graviton4 gRPC pods ($420/mo), and NLB/OTel ($150/mo) + 14h/mo (504h) SRE ops ($37,800CEE /$83,160US) =$105,900($174,660US).
- Setup (260h @
- Option D: Owned PG17 FORCE RLS + Materialized ReBAC Engine (Primary RDS/Aurora PG17):
- Turnkey build (600h @
$75/hrCEE =$45,000;$165/hrUS =$99,000): Cycle-safe closure SQL,AS RESTRICTIVE+AS PERMISSIVEPG17 policies, ABAC caveats, React sharing UI, SIEM logs, and shadow QA. - 36-mo Primary PG17 Delta (
$350/mox 36 =$12,600): Closure index IOPS/storage ($230/mo) + S3 audit logs ($120/mo) + 6h/mo (216h) policy ops ($16,200CEE /$35,640US) =$73,800($147,240US).
- Turnkey build (600h @
Sensitivity check: Polyglot fleets vs single-DB payback
- When SpiceDB or OpenFGA wins: The OpenFGA vs SpiceDB choice is the right one to be making once you run 15+ polyglot services (Go, Java, Python, Rust) over separate datastores (Postgres, DynamoDB, MongoDB, S3). Nothing inside one database can see all of that. Run SpiceDB or OpenFGA on EKS (
$105,90036-mo) or AuthZed Cloud (from$2/hr). - Postgres-centric SaaS payback: At
$75/hrCEE, Option D's$34,500extra CapEx over AuthZed Dedicated ($45,000 - $10,500) divided by$5,225/moOpEx savings ($6,025/movs$800/mo) pays back in 6.60 months (7.96 months vs Auth0 FGA / Permit:$36,000 / $4,525/mo; 15.94 months vs OSS EKS:$25,500 / $1,600/mo). At$165/hrUS labor the owned build costs$147,240, still under OSS EKS ($174,660), Auth0 FGA / Permit ($234,180), and AuthZed Dedicated ($262,680). The gap to EKS is thin at US rates, though.
2026 fine-grained authorization & ReBAC build costs (Senior CEE vs US)
Our SaaS development, JavaScript development, and custom software development squads ship fixed-milestone builds at $75/hr senior CEE vs $165/hr US agency rates (2.2x):
Inside the worked 600-hour ($45,000 CEE vs $99,000 US) owned ReBAC build
- 1. Tuple Schema & FORCE RLS (25% / 150h /
$11,250CEE vs$24,750US): Composite(tenant_id, ...)tuple tables,AS RESTRICTIVEtenant walls,AS PERMISSIVEactor bitmasks, andNOBYPASSRLSroles. - 2. Closure & Cycle SQL (25% / 150h /
$11,250CEE vs$24,750US): Incremental folder/team triggers,visitedcycle guards (depth < 12), and covering-index joins across 50,000+ rows. - 3. ABAC Caveats & SDK (20% / 120h /
$9,000CEE vs$19,800US): Typed Next.js/Node.js transaction middleware, IP CIDR / dollar-limit / break-glass TTL caveats, and SCIM group sync. - 4. Admin UI & SIEM Log (20% / 120h /
$9,000CEE vs$19,800US): React sharing modal, role matrix builder, access-path graph inspector, and immutable SOC 2 / HIPAA audit logs. - 5. Shadow Diff & BOLA QA (10% / 60h /
$4,500CEE vs$9,900US): Dual-read shadow diffing, automated OWASP API1:2023 fuzzing, andk6p99 benchmarks.
Google built Zanzibar because YouTube, Drive, and Cloud ran on separate storage engines across continents. When your SaaS data already lives in PostgreSQL 17, calling gRPC to filter fifty rows turns a sub-millisecond B-tree join into a distributed consistency tax.
Shipped Idealogic proof
Two Idealogic projects in production show what these access rules look like in regulated products:
- Clinical consent scoping (AddMed): Clinician, caregiver, and patient boundaries with HL7/FHIR sync across zero-incident HIPAA and GDPR pilots.
- Banking permissions (C-Bank): Account-level transaction, loan, and reporting checks under OWASP MASVS and PCI DSS v4.0.1, lifting launch-quarter downloads +30%, MAUs +40%, and cross-service usage +25%.
OpenFGA vs SpiceDB: 5-step decision checklist
Five questions settle OpenFGA vs SpiceDB, and whether Cerbos, Permit.io, or your own database is the better fit. Stop at the first yes.
- Do you run 15+ polyglot services across separate databases and need New Enemy safety? SpiceDB, on EKS or AuthZed Cloud/Dedicated.
- Are you standardized on Auth0 Organizations and want a CNCF ReBAC DSL? OpenFGA fits better, self-hosted on EKS or as Okta Auth0 FGA.
- Are your rules attribute or YAML based, with no deep tuple graph? You don't need a Zanzibar engine. Deploy Cerbos PDP sidecars.
- Does a product manager need a no-code policy UI, and you're under 25K MAU? Permit.io's Startup tier covers that.
- Do 80%+ of your tables live in PostgreSQL, with sorted
LIMIT 50feeds or HIPAA/PCI VPC rules? Build the owned PG17 FORCE RLS ReBAC engine ($73,80036-mo TCO in our model). Contact our team for a 48-hour authorization TCO audit.

CTO and Co-founder at Idealogic. Directing engineering, systems architecture, security, and full-stack delivery across web, mobile, and blockchain.
Frequently asked questions
Choose SpiceDB when strict Google Zanzibar causal consistency matters, because its ZedTokens (the Zanzibar paper calls them zookies) let a check right after a revocation run on data at least as fresh as that write, and its consistent-hash dispatch keeps deep relationship graphs cacheable. Choose OpenFGA when your stack already centers on Auth0 by Okta, you prefer a CNCF Incubating Apache 2.0 runtime with readable JSON and DSL models, or you want a gentler learning curve over PostgreSQL.
The New Enemy Problem occurs when an owner removes Alice from a confidential folder and immediately pastes sensitive secrets into a document inside that folder, while a stale replica or cache node still evaluates Alice's old tuple and leaks the new content. SpiceDB returns an opaque ZedToken revision on every write, so later Check calls can pass at_least_as_fresh and read data no older than that write. OpenFGA doesn't expose a ZedToken-style revision token. Callers pick per request between cached MINIMIZE_LATENCY reads and uncached HIGHER_CONSISTENCY datastore reads.
Neither one is a Zanzibar tuple store. Cerbos is an Apache 2.0 stateless policy decision point that evaluates YAML and CEL rules locally and stores no relationship tuples. Cerbos Hub adds a free tier, a $25 Development plan, Production from $933 per month including the first 5,000 Monthly Active Principals, and custom Enterprise. Permit.io is a managed control plane with visual policy editors over Open Policy Agent and AWS Cedar, kept in sync by its OPAL project. Its pricing page lists a free Community tier to 1,000 MAU, Startup to 25,000 MAU, Pro to 50,000 MAU, and Enterprise.
Point authorization checks (can user X edit document Y) take single-digit milliseconds over gRPC, but filtered index pages (show the latest 50 active invoices user X can view out of 50,000 workspace rows sorted by created_at DESC) create a distributed join bottleneck. Streaming 50,000 object IDs from ListObjects into a PostgreSQL ANY array on every page view saturates network buffers, whereas materializing effective permissions inside PostgreSQL resolves the sorted LIMIT 50 query in one indexed B-tree join.
AuthZed's pricing page lists self-service AuthZed Cloud from $2 per hour with resource-based billing, Dedicated Cloud priced on reserved vCPU capacity, and licensed self-hosted SpiceDB. Dedicated pricing is quote only. Okta sells Auth0 FGA, which is built on OpenFGA, with a free developer tier and custom Enterprise contracts, and it doesn't publish Enterprise rates.
User-managed folder sharing and nested B2B team memberships can accidentally introduce cyclic edges, such as Group A containing Group B while Group B is added back into Group A. In PostgreSQL 17 recursive common table expressions and closure triggers, tracking an explicit visited UUID array path with NOT (child_id = ANY(visited_path)) alongside a hard hop depth cap (such as depth below 12) prevents runaway CPU loops.
No, they enforce complementary defense-in-depth layers against OWASP API1:2023 Broken Object Level Authorization. Application middleware validates OIDC tokens, coarse route scopes, and contextual caveats such as IP allowlists or step-up MFA timestamps, then binds verified app.current_tenant_id and app.current_actor_id session variables via SET LOCAL so PostgreSQL 17 FORCE ROW LEVEL SECURITY blocks cross-tenant or unauthorized row reads inside SQL joins, aggregations, and exports.
External Zanzibar engines excel when dozens of polyglot microservices across Go, Java, Python, and Rust each own separate databases and share one global permission graph. When 80% or more of your domain entities live in PostgreSQL, the math flips. In our worked model, a 600-hour senior CEE build at $75 per hour ($45,000 CapEx, or $99,000 at $165 per hour US rates) comes to a $73,800 36 month TCO across 80 million monthly checks. That's $32,100 less than self-hosted EKS clusters and $126,900 to $153,600 less than the managed enterprise clouds as we priced them.
More from the journal

Paddle vs Lemon Squeezy in 2026: MoR Fees, Stripe & TCO
Paddle vs Lemon Squeezy and Stripe Managed Payments in 2026, compared on fees and 36-month TCO: stacked international and subscription surcharges, merchant of record liability, B2B Net-30 invoicing, PG17 entitlement guards, and the math for a $6M/yr SaaS.

Nylas vs Cronofy in 2026: Calendar Sync, CASA & TCO
Nylas vs Cronofy vs Aurinko and owned Google Workspace + Microsoft Graph sync in 2026: public per-account pricing, which Google scopes need CASA Tier 2, a PostgreSQL KMS token vault, and 36-month TCO math at 6,000 accounts.

GrowthBook vs LaunchDarkly in 2026: Flags, CUPED & TCO
Engineering and 36-month TCO benchmark of GrowthBook vs LaunchDarkly in 2026 alongside Statsig (OpenAI / Amplitude) and CNCF OpenFeature: warehouse-native CUPED SQL, client MAU vs $40/seat billing, PG17 SSE providers, and 500k-MAU math.