# Architecture

> How Sypnia Domains is built: its parts, where Rust runs, and how they connect.

Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service).  
Source: https://domains.docs.sypnia.com/architecture/

For agents: Domains architecture: one Rust binary (axum, AWS SDK for Rust) with API, search/pricing, operations runner (registrations, renewals, transfers), DNS manager, connections manager, renewal scheduler, MCP; Postgres for domains, quotes, operations, desired zone state, connections; Route 53 Domains for registrations, Route 53 hosted zones for DNS; registrar and DNS adapters behind traits; Cloud credit ledger in the Sypnia account; console private.

**Figure**: Sypnia Domains: the API, the engine's modules, the credit ledger, and Route 53 for registrations and DNS.

1. Your app, the CLI or an agent calls the Domains API.
2. Purchases reserve credits and start an operation with the registrar.
3. The DNS manager writes zones and records in Route 53.
4. Connections ask Run, Mail, Data and Files what they need, write it, and watch it.

The engine is one Rust binary with the API, search and pricing, the operations runner (registrations, renewals, transfers), the DNS manager, the connections manager, the renewal scheduler and the MCP server. It keeps domains, quotes, operations, the desired state of every zone and the connections in Postgres. Registrations go to Amazon Route 53 Domains and zones to Route 53 hosted zones. In Sypnia Cloud, credits are reserved and charged through the Sypnia account's credit ledger.

| Part                                                                     | Language                          | Open source |
| ------------------------------------------------------------------------ | --------------------------------- | ----------- |
| Domains engine: API, search, operations, DNS, connections, renewals, MCP | Rust (axum, the AWS SDK for Rust) | yes         |
| Registrar and DNS adapters                                               | Rust, one trait each; Route 53    | yes         |
| `@sypnia/domains`                                                        | TypeScript                        | yes         |
| Credit ledger and billing in Sypnia Cloud                                | part of the Sypnia account        | no          |
| Console                                                                  | TypeScript (React)                | no          |

- [Request paths](/architecture/request-paths/): A purchase, a record change and a connection, step by step.
- [Data model](/architecture/data-model/): The sypnia_domains schema: domains, contacts, quotes, operations, zones, records, connections and renewals.
- [Reference implementation on AWS](/architecture/reference-implementation-aws/): Every AWS service Domains uses in Sypnia Cloud, and how.
- [Failures and scaling](/architecture/failures-and-scaling/): What happens when the registrar, Route 53 or a renewal fails, and how Domains grows.
- [Codebase](/architecture/codebase/): How the open-source repository is organized.
