22

I see this word in many places but don't get it.

From the Wikipedia,

In message-oriented middleware solutions, fan-out is a messaging pattern used to model an information exchange that implies the delivery (or spreading) of a message to one or multiple destinations possibly in parallel, and not halting the process that executes the messaging to wait for any response to that message.

but I don't know what it means under other contexts, for example,

Can you please explain this term to me? Are there other places using this term? Thank you.

1
  • In RabbitMQ at least, the term 'fan out' refers to a lack of routing or filtering intelligence; any subscriber(queue) attached to a fan-out exchange will always ignore all routing keys and filter patterns, and therefore messages published to that exchange are always delivered to all subscribers. On the flipside, RabbitMQ supports routing models where subscribers can choose to filter the messages they receive based upon some pattern matching and routing key rules. So in that context at least, fanout just means unconditional delivery to all subscribers. Commented Jan 13, 2021 at 23:22

2 Answers 2

9

This term was originally from electronic components and defined the flow between their inputs and outputs. Fan-in refers to the number of higher-level modules that directly call the module, while fan-out refers to the number of lower-level modules directly called by the module.

AWS Kinesis enhanced fan-out feature

This refers to the shard being ingested (called) by a number of consumers (lower-level modules). The shard in Kinesis has a limited outbound throughput (2MB/second), it is shared by very limited clients. And this feature enables to achieve higher outbound throughput without having to provision more streams or shards in the same stream, so each consumer has that 2MB/s throughput.

Fanout load test on a distributed service

Sometimes larger requests may take longer to complete than smaller request. So it's worth testing whether the request handling can speed up if we turn one large request into a number of smaller requests instead. So here fan-out means split a large request payload into smaller batches and send out the request multiple times (lower-level modules) to the service.

Are there other places using this term?

One use case I can think of is fan-out write/read.

For example, if you tweet and Twitter delivers that to all the subscribers feeds as soon as it is written (fan-out write). Or a feed service that waits until users are actually consuming the feed, at that time it looks for posts that have been written that this user is eligible to read (fan-out read).

2
  • "Are there other places using this term?" In neural networks fan out indicates the outgoing connection from one layer to the next.
    – FluidCode
    Commented Jan 13, 2021 at 22:35
  • Thank you for the explanation of different contexts, it is really helpful! Commented Jan 14, 2021 at 0:26
16

Indeed that Wikipedia definition misses the point.

Think in terms of a data flow diagram. Each processing node can have its output wired to 0 or more downstream nodes. In a visual diagram, those output wires look like a hand-held paper fan. Those wires or number of wires is its fan-out.

enter image description here

A node's input can be wired to multiple sources. That's its fan-in.

The term comes from electrical engineering of logic gates.

1
  • 2
    A picture is worth a thousand words. Thank you.
    – Victor Di
    Commented Aug 26, 2023 at 17:29

Not the answer you're looking for? Browse other questions tagged or ask your own question.