<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/mqtt-and-mongodb-gtts0icar" -->

---
title: MQTT and MongoDB | daily.dev
description: A new experimental beta module for RESTHeart adds native MQTT broker connectivity, letting developers subscribe to MQTT topics, stream live values via SSE, and...
canonical: https://daily.dev/posts/mqtt-and-mongodb-gtts0icar
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: MQTT and MongoDB | daily.dev
og:description: A new experimental beta module for RESTHeart adds native MQTT broker connectivity, letting developers subscribe to MQTT topics, stream live values via SSE, and...
og:url: https://daily.dev/posts/mqtt-and-mongodb-gtts0icar
og:image: https://api.daily.dev/og/posts/GTTS0iCaR.png
og:image:alt: MQTT and MongoDB
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# MQTT and MongoDB

**[Maurizio Turatti](https://daily.dev/sources/yme3yawlpgbn37qff5ooo)** · [@maurizioturatti](https://daily.dev/maurizioturatti) · 1 min read · 34 upvotes · 1 comments

## Summary

A new experimental beta module for RESTHeart adds native MQTT broker connectivity, letting developers subscribe to MQTT topics, stream live values via SSE, and persist every message to MongoDB without building and maintaining separate services for each concern. The motivation came from a client project that needed the same MQTT data exposed as a live dashboard, via an HTTP endpoint for the latest value, and stored for later querying. RESTHeart already handled authentication, ACLs, the MongoDB API and a plugin model, so adding the broker connection consolidates all three needs into one service.

## Content

A client project needed data from an MQTT broker in three places. A dashboard showed sensor values as they arrived, other clients asked for the latest value over HTTP, and every message had to be stored in MongoDB.

The usual answer is a small service that subscribes to the broker, writes to the database and exposes an endpoint. When someone later asks for a live stream, a second service connects to the same broker, with its own authentication and its own way of decoding payloads.

RESTHeart already provides authentication, ACLs, the MongoDB API, SSE and a plugin model. The missing piece was the broker connection, so I added it as a RESTHeart module. It is now available as an experimental beta.

Full article here:

[https://maurizioturatti.com/writing/mqtt-and-mongodb-built-into-restheart/](https://maurizioturatti.com/writing/mqtt-and-mongodb-built-into-restheart/)

issues and comments: [https://github.com/SoftInstigate/restheart/issues?q=is%3Aissue+state%3Aopen+label%3AMqtt](https://github.com/SoftInstigate/restheart/issues?q=is%3Aissue+state%3Aopen+label%3AMqtt)

## Community discussion

Top comments from developers on daily.dev.

**@maurizioturatti** · 0 upvotes

> Issues can be added or commented here [https://github.com/SoftInstigate/restheart/issues?q=is%3Aissue+state%3Aopen+label%3AMqtt](https://github.com/SoftInstigate/restheart/issues?q=is%3Aissue+state%3Aopen+label%3AMqtt)

## Similar posts on daily.dev

- [How to Build Real-Time Update Systems with MQTT and Express.js](https://daily.dev/posts/how-to-build-real-time-update-systems-with-mqtt-and-express-js-f5kj7zdaa) · freeCodeCamp · 2 upvotes · 0 comments
- [Deploy Coreflux MQTT Broker with MongoDB on DigitalOcean](https://daily.dev/posts/deploy-coreflux-mqtt-broker-with-mongodb-on-digitalocean-hnijmnjbc) · DigitalOcean Community · 1 upvotes · 0 comments
- [How We Built Real-Time Stock Pricing at Mofid Brokerage](https://daily.dev/posts/how-we-built-real-time-stock-pricing-at-mofid-brokerage-qyxx4uuxg) · We Are .NET · 1 upvotes · 0 comments
- [MongooseIM 6.5: Open for Integration](https://daily.dev/posts/mongooseim-6-5-open-for-integration-wg0lragcu) · Erlang Solutions · 2 upvotes · 0 comments
- [MQTT Doesn't Have Message Queues. Inside the 2-Byte Protocol Powering Modern IoT.](https://daily.dev/posts/mqtt-doesn-t-have-message-queues-inside-the-2-byte-protocol-powering-modern-iot--khslvn3go) · DEV · 2 upvotes · 0 comments

---

Tags: [#backend](https://daily.dev/tags/backend), [#iot](https://daily.dev/tags/iot), [#mongodb](https://daily.dev/tags/mongodb)

[View this post on daily.dev](https://daily.dev/posts/mqtt-and-mongodb-gtts0icar)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"DiscussionForumPosting","mainEntityOfPage":"https://daily.dev/posts/mqtt-and-mongodb-gtts0icar","headline":"MQTT and MongoDB","text":"A new experimental beta module for RESTHeart adds native MQTT broker connectivity, letting developers subscribe to MQTT topics, stream live values via SSE, and persist every message to MongoDB without building and maintaining separate services for each concern. The motivation came from a client project that needed the same MQTT data exposed as a live dashboard, via an HTTP endpoint for the latest value, and stored for later querying. RESTHeart already handled authentication, ACLs, the MongoDB API and a plugin model, so adding the broker connection consolidates all three needs into one service.","url":"https://daily.dev/posts/mqtt-and-mongodb-gtts0icar","datePublished":"2026-09-16T07:50:11.605Z","dateModified":"2026-10-11T09:23:25.238Z","author":{"@type":"Person","name":"Maurizio Turatti","url":"https://daily.dev/maurizioturatti","image":"https://avatars.githubusercontent.com/u/365382?v=4","description":"Technical Advisor | Product Development, Cloud \u0026 Software Architecture","interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"EndorseAction"},"userInteractionCount":750}},"image":"https://media.daily.dev/image/upload/s--vCSuVzDn--/f_auto/v1789545012/posts/GTTS0iCaR?_a=BAMAMicg0","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":34},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":1}],"comment":[{"@type":"Comment","text":"Issues can be added or commented here https://github.com/SoftInstigate/restheart/issues?q=is%3Aissue+state%3Aopen+label%3AMqtt","datePublished":"2026-10-11T09:22:29.596Z","url":"https://daily.dev/posts/GTTS0iCaR#c-loTN3uLXP","author":{"@type":"Person","name":"Maurizio Turatti","url":"https://daily.dev/maurizioturatti","image":"https://avatars.githubusercontent.com/u/365382?v=4"}}],"isPartOf":{"@type":"WebPage","url":"https://daily.dev/sources/yme3yawlpgbn37qff5ooo","name":"Maurizio Turatti"}}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Maurizio Turatti","item":"https://daily.dev/sources/yme3yawlpgbn37qff5ooo"},{"@type":"ListItem","position":3,"name":"MQTT and MongoDB"}]}
```

