Architecture
EDGE is a set of Cloudflare Workers. Each Worker is a service, and each service keeps its state in Durable Objects, one per space, identity or other key.
Entry points. EDGE has two. Each device’s WebSocket ends at the Router. HTTP requests go to the edge Worker,
which authenticates the caller and forwards each request to the service that owns its path.
Services. Every service except the Router answers at a path:
| Service | Path | Does |
|---|---|---|
| Router | (WebSocket) | Holds each device’s WebSocket, routes messages between an identity’s devices, and runs signaling |
| DB | /db |
Replicates spaces, indexes them, keeps each space’s state, and answers identity recovery |
| Identity | /identity |
Keeps the agent device of each identity that grants EDGE a key |
| Compute | /compute |
Runs operations, triggers, the scheduler and agent processes, and creates SAGE agents’ identities |
| KMS | /kms |
Keeps secrets for a space, such as OAuth tokens for the services it connects to |
| Hub | /hub |
Keeps accounts, invitations and email verification |
| AI | /ai |
Gives agents and Composer’s assistant access to models |
| Blob | /blob |
Uploads and downloads files |
| Registry | /registry |
Keeps the plugin registry and the bundles it hosts |
Durable Objects. A Durable Object is a small server with its own storage, created on first use and named by a key. EDGE keys them like this:
In the diagram, each box in the top row is a kind of key, and each box in the group below is a Durable Object. An arrow joins a key to the objects EDGE keeps for it. The table lists the same objects with what each keeps.
| Key | Object | Keeps |
|---|---|---|
| Identity | RouterObject |
The identity’s devices and their WebSockets |
| Swarm topic | SwarmObject |
Which devices are on the topic |
| Space | SubductionAutomergeReplicator |
The space’s Automerge documents |
| Space | FeedReplicator, FeedSpace |
The space’s feeds |
| Space | SpaceStateMachine |
Members, credentials and other space state |
| Space | Indexer |
The space’s index for queries |
| Agent | Agent process | The agent’s process and memory, in compute |
A swarm topic is the key MESH gives the group of devices that share one space. See MESH’s Signaling and discovery.
Environments
Section titled “Environments”| Environment | URL | For |
|---|---|---|
| Production | https://dxos.network/ |
Apps, Composer |
| Preview | https://preview.dxos.network/ |
Testing the next release |
| Dev | https://dev.dxos.network/ |
DXOS’s own development |
Your app chooses one with runtime.services.edge.url. Every service answers under that one URL, at its path. See
Configuration.
Behavior
Section titled “Behavior”- A space’s Durable Objects run in one place at a time. All writes to a space’s copy go through one server, so they need no coordination between servers.
- EDGE authenticates every request with the caller’s HALO identity. See Connecting.
Limits
Section titled “Limits”- DXOS operates every environment. There is no self-hosted EDGE, and its source is not public.
- EDGE serves only identities linked to a DXOS account. For now, you create an account through Composer.