Skip to content

Appendix C: Stdlib Types

The stdlib ships twelve packages of types, grouped by concern:

  • Backend & dataarch.backend (services, databases, caches, message brokers, infra, observability, and the wire-level interface types) and arch.data (the analytics tier arch.backend leaves out: pipelines, warehouses, BI tools)
  • Diagrams & visualsarch.c4 (the C4 model), arch.diagrams (ER/table diagrams), arch.extras (generic actors and devices), and arch.ui (the shared icon/badge toolkit the others render with — not used directly)
  • Cloudarch.cloud.aws, arch.cloud.gcp, arch.cloud.azure (provider service catalogs, layered on arch.backend)
  • Governancearch.policy (enforceable architecture-review policies) and arch.org (the teams/departments/guilds ownership plane)
  • AIarch.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.backend
use user, usergroup from arch.extras
use table, column from arch.diagrams # optional — adds the diagram types

All packages auto-resolve against the toolchain’s bundled stdlib — no dependencies entry needed.

TypeRequired blanksDefaultsDefault widget
frontendrequired aspect domainaspect teamarch-module
componentaspect teamarch-module
systemaspect teamarch-module
external_systemrequired ext.vendor, required ext.contract.urlarch-module (dashed, vendor chip)
TypeRequired blanksDefaultsDefault widget
userarch-user
usergrouparch-usergroup
laptop / tablet / smartphone / desktop / server / cloudper-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.

All backend module types cascade team and aspect domain softly (none required).

TypeDefaultsNotes
serviceaspect team, aspect domainGeneric backend service.
databaseaspect team, aspect data.classificationSubtypes per family (relational, document, kv_store, hyperscale, search_index, columnar, cold_storage, graph_db, timeseries, vector, object_storage) and per engine (postgres, mongodb, redis, …).
cacheinherits from databaseSquat-cylinder subtype of database.
message_brokeraspect team, aspect domainSubtypes per family (kafka_cluster, redpanda, pulsar, rabbitmq, activemq, nats_server, mqtt_broker, redis_streams, nsq, …).
gatewayaspect team, aspect domainEdge proxy / API gateway / reverse proxy.
load_balanceraspect team, aspect domainL4/L7 traffic distribution across replicas. Sibling of gateway.
service_meshaspect team, aspect domainSubtypes istio, linkerd, consul_connect, kuma, cilium.
service_discoveryaspect team, aspect domainService registry / config plane. Subtypes consul, zookeeper, eureka, nacos.
feature_flagsaspect team, aspect domainSubtypes unleash, flagsmith, flipt, growthbook.
bpm_systemaspect team, aspect domainWorkflow orchestration. Subtypes per engine (camunda, temporal, airflow, n8n, …).
identity_provideraspect team, aspect domainOIDC / SSO issuers. Subtypes keycloak, zitadel, authentik, authelia, ory, dex, supertokens, casdoor, fusionauth.
secrets_manageraspect team, aspect domainCredential / key storage. Subtypes vault, openbao, infisical.
observabilityaspect team, aspect domainTelemetry 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.

The stdlib defines:

  • surface — the generic base type, no defaults, no required blanks.
  • rest_crud (in arch.backend) — bundles rest_list / rest_create / rest_read / rest_update / rest_delete as list / create / read / update / delete.

Custom surface types (resource, capability, endpoint_group) are conventionally declared per-project. See Chapter 6 and Chapter 16.

Wire-level interface types. Edge-styling convention: sync request/response types render solid; async / streaming / pub-sub types render dashed.

TypeParentStyleSemantic
httpinterfacesolidBase HTTP.
http_get / http_post / http_put / http_patch / http_delete / http_head / http_optionshttpsolidOne per HTTP method.
webhookhttpdashedOutbound fire-and-forget callback.
ssehttpdashedServer-sent events.
resthttpsolidHTTP with resource semantics.
rest_list / rest_create / rest_read / rest_update / rest_deleterestsolidThe five REST verbs.
TypeParentStyleSemantic
grpcinterfacesolidBase gRPC.
grpc_unarygrpcsolidOne request, one response.
grpc_server_stream / grpc_client_stream / grpc_bidi_streamgrpcdashedStreaming variants.
TypeParentStyleSemantic
graphqlinterfacesolidBase GraphQL.
graphql_query / graphql_mutationgraphqlsolidSync operations.
graphql_subscriptiongraphqldashedAsync push stream.
TypeParentStyleSemantic
websocketinterfacedashedBidirectional, long-lived.
TypeParentStyleSemantic
kafkainterfacedashedDistributed log topics.
amqpinterfacedashedOpen AMQP wire protocol.
natsinterfacedashedLightweight pub/sub subjects.
mqttinterfacedashedIoT pub/sub topics.
redis_pubsubinterfacedashedRedis pub/sub channels.
TypeParentStyleSemantic
db_readinterfacesolidRead access on a database / cache.
db_writeinterfacesolidWrite 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).

Define your own types when domain vocabulary is preferred over the wire-level ones. See Chapter 16.

// In your project's types.arch
export 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.