{"id":"6b09a4bcff996234422a271a","slug":"sa-integrations-and-contracts","title":"Integrations and contracts: APIs, events and cross-team dependencies without surprises","summary":"Integrations are where projects most often fall apart. How a solution architect chooses between synchronous and asynchronous communication, designs contracts in OpenAPI and AsyncAPI, versions them without breaking consumers, ensures idempotency and reliable event publishing (outbox), plans cross-team dependencies (RACI, schedule) and verifies contracts with tests (Pact) – on the example of a marketplace order system.","servedLang":"en","availableLangs":["pl","en"],"topics":["solution-architecture","event-driven-architecture","swagger-openapi","microservices","circuit-breaker"],"techs":["general","typescript","dotnet","java"],"tags":["solution-architect","integration","openapi","asyncapi","idempotency","outbox","contract-testing","api-versioning"],"level":"intermediate","kind":"article","access":"members","status":"published","cover":null,"author":{"id":"6b08bd2e80884893657cc8cf","name":"Redakcja Art of Devs","avatar":null,"handle":"redakcja","community":false},"readingMinutes":19,"stats":{"views":1,"likes":0,"bookmarks":0,"comments":0},"publishedAt":"2026-11-27T15:41:48.695Z","updatedAt":"2026-11-27T17:32:11.374Z","requestedLang":"en","theme":{"hero":"classic","heroMedia":null,"accent":"teal","background":"hex","weaveResources":true,"toc":"right"},"seoDescription":"System integration for architects: REST or Kafka, availability of call chains, contract-first with OpenAPI 3.1 and AsyncAPI 3.0, API and event versioning, Idempotency-Key, transactional outbox, idempotent consumer, RACI and a dependency plan, Pact contract tests.","wordCount":3742,"doc":{"type":"doc","content":[{"type":"paragraph","content":[{"type":"text","text":"Three weeks before go-live the ERP team says: \"your event has the amount as a floating-point number, and we book in pennies – and by the way, our consumer will be ready in May\". Anyone who has run an integration project knows this scene. Each team's code usually works – what breaks is what lies "},{"type":"text","text":"in between","marks":[{"type":"bold"}]},{"type":"text","text":": contracts, dates, assumptions about availability. That is why integrations and dependencies are one of a solution architect's main duties: agreeing API and event contracts with other teams and systems, and keeping track of "},{"type":"text","text":"who delivers what to whom and when","marks":[{"type":"bold"}]},{"type":"text","text":"."}]},{"type":"callout","attrs":{"variant":"tip","title":"In short"},"content":[{"type":"bulletList","content":[{"type":"listItem","content":[{"type":"paragraph","content":[{"type":"text","text":"Ask synchronously, inform asynchronously.","marks":[{"type":"bold"}]},{"type":"text","text":" Every synchronous call multiplies the risk of unavailability – a chain of ten services at 99.9% each only gets about 99.0%."}]}]},{"type":"listItem","content":[{"type":"paragraph","content":[{"type":"text","text":"Contract first","marks":[{"type":"bold"}]},{"type":"text","text":": OpenAPI for REST, AsyncAPI for events – in a repository, reviewed by consumers, before code is written."}]}]},{"type":"listItem","content":[{"type":"paragraph","content":[{"type":"text","text":"Retries are certain, so "},{"type":"text","text":"idempotency","marks":[{"type":"bold"}]},{"type":"text","text":" is mandatory; publish events through an "},{"type":"text","text":"outbox","marks":[{"type":"bold"}]},{"type":"text","text":", and run cross-team dependencies like a project plan: RACI, dates, milestones."}]}]}]}]},{"type":"stats","attrs":{"items":[{"value":"99.0%","label":"availability of a chain of 10 services at 99.9%","hint":"0.999¹⁰ – the product of availabilities"},{"value":"3.0","label":"the current major version of AsyncAPI","hint":"channels and operations described separately"},{"value":"RFC 9457","label":"Problem Details for HTTP APIs","hint":"a common error format"}]}},{"type":"heading","attrs":{"level":2,"id":"the-integration-map-the-first-artefact"},"content":[{"type":"text","text":"The integration map – the first artefact"}]},{"type":"paragraph","content":[{"type":"text","text":"Before you start discussing REST and Kafka, build an "},{"type":"text","text":"integration map","marks":[{"type":"bold"}]},{"type":"text","text":": every system you talk to, one row each. For OrderFlow – the new order system of the Bazario marketplace from the previous articles – it looks like this:"}]},{"type":"table","content":[{"type":"tableRow","content":[{"type":"tableHeader","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"System"}]}]},{"type":"tableHeader","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"Direction"}]}]},{"type":"tableHeader","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"Style"}]}]},{"type":"tableHeader","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"Contract"}]}]},{"type":"tableHeader","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"Owner"}]}]},{"type":"tableHeader","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"Due"}]}]}]},{"type":"tableRow","content":[{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"Channels (app, website, call-centre agent)"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"→ OrderFlow"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"REST, synchronous"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"OpenAPI "},{"type":"text","text":"orderflow-api","marks":[{"type":"code"}]}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"checkout team"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"15.12 (v1)"}]}]}]},{"type":"tableRow","content":[{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"Payment operator"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"OrderFlow →"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"REST, synchronous, 900 ms limit"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"operator's specification"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"external vendor"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"exists"}]}]}]},{"type":"tableRow","content":[{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"Antifraud"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"OrderFlow →"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"REST, synchronous"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"OpenAPI "},{"type":"text","text":"fraud","marks":[{"type":"code"}]}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"payments team"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"exists (limit 20/s)"}]}]}]},{"type":"tableRow","content":[{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"WMS (stock)"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"→ OrderFlow"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"event, Kafka"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"AsyncAPI "},{"type":"text","text":"stock-levels","marks":[{"type":"code"}]}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"warehouse team"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"15.01"}]}]}]},{"type":"tableRow","content":[{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"ERP"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"OrderFlow →"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"event, Kafka"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"AsyncAPI "},{"type":"text","text":"order-events","marks":[{"type":"code"}]}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"ERP team"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"consumer by the end of Q1"}]}]}]},{"type":"tableRow","content":[{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"WMS, seller panel, notifications, warehouse"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"OrderFlow →"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"event, Kafka"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"AsyncAPI "},{"type":"text","text":"order-events","marks":[{"type":"code"}]}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"consumer teams"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"before go-live"}]}]}]}]},{"type":"paragraph","content":[{"type":"text","text":"This table alone answers the questions that will hurt in three months: who owns the contract, where it lives and when it is needed."}]},{"type":"heading","attrs":{"level":2,"id":"synchronous-or-asynchronous"},"content":[{"type":"text","text":"Synchronous or asynchronous"}]},{"type":"paragraph","content":[{"type":"text","text":"The rule of thumb: "},{"type":"text","text":"ask synchronously, inform asynchronously","marks":[{"type":"bold"}]},{"type":"text","text":". OrderFlow needs the payment authorisation "},{"type":"text","text":"now","marks":[{"type":"italic"}]},{"type":"text","text":" – without it there is no order confirmation. But the ERP, the warehouse, the seller panel and notifications don't have to answer before the customer sees the confirmation – it is enough that they learn about the order."}]},{"type":"diagram","attrs":{"kind":"mermaid","code":"sequenceDiagram\n  participant O as OrderFlow\n  participant P as Payment operator\n  O->>P: POST /authorizations (900 ms limit)\n  alt answer in time\n    P-->>O: 201 authorised\n    O->>O: order confirmation\n  else timeout or 5xx error\n    O->>O: \"payment pending\" status, retry in the background, confirmation by e-mail\n  end","caption":"Synchronous: the caller waits for the answer – and for every failure along the way"}},{"type":"diagram","attrs":{"kind":"mermaid","code":"sequenceDiagram\n  participant O as OrderFlow\n  participant K as Kafka\n  participant E as ERP\n  participant W as WMS\n  participant S as Seller panel\n  participant N as Notifications\n  O-)K: OrderConfirmed (from the outbox)\n  K-)E: invoice (after the nightly close)\n  K-)W: picking request\n  K-)S: new order for the seller\n  K-)N: e-mail and push to the customer","caption":"Asynchronous: the sender publishes a fact, receivers react at their own pace"}},{"type":"table","content":[{"type":"tableRow","content":[{"type":"tableHeader","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"Property"}]}]},{"type":"tableHeader","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"Synchronous (REST, gRPC)"}]}]},{"type":"tableHeader","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"Asynchronous (events, queues)"}]}]}]},{"type":"tableRow","content":[{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"Temporal coupling"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"both sides must be up at the same time"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"the receiver may be temporarily down"}]}]}]},{"type":"tableRow","content":[{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"Response"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"immediate, with the result"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"none – or via a separate channel ("},{"type":"text","text":"async request-reply","marks":[{"type":"italic"}]},{"type":"text","text":")"}]}]}]},{"type":"tableRow","content":[{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"Consistency"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"immediate within the call"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"eventual – with a delay"}]}]}]},{"type":"tableRow","content":[{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"Failures"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"propagate up the chain"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"buffered in the broker"}]}]}]},{"type":"tableRow","content":[{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"New receiver"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"a change on the sender's side"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"subscribes to the topic, the sender is unchanged"}]}]}]},{"type":"tableRow","content":[{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"Diagnostics"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"simple: request and response"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"harder: distributed tracing, consumer lag"}]}]}]},{"type":"tableRow","content":[{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"Operational cost"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"low"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"broker, schemas, outbox, deduplication"}]}]}]}]},{"type":"paragraph","content":[{"type":"text","text":"Why be so careful with chains of synchronous calls? Because the availability of a chain is roughly the "},{"type":"text","text":"product","marks":[{"type":"bold"}]},{"type":"text","text":" of the availabilities of its links. Ten services at 99.9% give 99.0% – more than 7 hours of downtime a month instead of 43 minutes. With dependencies at 99.5% it gets even worse:"}]},{"type":"chart","attrs":{"type":"line","title":"Availability of a chain of synchronous calls","caption":"Calculation: the availability of one link raised to the power of the number of links (assuming independent failures). Fallback paths and asynchrony break this product.","unit":"% availability","data":{"labels":["1","2","3","4","5","6","7","8","9","10"],"series":[{"name":"Links at 99.9%","values":[99.9,99.8,99.7,99.6,99.5,99.4,99.3,99.2,99.1,99]},{"name":"Links at 99.5%","values":[99.5,99,98.51,98.02,97.52,97.04,96.55,96.07,95.59,95.11]}]}}},{"type":"paragraph","content":[{"type":"text","text":"Every synchronous call in a project therefore needs three things: a "},{"type":"text","text":"timeout","marks":[{"type":"bold"}]},{"type":"text","text":" (never wait forever), a "},{"type":"text","text":"decision about what we do when it fails","marks":[{"type":"bold"}]},{"type":"text","text":" (a fallback path, not an exception thrown at the customer) and often a "},{"type":"text","text":"circuit breaker","marks":[{"type":"bold"}]},{"type":"text","text":" that stops hammering a dependency that is down."}]},{"type":"heading","attrs":{"level":2,"id":"contract-first-openapi-and-asyncapi"},"content":[{"type":"text","text":"Contract first: OpenAPI and AsyncAPI"}]},{"type":"paragraph","content":[{"type":"text","text":"A contract is an agreement between teams – and like any agreement it should be made "},{"type":"text","text":"before","marks":[{"type":"bold"}]},{"type":"text","text":" the work, not after it. The contract-first approach looks like this:"}]},{"type":"orderedList","attrs":{"start":1},"content":[{"type":"listItem","content":[{"type":"paragraph","content":[{"type":"text","text":"The provider drafts the contract as a pull request in the contracts repository."}]}]},{"type":"listItem","content":[{"type":"paragraph","content":[{"type":"text","text":"Consumers review it: do they have all the fields, do they understand the meaning, do the formats fit (amounts, dates, time zones)."}]}]},{"type":"listItem","content":[{"type":"paragraph","content":[{"type":"text","text":"Once accepted, the contract produces a "},{"type":"text","text":"mock server","marks":[{"type":"bold"}]},{"type":"text","text":" – consumers can work before the provider is done."}]}]},{"type":"listItem","content":[{"type":"paragraph","content":[{"type":"text","text":"Linters (e.g. Spectral) enforce company style rules, and CI checks for breaking changes."}]}]},{"type":"listItem","content":[{"type":"paragraph","content":[{"type":"text","text":"The implementation is verified against the contract – with contract tests."}]}]}]},{"type":"paragraph","content":[{"type":"text","text":"For REST the standard is "},{"type":"text","text":"OpenAPI","marks":[{"type":"bold"}]},{"type":"text","text":" (version 3.1 is aligned with JSON Schema 2020-12); for events and queues it is "},{"type":"text","text":"AsyncAPI","marks":[{"type":"bold"}]},{"type":"text","text":" (version 3.0 describes channels and operations separately). Below are complete, valid OrderFlow contracts: the order placement API with an "},{"type":"text","text":"Idempotency-Key","marks":[{"type":"code"}]},{"type":"text","text":" header and errors in the Problem Details format (RFC 9457), and the "},{"type":"text","text":"OrderConfirmed","marks":[{"type":"code"}]},{"type":"text","text":" event in Kafka:"}]},{"type":"codeGroup","attrs":{"title":"OrderFlow contracts: OpenAPI 3.1 and AsyncAPI 3.0"},"content":[{"type":"codeBlock","attrs":{"language":"yaml","filename":"contracts/orderflow-api.openapi.yaml"},"content":[{"type":"text","text":"openapi: 3.1.0\ninfo:\n  title: OrderFlow Orders API\n  version: 1.2.0\n  description: Placing orders on the Bazario marketplace and reading their status.\nservers:\n  - url: https://api.bazario.example/orderflow/v1\npaths:\n  /orders:\n    post:\n      operationId: placeOrder\n      summary: Place an order and receive a confirmation\n      security:\n        - oidc: [orders:write]\n      parameters:\n        - $ref: '#/components/parameters/IdempotencyKey'\n      requestBody:\n        required: true\n        content:\n          application/json:\n            schema:\n              $ref: '#/components/schemas/PlaceOrderRequest'\n      responses:\n        '201':\n          description: Order stored; the confirmation (or \"payment pending\") is included\n          headers:\n            Location:\n              description: URL of the created order\n              schema: { type: string, format: uri-reference }\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/Order'\n        '409':\n          description: The same Idempotency-Key was used with a different body, or the first request is still running\n          content:\n            application/problem+json:\n              schema: { $ref: '#/components/schemas/Problem' }\n        '422':\n          description: Validation failed or an item is out of stock\n          content:\n            application/problem+json:\n              schema: { $ref: '#/components/schemas/Problem' }\n  /orders/{orderId}:\n    get:\n      operationId: getOrder\n      summary: Current state of an order\n      security:\n        - oidc: [orders:read]\n      parameters:\n        - name: orderId\n          in: path\n          required: true\n          schema: { type: string, format: uuid }\n      responses:\n        '200':\n          description: The order with its current status\n          content:\n            application/json:\n              schema: { $ref: '#/components/schemas/Order' }\n        '404':\n          description: No such order (or no access to it)\n          content:\n            application/problem+json:\n              schema: { $ref: '#/components/schemas/Problem' }\ncomponents:\n  parameters:\n    IdempotencyKey:\n      name: Idempotency-Key\n      in: header\n      required: true\n      description: Client-generated UUID. Repeating the request with the same key returns the original response.\n      schema: { type: string, format: uuid }\n  schemas:\n    Money:\n      type: object\n      required: [amount, currency]\n      properties:\n        amount: { type: string, pattern: '^\\d+\\.\\d{2}$', examples: ['249.90'] }   # decimal as text, never float\n        currency: { type: string, pattern: '^[A-Z]{3}$', examples: ['PLN'] }      # ISO 4217\n    OrderLine:\n      type: object\n      required: [offerId, quantity]\n      properties:\n        offerId: { type: string, format: uuid }        # a seller's offer of a product\n        quantity: { type: integer, minimum: 1, maximum: 99 }\n    PlaceOrderRequest:\n      type: object\n      required: [customerId, lines, delivery, paymentToken]\n      properties:\n        customerId: { type: string, format: uuid }\n        lines:\n          type: array\n          minItems: 1\n          items: { $ref: '#/components/schemas/OrderLine' }\n        delivery: { type: string, enum: [COURIER, PARCEL_LOCKER, PICKUP_POINT] }\n        paymentToken: { type: string, description: Token issued by the payment operator – never a card number }\n    Order:\n      type: object\n      required: [orderId, status, total, placedAt]\n      properties:\n        orderId: { type: string, format: uuid }\n        status: { type: string, enum: [CONFIRMED, PAYMENT_PENDING, PENDING_REVIEW, REJECTED] }\n        total: { $ref: '#/components/schemas/Money' }\n        placedAt: { type: string, format: date-time }\n        confirmedAt: { type: string, format: date-time }\n    Problem:   # RFC 9457 Problem Details for HTTP APIs\n      type: object\n      properties:\n        type: { type: string, format: uri-reference }\n        title: { type: string }\n        status: { type: integer }\n        detail: { type: string }\n        instance: { type: string, format: uri-reference }\n  securitySchemes:\n    oidc:\n      type: openIdConnect\n      openIdConnectUrl: https://login.bazario.example/.well-known/openid-configuration"}]},{"type":"codeBlock","attrs":{"language":"yaml","filename":"contracts/order-events.asyncapi.yaml"},"content":[{"type":"text","text":"asyncapi: 3.0.0\ninfo:\n  title: OrderFlow order events\n  version: 1.0.0\n  description: Events published by OrderFlow whenever an order is confirmed.\ndefaultContentType: application/json\nservers:\n  production:\n    host: kafka.bazario.example:9093\n    protocol: kafka-secure\n    description: Company Kafka cluster (TLS + SASL)\nchannels:\n  orderEvents:\n    address: orders.events.v1\n    messages:\n      orderConfirmed:\n        $ref: '#/components/messages/OrderConfirmed'\n    bindings:\n      kafka:\n        partitions: 12\n        replicas: 3\noperations:\n  publishOrderConfirmed:\n    action: send\n    summary: OrderFlow publishes every confirmed order through the transactional outbox.\n    channel:\n      $ref: '#/channels/orderEvents'\n    messages:\n      - $ref: '#/channels/orderEvents/messages/orderConfirmed'\ncomponents:\n  messages:\n    OrderConfirmed:\n      name: OrderConfirmed\n      title: Order confirmed\n      headers:\n        type: object\n        required: [eventId, eventType, occurredAt]\n        properties:\n          eventId: { type: string, format: uuid, description: Unique per event – consumers deduplicate on it }\n          eventType: { type: string, const: OrderConfirmed }\n          occurredAt: { type: string, format: date-time }\n          correlationId: { type: string }\n      payload:\n        $ref: '#/components/schemas/OrderConfirmedPayload'\n      bindings:\n        kafka:\n          key:\n            type: string\n            description: orderId – keeps all events of one order in order\n  schemas:\n    OrderConfirmedPayload:\n      type: object\n      required: [orderId, customerId, lines, total, paymentStatus, confirmedAt]\n      properties:\n        orderId: { type: string, format: uuid }\n        customerId: { type: string, format: uuid, description: Internal id only – no address, phone or e-mail }\n        lines:\n          type: array\n          items:\n            type: object\n            required: [offerId, sellerId, quantity]\n            properties:\n              offerId: { type: string, format: uuid }\n              sellerId: { type: string, format: uuid }\n              quantity: { type: integer, minimum: 1 }\n        total:\n          type: object\n          required: [amount, currency]\n          properties:\n            amount: { type: string, pattern: '^\\d+\\.\\d{2}$' }\n            currency: { type: string, pattern: '^[A-Z]{3}$' }\n        paymentStatus: { type: string, enum: [AUTHORISED, PENDING] }\n        confirmedAt: { type: string, format: date-time }"}]}]}]},"toc":[{"id":"the-integration-map-the-first-artefact","text":"The integration map – the first artefact","level":2,"locked":false},{"id":"synchronous-or-asynchronous","text":"Synchronous or asynchronous","level":2,"locked":false},{"id":"contract-first-openapi-and-asyncapi","text":"Contract first: OpenAPI and AsyncAPI","level":2,"locked":false},{"id":"versioning-contracts","text":"Versioning contracts","level":2,"locked":true},{"id":"idempotency","text":"Idempotency","level":2,"locked":true},{"id":"the-outbox-events-that-don-t-get-lost","text":"The outbox – events that don't get lost","level":2,"locked":true},{"id":"cross-team-dependencies-who-delivers-what-to-whom-and-when","text":"Cross-team dependencies: who delivers what to whom and when","level":2,"locked":true},{"id":"contract-tests","text":"Contract tests","level":2,"locked":true},{"id":"related","text":"Related","level":2,"locked":true},{"id":"check-yourself","text":"Check yourself","level":2,"locked":true}],"locked":true,"paywall":null,"previewRatio":0.3,"totalBlocks":57,"visibleBlocks":20,"resources":[{"id":"6b0857b23c96f2d34d0b3514","type":"repo","provider":"github","url":"https://github.com/asyncapi/spec","embedUrl":null,"title":"asyncapi/spec","description":"The AsyncAPI specification allows you to create machine-readable definitions of your asynchronous APIs.","author":"asyncapi","thumbnailUrl":"https://opengraph.githubassets.com/1/asyncapi/spec","durationSec":null,"lang":"en","topics":["event-driven-architecture"],"techs":["javascript"],"tags":["asyncapi","reactive","specification","websockets","amqp","mqtt","messaging","stomp","kafka","software-architecture"],"price":"free","featured":false,"featuredOrder":0,"packageName":null,"source":"github","publishedAt":"2016-11-18T22:06:50.000Z","popularity":72,"verifiedAt":"2026-11-26T10:56:00.000Z","curated":false,"addedBy":"6b0857a15a2625e44ecaabe6","createdAt":"2026-11-26T16:00:50.215Z","updatedAt":"2026-11-26T16:00:50.215Z"},{"id":"6b0857bf3c96f2d34d0b4281","type":"article","provider":"web","url":"https://microservices.io/patterns/data/transactional-outbox.html","embedUrl":null,"title":"Microservices Pattern: Pattern: Transactional outbox","description":"First, write the message/event to a database OUTBOX table as part of the transaction that updates business objects, and then publish it to a message broker.","author":"Chris Richardson (microservices.io)","thumbnailUrl":null,"durationSec":null,"lang":"en","topics":["event-driven-architecture","microservices"],"techs":["general"],"tags":["databases","messaging","software-architecture"],"price":"free","featured":false,"featuredOrder":0,"packageName":null,"source":"manual","publishedAt":null,"popularity":65,"verifiedAt":"2026-11-26T11:25:55.000Z","curated":false,"addedBy":"6b0857a15a2625e44ecaabe6","createdAt":"2026-11-26T16:01:02.417Z","updatedAt":"2026-11-26T16:01:02.417Z"},{"id":"6b0857be3c96f2d34d0b41ed","type":"article","provider":"web","url":"https://martinfowler.com/bliki/ContractTest.html","embedUrl":null,"title":"bliki: Contract Test","description":"Test Doubles avoid non-deterministic errors, but you need Contract Tests to ensure they remain consistent with the real services.","author":"Martin Fowler","thumbnailUrl":"https://martinfowler.com/bliki/images/contractTest/sketch.png","durationSec":null,"lang":"en","topics":[],"techs":["general"],"tags":["martin-fowler","testing"],"price":"free","featured":false,"featuredOrder":0,"packageName":null,"source":"manual","publishedAt":null,"popularity":75,"verifiedAt":"2026-11-26T11:07:18.000Z","curated":false,"addedBy":"6b0857a15a2625e44ecaabe6","createdAt":"2026-11-26T16:00:59.965Z","updatedAt":"2026-11-26T16:00:59.965Z"},{"id":"6b0857bf3c96f2d34d0b4250","type":"article","provider":"web","url":"https://learn.microsoft.com/en-us/azure/architecture/microservices/design/api-design","embedUrl":null,"title":"API Design","description":"Learn about API design for microservices, including REST and RPC trade-offs, versioning strategies, and mapping REST to domain-driven design.","author":"Microsoft Azure Architecture Center","thumbnailUrl":"https://learn.microsoft.com/en-us/media/open-graph-image.png","durationSec":null,"lang":"en","topics":["microservices","ddd-strategic-design"],"techs":["general"],"tags":["azure","cloud","api-design","software-architecture"],"price":"free","featured":false,"featuredOrder":0,"packageName":null,"source":"manual","publishedAt":null,"popularity":68,"verifiedAt":"2026-11-26T11:07:35.000Z","curated":false,"addedBy":"6b0857a15a2625e44ecaabe6","createdAt":"2026-11-26T16:01:02.417Z","updatedAt":"2026-11-26T16:01:02.417Z"},{"id":"6b0857bf3c96f2d34d0b4253","type":"article","provider":"web","url":"https://learn.microsoft.com/en-us/azure/architecture/microservices/design/interservice-communication","embedUrl":null,"title":"Interservice communication in microservices","description":"Learn about the tradeoffs between asynchronous messaging versus synchronous APIs for communication between microservices and some challenges in communication.","author":"Microsoft Azure Architecture Center","thumbnailUrl":"https://learn.microsoft.com/en-us/media/open-graph-image.png","durationSec":null,"lang":"en","topics":["microservices"],"techs":["general"],"tags":["azure","cloud","software-architecture"],"price":"free","featured":false,"featuredOrder":0,"packageName":null,"source":"manual","publishedAt":null,"popularity":68,"verifiedAt":"2026-11-26T11:07:35.000Z","curated":false,"addedBy":"6b0857a15a2625e44ecaabe6","createdAt":"2026-11-26T16:01:02.417Z","updatedAt":"2026-11-26T16:01:02.417Z"},{"id":"6b0857c93c96f2d34d0b4aaa","type":"video","provider":"youtube","url":"https://www.youtube.com/watch?v=w1P7FBBrrig","embedUrl":"https://www.youtube-nocookie.com/embed/w1P7FBBrrig","title":"Idempotent Requests in Microservices (Minute Engineering)","description":"In this story, I discuss Idempotency and its importance in Microservices 🏭 Software Architecture Videos https://www.youtube.com/playlist?list=PLQnljOFTspQXNP6mQchJVP3S-3oKGEuw9 💾 Database Engineering Videos https://www.youtube.com/playlist?list=PLQnljOFTspQXjD0HOzN7P2tgzu7scWpl2 🛰 Network…","author":"Hussein Nasser","thumbnailUrl":"https://i.ytimg.com/vi/w1P7FBBrrig/hqdefault.jpg","durationSec":null,"lang":"en","topics":["microservices"],"techs":["general"],"tags":["databases","software-architecture"],"price":"free","featured":false,"featuredOrder":0,"packageName":null,"source":"youtube-rss","publishedAt":"2020-06-02T13:45:01.000Z","popularity":54,"verifiedAt":"2026-11-26T10:55:18.000Z","curated":false,"addedBy":"6b0857a15a2625e44ecaabe6","createdAt":"2026-11-26T16:01:12.872Z","updatedAt":"2026-11-26T16:01:12.872Z"}],"challenges":[{"id":"6b093dc291bd8fbaf2a0c8d8","slug":"payment-circuit-breaker","title":"Circuit breaker for a payment gateway","summary":"A circuit breaker with closed, open and half-open states, an injected clock, a trial-success threshold and a business-error filter – so a payment gateway outage does not take the whole shop down.","servedLang":"en","availableLangs":["pl","en"],"kind":"code","category":"architecture","status":"published","difficulty":"hard","topics":["circuit-breaker","microservices"],"techs":["typescript","javascript","python","dotnet","java","go"],"tags":["circuit-breaker","resilience","fault-tolerance","state-machine","payments"],"languages":["typescript","javascript","python","csharp","java","go"],"questionCount":null,"xp":40,"stats":{"attempts":0,"solves":0,"solutions":0,"comments":0},"solveRate":null,"publishedAt":"2026-11-27T08:22:26.251Z"},{"id":"6b093ddfbd4755deb67ee092","slug":"retry-with-backoff","title":"Retry with exponential backoff","summary":"A function that retries a failed operation after 100, 200, 400… ms, with a cap and an error filter. The sleep function is injected, so tests never wait a millisecond.","servedLang":"en","availableLangs":["pl","en"],"kind":"code","category":"algorithms","status":"published","difficulty":"easy","topics":["circuit-breaker"],"techs":["typescript","javascript","python","dotnet","java","go"],"tags":["resilience","backoff","higher-order-functions","dependency-injection","async"],"languages":["typescript","javascript","python","csharp","java","go"],"questionCount":null,"xp":10,"stats":{"attempts":0,"solves":0,"solutions":0,"comments":0},"solveRate":null,"publishedAt":"2026-11-27T08:22:55.300Z"},{"id":"6b093dc191bd8fbaf2a0c8d0","slug":"inventory-cqrs","title":"Inventory with CQRS – separate write and read models","summary":"Warehouse commands validated on their own write model, events on a bus and a projection building a read model with a low-stock report. The read model can be rebuilt from events alone.","servedLang":"en","availableLangs":["pl","en"],"kind":"code","category":"architecture","status":"published","difficulty":"medium","topics":["cqrs","event-driven-architecture"],"techs":["typescript","javascript","python","dotnet","java","go"],"tags":["cqrs","read-model","projection","events","inventory"],"languages":["typescript","javascript","python","csharp","java","go"],"questionCount":null,"xp":20,"stats":{"attempts":0,"solves":0,"solutions":0,"comments":0},"solveRate":null,"publishedAt":"2026-11-27T08:22:25.519Z"}],"attachments":[],"hasCode":true,"repoUrl":null,"series":[{"slug":"solution-architect-path","title":"How to become a Solution Architect","items":[{"slug":"solution-architecture","title":"Who is a Solution Architect? The role, its responsibilities and the career map","current":false},{"slug":"sa-daily-duties","title":"A day in the life of a Solution Architect: duties, rhythm and priorities","current":false},{"slug":"sa-requirements-and-nfr","title":"Requirements and NFRs: getting the numbers out of the business that actually shape the system","current":false},{"slug":"sa-hld-step-by-step","title":"HLD step by step: from a blank page to an approved architecture","current":false},{"slug":"hld-complete-example","title":"A complete HLD by example: the VoltGo charging network – document, diagrams, ADRs and tools","current":false},{"slug":"poc-guide","title":"PoC, spike, prototype, MVP – how to plan and run a PoC (with a working example)","current":false},{"slug":"sa-decisions-and-adr","title":"Architecture decisions and ADRs: how to choose, weigh trade-offs and record the “why”","current":false},{"slug":"sa-integrations-and-contracts","title":"Integrations and contracts: APIs, events and cross-team dependencies without surprises","current":true},{"slug":"sa-security-and-operations","title":"Security and operations in the design: STRIDE, OAuth2, SLOs and runbooks","current":false},{"slug":"sa-estimation-cost-tco","title":"Estimation, cost and TCO: what it costs and how many servers you really need","current":false},{"slug":"sa-governance-and-reviews","title":"Governance and reviews: how to defend a design in front of the Architecture Review Board","current":false},{"slug":"sa-migrations-as-is-to-be","title":"AS-IS → TO-BE migration without downtime: transitional architecture, strangler fig and CDC","current":false},{"slug":"sa-how-to-become","title":"How to become a Solution Architect: skills, path, interview and the first 90 days","current":false}]}],"prev":{"slug":"sa-decisions-and-adr","title":"Architecture decisions and ADRs: how to choose, weigh trade-offs and record the “why”"},"next":{"slug":"sa-security-and-operations","title":"Security and operations in the design: STRIDE, OAuth2, SLOs and runbooks"},"featured":false,"authorCard":{"id":"6b08bd2e80884893657cc8cf","name":"Redakcja Art of Devs","avatar":null,"handle":"redakcja","headline":"Wzorce projektowe · Architektura · AI i LLM","community":false,"reputation":{"points":3900,"level":{"key":"mentor","label":"Mentor"}},"articles":104,"skills":[{"key":"typescript","title":"TypeScript","level":5,"levelLabel":"Authority","articles":90},{"key":"dotnet","title":".NET","level":5,"levelLabel":"Authority","articles":61},{"key":"python","title":"Python","level":5,"levelLabel":"Authority","articles":59},{"key":"java","title":"Java","level":5,"levelLabel":"Authority","articles":46}]}}