Appendix C: Stdlib Types
The stdlib ships twelve packages of types, grouped by concern:
- Backend & data —
arch.backend(services, databases, caches, message brokers, infra, observability, and the wire-level interface types) andarch.data(the analytics tier arch.backend leaves out: pipelines, warehouses, BI tools) - Diagrams & visuals —
arch.c4(the C4 model),arch.diagrams(ER/table diagrams),arch.extras(generic actors and devices), andarch.ui(the shared icon/badge toolkit the others render with — notused directly) - Cloud —
arch.cloud.aws,arch.cloud.gcp,arch.cloud.azure(provider service catalogs, layered onarch.backend) - Governance —
arch.policy(enforceable architecture-review policies) andarch.org(the teams/departments/guilds ownership plane) - AI —
arch.ai(model serving, the ML platform, and LLM application types)
This chapter documents the general-purpose two — arch.backend and arch.extras — in depth. Treat the stdlib as a pick-and-choose palette — import the specific types you need rather than use * (never use * the standard library; it drags in the whole surface). Pull them in at the space level (in your package.archspace) so the palette is space-wide:
use service, database, gateway from arch.backenduse user, usergroup from arch.extrasuse table, column from arch.diagrams # optional — adds the diagram typesAll packages auto-resolve against the toolchain’s bundled stdlib — no dependencies entry needed.
General module types (arch.backend)
Section titled “General module types (arch.backend)”| Type | Required blanks | Defaults | Default widget |
|---|---|---|---|
frontend | required aspect domain | aspect team | arch-module |
component | — | aspect team | arch-module |
system | — | aspect team | arch-module |
external_system | required ext.vendor, required ext.contract.url | — | arch-module (dashed, vendor chip) |
People & device figures (arch.extras)
Section titled “People & device figures (arch.extras)”| Type | Required blanks | Defaults | Default widget |
|---|---|---|---|
user | — | — | arch-user |
usergroup | — | — | arch-usergroup |
laptop / tablet / smartphone / desktop / server / cloud | — | — | per-figure |
team is never a required blank anywhere in the stdlib — every type cascades it softly, so a model validates without owners and you fill them in as you learn them.
Module types (arch.backend)
Section titled “Module types (arch.backend)”All backend module types cascade team and aspect domain softly (none required).
| Type | Defaults | Notes |
|---|---|---|
service | aspect team, aspect domain | Generic backend service. |
database | aspect team, aspect data.classification | Subtypes per family (relational, document, kv_store, hyperscale, search_index, columnar, cold_storage, graph_db, timeseries, vector, object_storage) and per engine (postgres, mongodb, redis, …). |
cache | inherits from database | Squat-cylinder subtype of database. |
message_broker | aspect team, aspect domain | Subtypes per family (kafka_cluster, redpanda, pulsar, rabbitmq, activemq, nats_server, mqtt_broker, redis_streams, nsq, …). |
gateway | aspect team, aspect domain | Edge proxy / API gateway / reverse proxy. |
load_balancer | aspect team, aspect domain | L4/L7 traffic distribution across replicas. Sibling of gateway. |
service_mesh | aspect team, aspect domain | Subtypes istio, linkerd, consul_connect, kuma, cilium. |
service_discovery | aspect team, aspect domain | Service registry / config plane. Subtypes consul, zookeeper, eureka, nacos. |
feature_flags | aspect team, aspect domain | Subtypes unleash, flagsmith, flipt, growthbook. |
bpm_system | aspect team, aspect domain | Workflow orchestration. Subtypes per engine (camunda, temporal, airflow, n8n, …). |
identity_provider | aspect team, aspect domain | OIDC / SSO issuers. Subtypes keycloak, zitadel, authentik, authelia, ory, dex, supertokens, casdoor, fusionauth. |
secrets_manager | aspect team, aspect domain | Credential / key storage. Subtypes vault, openbao, infisical. |
observability | aspect team, aspect domain | Telemetry tooling. Subtypes by signal: metrics_system, logging_system, tracing_system, dashboard, collector, alerting, apm (each with per-vendor leaves). |
Reading the tables:
- Required blanks must be filled or dropped by every instance.
- Defaults are pre-set fields the instance inherits (with cascade semantics where shown).
- Default widget is the custom-element tag the instance renders with (cascaded via
cascade widget: ...).
Importing the types you need from arch.backend and arch.extras gives working visuals for free — no widgets: script of your own required.
Surface types
Section titled “Surface types”The stdlib defines:
surface— the generic base type, no defaults, no required blanks.rest_crud(inarch.backend) — bundlesrest_list/rest_create/rest_read/rest_update/rest_deleteaslist/create/read/update/delete.
Custom surface types (resource, capability, endpoint_group) are conventionally declared per-project. See Chapter 6 and Chapter 16.
Interface types (arch.backend)
Section titled “Interface types (arch.backend)”Wire-level interface types. Edge-styling convention: sync request/response types render solid; async / streaming / pub-sub types render dashed.
| Type | Parent | Style | Semantic |
|---|---|---|---|
http | interface | solid | Base HTTP. |
http_get / http_post / http_put / http_patch / http_delete / http_head / http_options | http | solid | One per HTTP method. |
webhook | http | dashed | Outbound fire-and-forget callback. |
sse | http | dashed | Server-sent events. |
rest | http | solid | HTTP with resource semantics. |
rest_list / rest_create / rest_read / rest_update / rest_delete | rest | solid | The five REST verbs. |
| Type | Parent | Style | Semantic |
|---|---|---|---|
grpc | interface | solid | Base gRPC. |
grpc_unary | grpc | solid | One request, one response. |
grpc_server_stream / grpc_client_stream / grpc_bidi_stream | grpc | dashed | Streaming variants. |
GraphQL
Section titled “GraphQL”| Type | Parent | Style | Semantic |
|---|---|---|---|
graphql | interface | solid | Base GraphQL. |
graphql_query / graphql_mutation | graphql | solid | Sync operations. |
graphql_subscription | graphql | dashed | Async push stream. |
WebSocket
Section titled “WebSocket”| Type | Parent | Style | Semantic |
|---|---|---|---|
websocket | interface | dashed | Bidirectional, long-lived. |
Messaging
Section titled “Messaging”| Type | Parent | Style | Semantic |
|---|---|---|---|
kafka | interface | dashed | Distributed log topics. |
amqp | interface | dashed | Open AMQP wire protocol. |
nats | interface | dashed | Lightweight pub/sub subjects. |
mqtt | interface | dashed | IoT pub/sub topics. |
redis_pubsub | interface | dashed | Redis pub/sub channels. |
Data access
Section titled “Data access”| Type | Parent | Style | Semantic |
|---|---|---|---|
db_read | interface | solid | Read access on a database / cache. |
db_write | interface | solid | Write access on a database / cache. |
Async/event-shaped interfaces (anything dashed) are how events are modeled — reached by an ordinary > process edge, not by a subscribes: field (there is no separate event or subscription construct).
Project-local types
Section titled “Project-local types”Define your own types when domain vocabulary is preferred over the wire-level ones. See Chapter 16.
// In your project's types.archexport type service internal_service { required aspect team aspect { security.zone: "Internal" }}Then use the type anywhere in the package:
internal_service AuthService { aspect team: "Platform" rest_create authenticate}To make a project-local type visible to other packages, mark it export and import it via use … from <your.package> in their package.archspace.
See also
Section titled “See also”- Chapter 4: Modules — module types in depth
- Chapter 5: Interfaces — interface types in depth
- Chapter 16: Defining Types — declaring your own
- Chapter 20: Widgets — how type widgets render