Skip to content

Architecture

Kessel is a distributed system that keeps track of resources reported by services, and answers permission questions about those resources. Services talk to a single API (Kessel Inventory API) for both.

When a resource is written, the corresponding permission data is replicated to the authorization backend, either asynchronously (default) or synchronously if the service requests immediate consistency. Kessel offers different consistency modes so services can choose whether to prioritize speed or freshness when checking permissions. See Consistency model for details.

ComponentRole
Kessel Inventory APICentral API for reporting resources, checking permissions, and listing accessible resources. This is the primary integration point for services.
Authorization backend (SpiceDB)Graph database that stores relationships between resources, users, and permissions. Evaluates permission checks by traversing the relationship graph.
Kessel Inventory databaseStores resource data, reporter representations, and correlation state.
CDC connectorCaptures database changes via change data capture and publishes events to a message stream.
Message streamDurable event transport between components. Carries resource lifecycle events and relationship tuple updates.
Kessel Inventory ConsumerProcesses resource events from service provider databases and calls the Inventory API to ingest resources. Enables CDC-based integration where services replicate resources to Kessel without direct API calls.
RBAC serviceManages roles, role bindings, workspaces, and group-to-user mappings. Writes relationship changes to the authorization graph via its own replication pipeline.

Data moves through Kessel in three main flows: reporting resources, replicating authorization data, and checking access.

Open full diagram

1. ReportResource
(gRPC/HTTP)

2. Write resource +
outbox event

3. Change
captured

4. Event
published

6. Write
tuples

5. Event
consumed

7. Update
relationships

Check
(gRPC/HTTP)

Evaluate
permissions

A1. Roles, workspaces,
groups (HTTP)

A2. Write changes +
outbox event

A3. Change
captured

A4. Event
published

A6. Write
tuples

A5. Tuple event
consumed

Service Provider

Inventory API

Inventory
Database

CDC
Connector

Inventory Internal
Consumer

RBAC
Consumer

Message Stream
(Kafka)

Authorization
Backend
(SpiceDB)

RBAC Service

RBAC
Database

CDC
Connector

When a service calls ReportResource, the Inventory API writes the resource data to its database. The permission-relevant relationships implied by the resource are then replicated to SpiceDB asynchronously by default, or synchronously if the service requests immediate consistency.

When a service calls Check, the Inventory API queries SpiceDB relationships directly to determine whether or not the requested subject has appropriate access.

When using the default async replication, there is a brief window between a write and that write becoming visible to permission checks. Kessel provides consistency modes that let services choose whether to prioritize speed or freshness, including an immediate mode that eliminates this window entirely.

Kessel publishes resource lifecycle events (creates, updates, deletes) to a message stream. Downstream systems can subscribe to react to resource changes without polling the Inventory API.

Services can integrate with Kessel either by calling the Inventory API directly or by using CDC-based ingestion, where a connector replicates resource data from the service’s own database into the message stream.