Let’s assume that we have a lot of sensors publishing structured data to an MQTT broker and we want to store this data in a database. A simple way to do that is to use Telegraf (tool from InfluxData) to consume and process the data and store it in an InfluxDB database. In this tutorial, I will explain how to prepare this setup using docker-compose.
![](https://dmelo.eu/img/post_influxdb_telegraf_mqtt/influxdb_telegraf_mqtt_cover_mini.png)