---
id: "fanout-inline-in-request-path"
type: "rule"
severity: "warning"
url: "https://localhost:3000/catalogue/rules/fanout-inline-in-request-path"
---

# Fan-out inline in the request path

An application server calls a worker synchronously, so the request waits for background work such as fan-out.

| | |
|---|---|
| Severity | warning |
| Selects | every node of kind app-server |
| Components in scope | 99 |

## Why

Calling a worker synchronously puts the background job on the request path. The caller waits for the slowest part of the fan-out.

## What it checks

It looks at every node of kind app-server, and fires when:

- the node has at least one synchronous outgoing edge to a worker

Message template:

```
Service '{{node.id}}' calls a worker synchronously. Hand the job to a queue or stream so the request path does not wait for fan-out.
```

## Applies to

- [Application server](https://localhost:3000/catalogue/kinds/app-server.md) `app-server`

99 catalogue components fall under it.

## Tripped by

Reference designs whose broken twin names this rule in its header:

- [airbnb-search](https://localhost:3000/d/zeema/airbnb-search)
- [amazon-order](https://localhost:3000/d/zeema/amazon-order)
- [canva-uploads](https://localhost:3000/d/zeema/canva-uploads)
- [datadog-husky](https://localhost:3000/d/zeema/datadog-husky)
- [duolingo-backend](https://localhost:3000/d/zeema/duolingo-backend)
- [github-mysql](https://localhost:3000/d/zeema/github-mysql)
- [hotstar-streaming](https://localhost:3000/d/zeema/hotstar-streaming)
- [khan-academy-goliath](https://localhost:3000/d/zeema/khan-academy-goliath)
- [linear-sync](https://localhost:3000/d/zeema/linear-sync)
- [notion-sharding](https://localhost:3000/d/zeema/notion-sharding)
- [paypal-payments](https://localhost:3000/d/zeema/paypal-payments)
- [pinterest-feed](https://localhost:3000/d/zeema/pinterest-feed)
- [stock-exchange](https://localhost:3000/d/zeema/stock-exchange)
- [twitter-timeline](https://localhost:3000/d/zeema/twitter-timeline)
- [youtube-upload-playback](https://localhost:3000/d/zeema/youtube-upload-playback)

## Source (`rule` YAML, verbatim)

```yaml
# yaml-language-server: $schema=../schema/rule.schema.json
# An app-server that calls a worker synchronously puts fan-out (or any background job) on the
# request path: the caller's latency becomes the tail of the follower distribution.
# Tripped by: designs/twitter-timeline.broken.yaml
schemaVersion: "1"
type: "rule"
id: "fanout-inline-in-request-path"
severity: "warning"
select:
  node:
    kind: "app-server"
when:
  hasEdge:
    direction: "out"
    mode: "sync"
    peerKind: "worker"
message: "Service '{{node.id}}' calls a worker synchronously. Hand the job to a queue or stream so the request path does not wait for fan-out."
```

Human page: https://localhost:3000/catalogue/rules/fanout-inline-in-request-path
