Search code examples
protocolsmqttiothivemq

Does MQTT protocol support database?


As we know MQTT have using subscribe/publish method. May i know what platform user can save the database using MQTT protocol. Its hivemq or mosquito support database so i can see previous data recorded from the sensor? If MQTT can support database. What other method beside using apache webserver.


Solution

  • MQTT is a Pub/Sub protocol, it is purely for delivering messages. What happens to those messages once delivered is not the concern of the protocol.

    If you want to store all messages then you are going to need to implement that yourself.

    This is either as:

    • A dedicated client that will subscribe to # and then store the messages to a database.
    • Some brokers have a plugin API that will allow you to register hooks that can intercept every message and store that to a database.

    You will have to research if any broker you want to use supports plugins of this nature.