Skip to content

Instantly share code, notes, and snippets.

@matevzmihalic
matevzmihalic / mqttDB.md
Last active May 18, 2021 19:29
Using MQTT as key/value DB

Publishing on a topic with retain flag set will store a message on a specified topic permanently. With MQTT5 you could also specify message expiry so message would get deleted automatically after specified time. Depending on the broker configuration the data could stay persisted after server restart. It will work on any MQTT broker, but for testing you can run Mosquitto in Docker:

docker run -d -p 1883:1883 eclipse-mosquitto:1.6.14

Create/update

### Keybase proof
I hereby claim:
* I am matevzmihalic on github.
* I am matevzmihalic (https://keybase.io/matevzmihalic) on keybase.
* I have a public key whose fingerprint is D5FD 188D 7946 4DF5 098B D95F 75B3 9262 2D81 F7E7
To claim this, I am signing this object: