Introduction
IoT devices often need to send and receive messages efficiently and reliably. Choosing the right way to organize these messages, called topic design patterns, helps devices communicate clearly and avoid confusion.
Imagine a large office building where mail is sorted by floor, then by department, and finally by individual employee. Sometimes, you want to send mail to a whole floor, sometimes just a department, and other times to a specific person. Using this system helps mail reach the right place quickly.
┌───────────────┐ │ Building │ ├───────────────┤ │ Floor 1 │ │ ├─ Dept A │ │ │ ├─ Emp 1 │ │ │ └─ Emp 2 │ │ └─ Dept B │ │ ├─ Emp 3 │ │ └─ Emp 4 │ │ Floor 2 │ │ ├─ Dept C │ │ │ ├─ Emp 5 │ │ │ └─ Emp 6 │ │ └─ Dept D │ │ ├─ Emp 7 │ │ └─ Emp 8 │ └───────────────┘