chartletv0.21.0chartlet.casoon.de

← All examples

Orders API

Four components of an orders API and three views of them: the components alone, a developer laptop, and production, shown here with --view production. A view with an environment nests hosts like boundaries — a region with two nodes and a managed database — and draws instances of components, labelled with their id, such as Orders API (api-1). Only the instanceConnections it lists are drawn, each with the label and technology of the model connection it names. The description names the environment, the table every instance. Illustrative values.

Orders API

examples/api-environments.json
{
  "schemaVersion": 1,
  "type": "architecture",
  "title": "Orders API",
  "source": "Operations handbook, orders model",
  "width": 1000,
  "height": 520,
  "architecture": {
    "components": [
      {
        "id": "client",
        "label": "Shop front end",
        "kind": "frontend"
      },
      {
        "id": "lb",
        "label": "Load balancer",
        "symbol": "load-balancer"
      },
      {
        "id": "api",
        "label": "Orders API",
        "sublabel": "Node.js"
      },
      {
        "id": "db",
        "label": "Orders",
        "sublabel": "Postgres",
        "kind": "database"
      }
    ],
    "connections": [
      {
        "id": "call",
        "from": "client",
        "to": "lb",
        "label": "places orders",
        "technology": "HTTPS"
      },
      {
        "id": "route",
        "from": "lb",
        "to": "api",
        "label": "routes",
        "technology": "HTTP"
      },
      {
        "id": "query",
        "from": "api",
        "to": "db",
        "label": "reads, writes",
        "technology": "SQL"
      }
    ],
    "views": [
      {
        "key": "logical",
        "title": "Orders API: components",
        "components": [
          "client",
          "lb",
          "api",
          "db"
        ]
      },
      {
        "key": "local",
        "title": "Orders API on a developer machine",
        "environment": "Local",
        "hosts": [
          {
            "id": "laptop",
            "label": "Developer laptop"
          }
        ],
        "instances": [
          {
            "id": "api-dev",
            "of": "api",
            "in": "laptop"
          },
          {
            "id": "db-dev",
            "of": "db",
            "in": "laptop"
          }
        ],
        "instanceConnections": [
          {
            "id": "query",
            "from": "api-dev",
            "to": "db-dev"
          }
        ]
      },
      {
        "key": "production",
        "title": "Orders API in production",
        "environment": "Production",
        "hosts": [
          {
            "id": "region",
            "label": "Region eu-central-1"
          },
          {
            "id": "node-a",
            "label": "Node A",
            "in": "region"
          },
          {
            "id": "node-b",
            "label": "Node B",
            "in": "region"
          },
          {
            "id": "data",
            "label": "Managed database",
            "in": "region"
          }
        ],
        "instances": [
          {
            "id": "lb-prod",
            "of": "lb",
            "in": "region"
          },
          {
            "id": "api-1",
            "of": "api",
            "in": "node-a"
          },
          {
            "id": "api-2",
            "of": "api",
            "in": "node-b"
          },
          {
            "id": "db-prod",
            "of": "db",
            "in": "data"
          }
        ],
        "instanceConnections": [
          {
            "id": "route",
            "from": "lb-prod",
            "to": "api-1"
          },
          {
            "id": "route",
            "from": "lb-prod",
            "to": "api-2"
          },
          {
            "id": "query",
            "from": "api-1",
            "to": "db-prod"
          },
          {
            "id": "query",
            "from": "api-2",
            "to": "db-prod"
          }
        ]
      }
    ]
  }
}
Focus
Orders API in production
Orders API in productionArchitecture diagram with 4 components and 4 connections in 4 boundaries. It shows the environment Production: 4 instances of 3 components of the model; only the connections listed for the instances are drawn. Region eu-central-1: Load balancer (lb-prod), Node A, Node B, Managed database. Node A (in Region eu-central-1): Orders API (api-1). Node B (in Region eu-central-1): Orders API (api-2). Managed database (in Region eu-central-1): Orders (db-prod). Nothing leads into Load balancer (lb-prod). Nothing leads out of Orders (db-prod). Load balancer (lb-prod) (service, load balancer): connects to Orders API (api-1) (routes, via HTTP) and Orders API (api-2) (routes, via HTTP). Orders API (api-1) (service): connects to Orders (db-prod) (reads, writes, via SQL). Orders API (api-2) (service): connects to Orders (db-prod) (reads, writes, via SQL). Orders (db-prod) (database): no outgoing connection.Region eu-central-1Managed databaseNode BNode ALoad balancer (lb-prod) → Orders API (api-1): routes [HTTP]Load balancer (lb-prod) → Orders API (api-2): routes [HTTP]Orders API (api-1) → Orders (db-prod): reads, writes [SQL]Orders API (api-2) → Orders (db-prod): reads, writes [SQL]routes[HTTP]routes[HTTP]reads, writes[SQL]reads, writes[SQL]Load balancer (lb-prod)Load balancer (lb-prod)Orders API (api-1) – Node.jsOrders API (api-1)Node.jsOrders API (api-2) – Node.jsOrders API (api-2)Node.jsOrders (db-prod) – PostgresOrders (db-prod)Postgres

Source: Operations handbook, orders model

Show chart data
Data for Orders API in production
InstanceKindBoundaryConnects to
Load balancer (lb-prod)service, load balancerRegion eu-central-1Orders API (api-1) (routes, via HTTP), Orders API (api-2) (routes, via HTTP)
Orders API (api-1)serviceRegion eu-central-1 › Node AOrders (db-prod) (reads, writes, via SQL)
Orders API (api-2)serviceRegion eu-central-1 › Node BOrders (db-prod) (reads, writes, via SQL)
Orders (db-prod)databaseRegion eu-central-1 › Managed database
  • Deployment view
  • Show where a model runs in each environment