Last updated: 31-01-2024 13:55:55+0000

1. Introduction and Goals

1.1. Requirements Overview

1.2. Quality Goals

1.3. Stakeholders

2. Architecture Constraints

3. System Scope and Context

Inventory service - System ContextTeam A Maintains and operates theWarehouseTeam B Maintains and operates theOrder serviceGraphQL Federation Provides a federated Graphto clientsInventory service Reads inventory data andprovides it to clients viasubgraph-inventory. Ordersnew goods if they run out ofstockOrder service Orders new goodsWarehouse Provides inventory data viaKafkasubgraph-inventoryTriggers order ifgoods run out ofstock[REST]Reads inventorydata from[Kafka]maintains andoperatesmaintains andoperatesLegend  system  external_person  external_system  async relationship(dashed) Context diagram for the web shop inventory system

3.1. Business Context

3.2. Technical Context

4. Solution Strategy

5. Building Block View

5.1. Whitebox Overall System

Inventory service - ContainersInventory service[System]GraphQL Federation[System]Warehouse[System]Inventory Database[PostgreSQL] Stores inventory itemsInventory Provider[SpringBoot, Spring Data JDBC,Kafka Streams] Reads inventory data andprovides it to clients viasubgraph-inventory. Ordersnew goods if they run out ofstocksubgraph-inventory[GraphQL] Provides inventory datawarehouse.stock_v1[Kafka] Contains data regarding theamount of goods in stockwarehouse.goods[Kafka] Contains metadata regardinggoodsOrder service Orders new goodsReads and writesinventory datato/fromTriggers order ifgoods run out ofstock[REST]contributes tofederated graphReads[Kafka]Reads[Kafka]Legend  container  external_system  external_container  system boundary(dashed)  async relationship(dashed) Container diagram for the inventory domain

5.2. Level 2

Inventory service - Inventory Provider - ComponentsInventory Provider[Container]GoodsConsumer Consumes goods KafkatopicInventoryQuery[GraphQL] Query providing inventorydata to clientsInventoryReadService Service reading inventorydataInventoryRepository JDBC repositoryreading/writing inventorydataInventoryWriteService Writes Inventory data todatabase and triggers ordersif goods run out of stockOrderClient Sends orders via POST toOrder serviceStockConsumer Consumes stock Kafka topicInventory Database[PostgreSQL] Stores inventory itemsOrder service Orders new goodssubgraph-inventory[GraphQL] Provides inventory datawarehouse.goods[Kafka] Contains metadata regardinggoodswarehouse.stock_v1[Kafka] Contains data regarding theamount of goods in stockWrites receivedgoods viaConsumes[Kafka]Reads inventorydata usingIs part ofReads inventorydata usingReads/writesInventory data[JDBC]Writes Inventorydata toUses to order newgoodsSends orders viaPOST requests to[REST]Writes receivedstock dataConsumes[Kafka]Legend  container  component  external_system  external_container  container boundary(dashed) Component diagram for the Inventory Provider service

6. Runtime View

6.1. <Runtime Scenario 1>

6.2. <Runtime Scenario 2>

6.3. …​

6.4. <Runtime Scenario n>

7. Deployment View

Inventory service - Deployment - DefaultAWSaccountId123456regioneu-central-1Elastic Kubernetes Service (EKS)Inventory PODautoscaling.max_replicas10autoscaling.min_replicas5imagePullPolicyIfNotPresentport8080resources.limits_cpu3000mresources.limits_memory1500Miresources.requests_cpu2000mresources.requests_memory1500MiDocker ContainerRelational Database Service (RDS)Apollo StudioIngress[NGINX] Used for load balancing andSSLterminationInventory Provider[SpringBoot, Spring Data JDBC,Kafka Streams] Reads inventory data andprovides it to clients viasubgraph-inventory. Ordersnew goods if they run out ofstockInventory Database[PostgreSQL] Stores inventory itemsGraphQL Federation Provides a federated Graphto clientsForwardssubgraph-inventoryqueries toForwards requeststoReads and writesinventory datato/fromLegend  container  external_system  node Deployment diagram for the Inventory service

8. Alerts

Name Severity Summary Description Expression Time range

InstanceDown

critical

Instance $labels.instance down

$labels.instance of job $labels.job has been down for more than 5 minutes.

up == 0

5m

APIHighRequestLatency

critical

High request latency on $labels.instance

$labels.instance has a median request latency above 1s (current value: $values)

api_http_request_latencies_second{quantile="0.5"} > 1

10m

9. Cross-cutting Concepts

10. Architecture Decisions

11. Quality Requirements

11.1. Quality Tree

11.2. Quality Scenarios

12. Risks and Technical Debts

13. Glossary

Term Definition

<Term-1>

<definition-1>

<Term-2>

<definition-2>