# restatedev/restate architecture

> Architecture diagram of the GitHub repository restatedev/restate, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/restatedev/restate
- Repository: https://github.com/restatedev/restate

## Overview

Restate is a distributed runtime for durable execution, reliable communication, promises and timers, consistent state, and service introspection. A typical request enters through HTTP or Kafka, is handled by a partition worker, and relies on durable state and log storage to recover progress; the CLI and admin API provide operational control and inspection. The README documents product capabilities, while the sampled source and SOURCE INDEX expose selected wiring. Some runtime links and integrations are therefore omitted rather than inferred.

Main entry points: [`crates/worker/src/partition_processor_manager.rs`](https://github.com/restatedev/restate/blob/main/crates/worker/src/partition_processor_manager.rs) (Partition Workers), [`crates/admin/src/rest_api/mod.rs`](https://github.com/restatedev/restate/blob/main/crates/admin/src/rest_api/mod.rs) (Admin REST API), [`crates/invoker-impl/src/invocation_state_machine.rs`](https://github.com/restatedev/restate/blob/main/crates/invoker-impl/src/invocation_state_machine.rs) (Invocation State), [`crates/core/src/network/connection_manager.rs`](https://github.com/restatedev/restate/blob/main/crates/core/src/network/connection_manager.rs) (Node Connections)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingress["Request Entry"]
  node_http["HTTP Ingress<br/>[server.rs]"]
  node_http_handlers["Request Handlers<br/>[mod.rs]"]
  node_kafka["Kafka Consumer<br/>[consumer_task.rs]"]
end

subgraph group_execution["Durable Execution"]
  node_invoker["Invocation State"]
  node_worker["Partition Workers"]
  node_scheduler["Queue Scheduler"]
end

subgraph group_storage["Persistence"]
  node_partition_store[("Partition Store")]
  node_partition_db[("Partition Database<br/>[partition_db.rs]")]
  node_rocksdb[("RocksDB Manager<br/>[db_manager.rs]")]
  node_bifrost[("Durable Log<br/>[bifrost.rs]")]
  node_log_server[("Log Server<br/>[service.rs]")]
end

subgraph group_cluster["Cluster Services"]
  node_network["Node Connections"]
  node_handshake["Peer Handshake<br/>[handshake.rs]"]
  node_metadata[("Metadata Management<br/>[manager.rs]")]
end

subgraph group_operations["Admin and Insight"]
  node_admin_api["Admin REST API<br/>[mod.rs]"]
  node_cli["Restate CLI<br/>[app.rs]"]
  node_query_manager["Distributed Query"]
  node_query_client["Remote Scan Client"]
  node_web_ui["Admin Web UI<br/>[web_ui.rs]"]
end

node_user(("Service Caller"))

node_user -->|"sends requests"| node_http
node_http -->|"routes requests"| node_http_handlers
node_user -.->|"publishes events"| node_kafka
node_http_handlers -.->|"starts invocations"| node_invoker
node_kafka -.->|"starts invocations"| node_invoker
node_invoker -.->|"durable execution"| node_worker
node_worker -.->|"persists progress"| node_partition_store
node_worker -.->|"schedules work"| node_scheduler
node_partition_store -->|"opens databases"| node_partition_db
node_partition_db -.->|"uses storage"| node_rocksdb
node_worker -.->|"records log"| node_bifrost
node_bifrost -.->|"replicated log storage"| node_log_server
node_network -->|"performs handshake"| node_handshake
node_network -.->|"exchanges cluster metadata"| node_metadata
node_cli -.->|"operates services"| node_admin_api
node_admin_api -.->|"serves introspection"| node_web_ui
node_admin_api -.->|"exposes SQL queries"| node_query_manager
node_query_manager -->|"opens remote scans"| node_query_client

click node_http "https://github.com/restatedev/restate/blob/main/crates/ingress-http/src/server.rs"
click node_http_handlers "https://github.com/restatedev/restate/blob/main/crates/ingress-http/src/handler/mod.rs"
click node_kafka "https://github.com/restatedev/restate/blob/main/crates/ingress-kafka/src/consumer_task.rs"
click node_invoker "https://github.com/restatedev/restate/blob/main/crates/invoker-impl/src/invocation_state_machine.rs"
click node_worker "https://github.com/restatedev/restate/blob/main/crates/worker/src/partition_processor_manager.rs"
click node_scheduler "https://github.com/restatedev/restate/blob/main/crates/vqueues/src/scheduler/resource_manager.rs"
click node_partition_store "https://github.com/restatedev/restate/blob/main/crates/partition-store/src/partition_store_manager.rs"
click node_partition_db "https://github.com/restatedev/restate/blob/main/crates/partition-store/src/partition_db.rs"
click node_rocksdb "https://github.com/restatedev/restate/blob/main/crates/rocksdb/src/db_manager.rs"
click node_bifrost "https://github.com/restatedev/restate/blob/main/crates/bifrost/src/bifrost.rs"
click node_log_server "https://github.com/restatedev/restate/blob/main/crates/log-server/src/service.rs"
click node_network "https://github.com/restatedev/restate/blob/main/crates/core/src/network/connection_manager.rs"
click node_handshake "https://github.com/restatedev/restate/blob/main/crates/core/src/network/handshake.rs"
click node_metadata "https://github.com/restatedev/restate/blob/main/crates/core/src/metadata/manager.rs"
click node_admin_api "https://github.com/restatedev/restate/blob/main/crates/admin/src/rest_api/mod.rs"
click node_cli "https://github.com/restatedev/restate/blob/main/cli/src/app.rs"
click node_query_manager "https://github.com/restatedev/restate/blob/main/crates/storage-query-datafusion/src/remote_query_scanner_manager.rs"
click node_query_client "https://github.com/restatedev/restate/blob/main/crates/storage-query-datafusion/src/remote_query_scanner_client.rs"
click node_web_ui "https://github.com/restatedev/restate/blob/main/crates/admin/src/web_ui.rs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_http,node_http_handlers,node_kafka toneBlue
class node_invoker,node_worker,node_scheduler toneAmber
class node_partition_store,node_partition_db,node_rocksdb,node_bifrost,node_log_server toneMint
class node_network,node_handshake,node_metadata toneRose
class node_admin_api,node_cli,node_query_manager,node_query_client,node_web_ui,node_user toneIndigo
```

## Components

### Request Entry

- [HTTP Ingress](https://github.com/restatedev/restate/blob/main/crates/ingress-http/src/server.rs): `crates/ingress-http/src/server.rs`
- [Request Handlers](https://github.com/restatedev/restate/blob/main/crates/ingress-http/src/handler/mod.rs): `crates/ingress-http/src/handler/mod.rs`
- [Kafka Consumer](https://github.com/restatedev/restate/blob/main/crates/ingress-kafka/src/consumer_task.rs): `crates/ingress-kafka/src/consumer_task.rs`

### Durable Execution

- [Invocation State](https://github.com/restatedev/restate/blob/main/crates/invoker-impl/src/invocation_state_machine.rs): `crates/invoker-impl/src/invocation_state_machine.rs`
- [Partition Workers](https://github.com/restatedev/restate/blob/main/crates/worker/src/partition_processor_manager.rs): `crates/worker/src/partition_processor_manager.rs`
- [Queue Scheduler](https://github.com/restatedev/restate/blob/main/crates/vqueues/src/scheduler/resource_manager.rs): `crates/vqueues/src/scheduler/resource_manager.rs`

### Persistence

- [Partition Store](https://github.com/restatedev/restate/blob/main/crates/partition-store/src/partition_store_manager.rs): `crates/partition-store/src/partition_store_manager.rs`
- [Partition Database](https://github.com/restatedev/restate/blob/main/crates/partition-store/src/partition_db.rs): `crates/partition-store/src/partition_db.rs`
- [RocksDB Manager](https://github.com/restatedev/restate/blob/main/crates/rocksdb/src/db_manager.rs): `crates/rocksdb/src/db_manager.rs`
- [Durable Log](https://github.com/restatedev/restate/blob/main/crates/bifrost/src/bifrost.rs): `crates/bifrost/src/bifrost.rs`
- [Log Server](https://github.com/restatedev/restate/blob/main/crates/log-server/src/service.rs): `crates/log-server/src/service.rs`

### Cluster Services

- [Node Connections](https://github.com/restatedev/restate/blob/main/crates/core/src/network/connection_manager.rs): `crates/core/src/network/connection_manager.rs`
- [Peer Handshake](https://github.com/restatedev/restate/blob/main/crates/core/src/network/handshake.rs): `crates/core/src/network/handshake.rs`
- [Metadata Management](https://github.com/restatedev/restate/blob/main/crates/core/src/metadata/manager.rs): `crates/core/src/metadata/manager.rs`

### Admin and Insight

- [Admin REST API](https://github.com/restatedev/restate/blob/main/crates/admin/src/rest_api/mod.rs): `crates/admin/src/rest_api/mod.rs`
- [Restate CLI](https://github.com/restatedev/restate/blob/main/cli/src/app.rs): `cli/src/app.rs`
- [Distributed Query](https://github.com/restatedev/restate/blob/main/crates/storage-query-datafusion/src/remote_query_scanner_manager.rs): `crates/storage-query-datafusion/src/remote_query_scanner_manager.rs`
- [Remote Scan Client](https://github.com/restatedev/restate/blob/main/crates/storage-query-datafusion/src/remote_query_scanner_client.rs): `crates/storage-query-datafusion/src/remote_query_scanner_client.rs`
- [Admin Web UI](https://github.com/restatedev/restate/blob/main/crates/admin/src/web_ui.rs): `crates/admin/src/web_ui.rs`

### Other components

- **Service Caller**

## Connections

- Service Caller → HTTP Ingress: sends requests (evidence: `README.md`)
- HTTP Ingress → Request Handlers: routes requests (evidence: `crates/ingress-http/src/server.rs`)
- Service Caller → Kafka Consumer: publishes events (evidence: `README.md`)
- Request Handlers → Invocation State: starts invocations (evidence: `README.md`)
- Kafka Consumer → Invocation State: starts invocations (evidence: `README.md`)
- Invocation State → Partition Workers: durable execution (evidence: `README.md`)
- Partition Workers → Partition Store: persists progress (evidence: `README.md`)
- Partition Workers → Queue Scheduler: schedules work (evidence: `README.md`)
- Partition Store → Partition Database: opens databases (evidence: `crates/partition-store/src/partition_store_manager.rs`)
- Partition Database → RocksDB Manager: uses storage
- Partition Workers → Durable Log: records log (evidence: `README.md`)
- Durable Log → Log Server: replicated log storage
- Node Connections → Peer Handshake: performs handshake (evidence: `crates/core/src/network/connection_manager.rs`)
- Node Connections → Metadata Management: exchanges cluster metadata (evidence: `README.md`)
- Restate CLI → Admin REST API: operates services (evidence: `README.md`)
- Admin REST API → Admin Web UI: serves introspection (evidence: `README.md`)
- Admin REST API → Distributed Query: exposes SQL queries (evidence: `README.md`)
- Distributed Query → Remote Scan Client: opens remote scans (evidence: `crates/storage-query-datafusion/src/remote_query_scanner_manager.rs`)
