> ## Documentation Index
> Fetch the complete documentation index at: https://docs.goakt.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Architecture Overview

> System design and component diagram.

## Bird's eye view

GoAkt is a framework for building **concurrent, distributed, and fault-tolerant systems** in Go using the actor model.
Every unit of computation is an **actor**—a lightweight, isolated entity that communicates exclusively through messages.
The [Actor System](/actor/actor-system) is the top-level runtime that hosts actors and orchestrates messaging, clustering, and lifecycle.

## Three deployment modes

| Mode                 | Description                                                                                                 |
| -------------------- | ----------------------------------------------------------------------------------------------------------- |
| **Standalone**       | Single process. Actors communicate in-process.                                                              |
| **Clustered**        | Multiple nodes. Discovery via Consul, etcd, Kubernetes, NATS, mDNS, or static. Location-transparent actors. |
| **Multi-Datacenter** | Multiple clusters across DCs. Pluggable control plane (NATS JetStream or etcd). DC-aware placement.         |

## Core building blocks

| Concept               | Role                                                                                                                                                                                                                                                               |
| --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Reactive stream**   | Composable `stream.Source` → `Flow` stages → `Sink` pipelines, materialized with `RunnableGraph.Run` on an `ActorSystem`. Stages run as actors with demand-driven backpressure. See [Streams](/advanced/streams).                                                  |
| **CRDT / Replicator** | Conflict-free replicated data types (`crdt` package), merged by a per-node **Replicator** system actor. Replication is **eventually consistent**—separate from the Olric actor/grain registry (quorum-strong). See [Distributed data](/advanced/distributed-data). |

## Message flow

<img src="https://mintcdn.com/goakt/YynjyfoMJM3om6ZE/assets/architecture-message-flow.png?fit=max&auto=format&n=YynjyfoMJM3om6ZE&q=85&s=d11b5987d4b459f99806c10ec97bd60c" alt="Message flow - Sender sends Tell (fire-and-forget) or Ask (request-response) to Receiver via local or TCP transport, messages enqueue to mailbox then dequeue to Receive" width="1376" height="768" data-path="assets/architecture-message-flow.png" />

For remote messages, the remoting layer serializes the payload over a custom TCP frame protocol with optional
compression.

## Actor hierarchy

<img src="https://mintcdn.com/goakt/YynjyfoMJM3om6ZE/assets/architecture-actor-hierarchy.png?fit=max&auto=format&n=YynjyfoMJM3om6ZE&q=85&s=825101f41429f82e74b76e4d59667223" alt="Actor hierarchy - root guardian at top, /system branch for internal actors, /user branch for user-defined actors with nested children" width="1376" height="768" data-path="assets/architecture-actor-hierarchy.png" />

When a parent stops, all children stop first (depth-first). A parent supervises its children.

## Cluster architecture

<img src="https://mintcdn.com/goakt/YynjyfoMJM3om6ZE/assets/architecture-cluster-node.png?fit=max&auto=format&n=YynjyfoMJM3om6ZE&q=85&s=a8310aa1d22f1fa9db078b9c19bb9989" alt="Cluster architecture - GoAkt Cluster Node with ActorSystem connecting to Cluster (Olric DMap), Discovery, Remoting (TCP/TLS), and TCP Server" width="1376" height="768" data-path="assets/architecture-cluster-node.png" />

**Placement and membership** state (which actors and grains live where) is stored in Olric (distributed hash map) with configurable quorum. Node membership uses Hashicorp Memberlist. **CRDT application state** (when enabled via `ClusterConfig.WithCRDT`) is replicated separately by the **Replicator** actor using delta broadcast over the topic bus—not through Olric DMap writes.

## Deep dives

The following pages describe the internal architecture of each major subsystem:

| Subsystem     | Page                                             | What it covers                                                                                                  |
| ------------- | ------------------------------------------------ | --------------------------------------------------------------------------------------------------------------- |
| **Scheduler** | [Dispatcher Pool](/architecture/dispatcher-pool) | Fixed worker pool, actor state machine, ready queue, work stealing, system-message priority, throughput tuning. |

## See also

* [Code Map](/architecture/code-map) — package layout and file-level responsibilities
* [Design Decisions](/architecture/design-decisions) — rationale behind architectural choices
