Skip to main content
Version: 0.4.0

Model the technology

Say where each system runs: the stages it is deployed in, how many instances run in each, what it runs on there, what hosts its data, and who supplies it. The guide grows one small model, a shop, a step at a time, and every step is a whole model that builds with no error or lint: type it into model/ in a repository kq init made, and check it with kq validate or in VS Code as you type. Every statement used here is described in full in Technology.

Name the stages each part runs in​

environments names the stages the ecosystem uses, once, shared by every platform and monolith in it. A stage is one of six, in capitals: DEV, TST, ACC, UAT, EPH and PRD. environment <stage> x<count> in a component, a deployable module, a monolith or a broker says it runs in that stage, with that many instances. The shop runs its storefront in development and production, and its ERP in production only:

ecosystem shop "Shop" { environments DEV, PRD platform storefront "Storefront" { component web-shop "Web Shop" : user-facing-app { environment PRD x2 environment DEV x1 } component order-service "Order Service" : backend { environment PRD x3 environment DEV x1 } } monolith erp "ERP" : cots { environment PRD x1 module accounting "Accounting" : grouping { component ledger "Ledger" : backend } } }

A part runs where what holds it runs: the ledger states no stage, so it runs where the ERP runs, and a grouping module takes none. No environment says nothing: a part that states none states nothing about where it runs, and a model that never mentions environments is complete. See Writing environments and database servers.

Say what each part runs on​

The infrastructure is declared in the ecosystem, each element per stage: its declaration states its one stage, with its count where it has one. A network is a private network, and a host is a machine you run, a vm, a physical server or a device, placed in a network with in. on <host or app-platform> after the count says what a part runs on in that stage. Add the production network and its web servers, and run the storefront on them:

ecosystem shop "Shop" { environments DEV, PRD network spoke-prd "Production network" : vnet environment PRD host web "Web servers" : vm in spoke-prd environment PRD x3 platform storefront "Storefront" { component web-shop "Web Shop" : user-facing-app { environment PRD x2 on web environment DEV x1 } component order-service "Order Service" : backend { environment PRD x3 on web environment DEV x1 } } monolith erp "ERP" : cots { environment PRD x1 module accounting "Accounting" : grouping { component ledger "Ledger" : backend } } }

Without on, an environment line says nothing about what the part runs on: the ERP and the development stage stay as they were. See Writing infrastructure.

Host the data​

A database server is declared in the ecosystem with its one stage and its count, as a host is. Its kind after : is its engine, and on <host> after the kind says you run it yourself on that host, where paas says the provider runs it. A storage names its servers after its name, with on, and its component runs in each of those servers' stages, or it is KQ089. Give the order service's database a server of its own:

ecosystem shop "Shop" { environments DEV, PRD network spoke-prd "Production network" : vnet environment PRD host web "Web servers" : vm in spoke-prd environment PRD x3 host db-vm "Database VM" : vm in spoke-prd environment PRD x1 db-server orders-sql "Orders SQL" : sql-server on db-vm environment PRD x1 technology "SQL Server 2022" platform storefront "Storefront" { component web-shop "Web Shop" : user-facing-app { environment PRD x2 on web environment DEV x1 } component order-service "Order Service" : backend { environment PRD x3 on web environment DEV x1 sql orders-db "Orders DB" on orders-sql } } monolith erp "ERP" : cots { environment PRD x1 module accounting "Accounting" : grouping { component ledger "Ledger" : backend } } }

The order service runs in production, where the server is, so its orders database can be hosted there. See Writing environments and database servers.

Say who supplies it​

A supplier is a company or person you obtain ICT services from, named by its legal name and written in the ecosystem that contracts with it. Its contracts are in its block, and covers names what each provides. critical after a function's name marks it critical: its disruption would materially impair your organization. Add the vendor of the ERP and the work the ERP and the storefront do:

ecosystem shop "Shop" { environments DEV, PRD domain selling "Selling" domain finance "Finance" { function book "Keep the books" critical } network spoke-prd "Production network" : vnet environment PRD host web "Web servers" : vm in spoke-prd environment PRD x3 host db-vm "Database VM" : vm in spoke-prd environment PRD x1 db-server orders-sql "Orders SQL" : sql-server on db-vm environment PRD x1 technology "SQL Server 2022" platform storefront "Storefront" { component web-shop "Web Shop" : user-facing-app { environment PRD x2 on web environment DEV x1 } component order-service "Order Service" : backend { environment PRD x3 on web environment DEV x1 sql orders-db "Orders DB" on orders-sql } web-shop realizes selling order-service realizes selling } monolith erp "ERP" : cots { environment PRD x1 module accounting "Accounting" : grouping { component ledger "Ledger" : backend } accounting/ledger realizes finance/book } supplier acme "Acme Software GmbH" headquarters DE { contract erp-support "ERP license and support" starts 2025-01-01 ends 2028-12-31 notice P90D law DE covers erp } }

A contract supports a function: something it covers realizes one, or it names one with via, or it is KQ131. Here the ERP's ledger keeps the books, a critical function. Once an ecosystem has domains, every component realizes a domain, a function group or a function, or it is KQ104, so the storefront realizes Selling. See Suppliers and contracts.

See what you modeled​

A deployment view draws one stage of an ecosystem: what runs there, how many of each, on what it runs, and who calls whom there. The shop's production, drawn from the last step:

The diagram in words

Shop · Deployment view · PRD

Boxes

  • Shop (Ecosystem)
    • Production network (Network: vnet)
      • Web servers (Host: vm): ×3
        • Web Shop (User-facing app): ×2
        • Order Service (Backend): ×3
      • Database VM (Host: vm): ×1
        • Orders SQL (Db Server: sql-server): ×1
    • ERP (Monolith: COTS): ×1
      • Ledger (Backend)

Lines

  • Orders SQL → Order Service: hosting, orders-db

In VS Code, the viewer draws it as you type. See Deployment view.

Where next​

© 2026 Extenza Works. All rights reserved.