Click Below to Get the Code

Browse, clone, and build from real-world templates powered by Harper.
Tutorial
GitHub Logo

A Simpler Real-Time Messaging Architecture with MQTT, WebSockets, and SSE

Learn how to build a unified real-time backbone using Harper with MQTT, WebSockets, and Server-Sent Events. This guide shows how to broker messages, fan out real-time data, and persist events in one runtime—simplifying real-time system architecture for IoT, dashboards, and event-driven applications.
Harper Learn
Tutorial
Harper Learn

A Simpler Real-Time Messaging Architecture with MQTT, WebSockets, and SSE

Ivan R. Judson, Ph.D.
Distinguished Solution Architect
at Harper
December 19, 2025
Ivan R. Judson, Ph.D.
Distinguished Solution Architect
at Harper
December 19, 2025
Ivan R. Judson, Ph.D.
Distinguished Solution Architect
at Harper
December 19, 2025
December 19, 2025
Learn how to build a unified real-time backbone using Harper with MQTT, WebSockets, and Server-Sent Events. This guide shows how to broker messages, fan out real-time data, and persist events in one runtime—simplifying real-time system architecture for IoT, dashboards, and event-driven applications.
Ivan R. Judson, Ph.D.
Distinguished Solution Architect

👉 Follow along with the code: https://github.com/HarperFast/mqtt-getting-started


If you want to run everything you see in the video yourself, start with the repository above. It contains a working example of Harper acting as a real-time backbone—brokering MQTT, WebSockets, and Server-Sent Events, while also persisting data in one place.

This post is here to answer a slightly bigger question:

Why would you want to build something like this in the first place?

Problem: Real-Time Is Fragmented

Most real-world systems don’t use just one real-time protocol.

You might have:

  • Devices publishing telemetry over MQTT
  • Browsers consuming live updates over WebSockets
  • Dashboards or services subscribing via HTTP events
  • Applications that need the data stored for querying, replay, or recovery

Traditionally, these concerns get split apart:

  • A broker handles MQTT
  • A database stores the data
  • A separate service fans events out to clients
  • More glue connects everything together

Each piece works—but the system becomes harder to reason about, harder to scale, and harder to change.

What we’re exploring here is a simpler model:
one runtime that handles messaging, fan-out, and persistence together.

What Harper Is Doing Differently

In this setup, Harper sits in the middle as a real-time backbone, not just a message broker.

That means:

  • MQTT clients can publish and subscribe directly to Harper
  • WebSocket clients can publish and subscribe to the same resources
  • Server-Sent Events clients can subscribe over plain HTTP
  • Messages are persisted automatically as structured data
  • Every protocol sees the same events, in real time

There’s no translation layer and no external sync process. Once a message arrives, it’s immediately usable everywhere.

Getting Started: Minimal Setup, Real Results

Most of this works with almost no configuration.

In config.yml, enabling REST is enough:

rest: true


This turns on:

  • WebSocket support
  • Server-Sent Events
  • Resource-based pub/sub

MQTT support is already enabled by default.

From there, we define a couple of tables in schema.graphql:

type topics @export {
  id: ID!
}

type sensors {
  id: ID!
  location: String
  temperature: Float
}

The exported topics table enables wildcard subscriptions, while sensors gives us a place to persist incoming telemetry.

This is important: messages aren’t ephemeral. They’re stored, queryable, and replayable.

Publish Once, Use Everywhere

An MQTT publisher sends sensor data:

{
  "id": "sensor-101",
  "location": "lab",
  "temperature": 97.2
}

That single publish:

  • Updates the sensors table
  • Notifies MQTT subscribers
  • Pushes updates to WebSocket clients
  • Streams events to Server-Sent Events clients

For example, a WebSocket client can subscribe with:

ws://localhost:9926/sensors/sensor-101

And an SSE client uses the same resource over HTTP:

http://localhost:9926/sensors/sensor-101

Same data. Same topic. Different protocols.

Why This Matters in Practice

This pattern shows up in a lot of real systems:

  • IoT and edge telemetry, where devices publish over MQTT but humans consume data in browsers
  • Operational dashboards, where live data and historical data must stay in sync
  • Event-driven applications, where services need both real-time notifications and durable state
  • Distributed systems, where reducing moving parts directly improves reliability

By collapsing messaging, storage, and fan-out into one runtime, Harper makes these systems easier to build and easier to operate.

You spend less time wiring infrastructure together—and more time building the application logic that actually matters.

What Comes Next

In the next step (and the next video), we build an application that listens to these table-level events directly inside Harper. That’s where this turns from “broker demo” into a full event-driven application model.

Until then, clone the repo, run it locally, and watch the data flow.

Take a breath. Grab a cup of tea.
And enjoy building simpler real-time systems

👉 Follow along with the code: https://github.com/HarperFast/mqtt-getting-started


If you want to run everything you see in the video yourself, start with the repository above. It contains a working example of Harper acting as a real-time backbone—brokering MQTT, WebSockets, and Server-Sent Events, while also persisting data in one place.

This post is here to answer a slightly bigger question:

Why would you want to build something like this in the first place?

Problem: Real-Time Is Fragmented

Most real-world systems don’t use just one real-time protocol.

You might have:

  • Devices publishing telemetry over MQTT
  • Browsers consuming live updates over WebSockets
  • Dashboards or services subscribing via HTTP events
  • Applications that need the data stored for querying, replay, or recovery

Traditionally, these concerns get split apart:

  • A broker handles MQTT
  • A database stores the data
  • A separate service fans events out to clients
  • More glue connects everything together

Each piece works—but the system becomes harder to reason about, harder to scale, and harder to change.

What we’re exploring here is a simpler model:
one runtime that handles messaging, fan-out, and persistence together.

What Harper Is Doing Differently

In this setup, Harper sits in the middle as a real-time backbone, not just a message broker.

That means:

  • MQTT clients can publish and subscribe directly to Harper
  • WebSocket clients can publish and subscribe to the same resources
  • Server-Sent Events clients can subscribe over plain HTTP
  • Messages are persisted automatically as structured data
  • Every protocol sees the same events, in real time

There’s no translation layer and no external sync process. Once a message arrives, it’s immediately usable everywhere.

Getting Started: Minimal Setup, Real Results

Most of this works with almost no configuration.

In config.yml, enabling REST is enough:

rest: true


This turns on:

  • WebSocket support
  • Server-Sent Events
  • Resource-based pub/sub

MQTT support is already enabled by default.

From there, we define a couple of tables in schema.graphql:

type topics @export {
  id: ID!
}

type sensors {
  id: ID!
  location: String
  temperature: Float
}

The exported topics table enables wildcard subscriptions, while sensors gives us a place to persist incoming telemetry.

This is important: messages aren’t ephemeral. They’re stored, queryable, and replayable.

Publish Once, Use Everywhere

An MQTT publisher sends sensor data:

{
  "id": "sensor-101",
  "location": "lab",
  "temperature": 97.2
}

That single publish:

  • Updates the sensors table
  • Notifies MQTT subscribers
  • Pushes updates to WebSocket clients
  • Streams events to Server-Sent Events clients

For example, a WebSocket client can subscribe with:

ws://localhost:9926/sensors/sensor-101

And an SSE client uses the same resource over HTTP:

http://localhost:9926/sensors/sensor-101

Same data. Same topic. Different protocols.

Why This Matters in Practice

This pattern shows up in a lot of real systems:

  • IoT and edge telemetry, where devices publish over MQTT but humans consume data in browsers
  • Operational dashboards, where live data and historical data must stay in sync
  • Event-driven applications, where services need both real-time notifications and durable state
  • Distributed systems, where reducing moving parts directly improves reliability

By collapsing messaging, storage, and fan-out into one runtime, Harper makes these systems easier to build and easier to operate.

You spend less time wiring infrastructure together—and more time building the application logic that actually matters.

What Comes Next

In the next step (and the next video), we build an application that listens to these table-level events directly inside Harper. That’s where this turns from “broker demo” into a full event-driven application model.

Until then, clone the repo, run it locally, and watch the data flow.

Take a breath. Grab a cup of tea.
And enjoy building simpler real-time systems

Learn how to build a unified real-time backbone using Harper with MQTT, WebSockets, and Server-Sent Events. This guide shows how to broker messages, fan out real-time data, and persist events in one runtime—simplifying real-time system architecture for IoT, dashboards, and event-driven applications.

Download

White arrow pointing right
Learn how to build a unified real-time backbone using Harper with MQTT, WebSockets, and Server-Sent Events. This guide shows how to broker messages, fan out real-time data, and persist events in one runtime—simplifying real-time system architecture for IoT, dashboards, and event-driven applications.

Download

White arrow pointing right
Learn how to build a unified real-time backbone using Harper with MQTT, WebSockets, and Server-Sent Events. This guide shows how to broker messages, fan out real-time data, and persist events in one runtime—simplifying real-time system architecture for IoT, dashboards, and event-driven applications.

Download

White arrow pointing right

Explore Recent Resources

Livestream
GitHub Logo

1.5 Hour Build - Vibe Coding a Full Personal Site: Design to Deployment in One Session

Watch Austin rebuild his personal website live using Claude AI and Harper, including a custom Markdown CMS, GraphQL schema design, React scaffolding, and full deployment. A real-time pair coding session from design to launch.
Livestream
Watch Austin rebuild his personal website live using Claude AI and Harper, including a custom Markdown CMS, GraphQL schema design, React scaffolding, and full deployment. A real-time pair coding session from design to launch.
Person with short hair wearing a light blue patterned shirt, smiling widely outdoors with blurred greenery and trees in the background.
Austin Akers
Head of Developer Relations
Livestream

1.5 Hour Build - Vibe Coding a Full Personal Site: Design to Deployment in One Session

Watch Austin rebuild his personal website live using Claude AI and Harper, including a custom Markdown CMS, GraphQL schema design, React scaffolding, and full deployment. A real-time pair coding session from design to launch.
Austin Akers
May 2026
Livestream

1.5 Hour Build - Vibe Coding a Full Personal Site: Design to Deployment in One Session

Watch Austin rebuild his personal website live using Claude AI and Harper, including a custom Markdown CMS, GraphQL schema design, React scaffolding, and full deployment. A real-time pair coding session from design to launch.
Austin Akers
Livestream

1.5 Hour Build - Vibe Coding a Full Personal Site: Design to Deployment in One Session

Watch Austin rebuild his personal website live using Claude AI and Harper, including a custom Markdown CMS, GraphQL schema design, React scaffolding, and full deployment. A real-time pair coding session from design to launch.
Austin Akers
Blog
GitHub Logo

The Old Product Loop Is the New Bottleneck

AI has made it dramatically cheaper to get software to a working version, but most companies still plan like building is the expensive part. The new bottleneck is the product loop: forming sharp hypotheses, living inside the user experience, fixing friction as it appears, and feeding evidence back into the roadmap faster than ticket-based planning allows.
Blog
AI has made it dramatically cheaper to get software to a working version, but most companies still plan like building is the expensive part. The new bottleneck is the product loop: forming sharp hypotheses, living inside the user experience, fixing friction as it appears, and feeding evidence back into the roadmap faster than ticket-based planning allows.
Person with short dark hair and moustache, wearing a colorful plaid shirt, smiling outdoors in a forested mountain landscape.
Aleks Haugom
Senior Manager of GTM
Blog

The Old Product Loop Is the New Bottleneck

AI has made it dramatically cheaper to get software to a working version, but most companies still plan like building is the expensive part. The new bottleneck is the product loop: forming sharp hypotheses, living inside the user experience, fixing friction as it appears, and feeding evidence back into the roadmap faster than ticket-based planning allows.
Aleks Haugom
May 2026
Blog

The Old Product Loop Is the New Bottleneck

AI has made it dramatically cheaper to get software to a working version, but most companies still plan like building is the expensive part. The new bottleneck is the product loop: forming sharp hypotheses, living inside the user experience, fixing friction as it appears, and feeding evidence back into the roadmap faster than ticket-based planning allows.
Aleks Haugom
Blog

The Old Product Loop Is the New Bottleneck

AI has made it dramatically cheaper to get software to a working version, but most companies still plan like building is the expensive part. The new bottleneck is the product loop: forming sharp hypotheses, living inside the user experience, fixing friction as it appears, and feeding evidence back into the roadmap faster than ticket-based planning allows.
Aleks Haugom
Livestream
GitHub Logo

2 Hour Build - Live Stream for Non-Developers

A non-developer's live stream walkthrough of building Flow State, a Colorado river-flow app for rafters, in two hours using ChatGPT dictation, Claude Code, Claude Design, and Harper. Scaffold with npm create harper@latest and deploy to Harper Fabric. No coding background required.
Livestream
A non-developer's live stream walkthrough of building Flow State, a Colorado river-flow app for rafters, in two hours using ChatGPT dictation, Claude Code, Claude Design, and Harper. Scaffold with npm create harper@latest and deploy to Harper Fabric. No coding background required.
Person with short dark hair and moustache, wearing a colorful plaid shirt, smiling outdoors in a forested mountain landscape.
Aleks Haugom
Senior Manager of GTM
Livestream

2 Hour Build - Live Stream for Non-Developers

A non-developer's live stream walkthrough of building Flow State, a Colorado river-flow app for rafters, in two hours using ChatGPT dictation, Claude Code, Claude Design, and Harper. Scaffold with npm create harper@latest and deploy to Harper Fabric. No coding background required.
Aleks Haugom
May 2026
Livestream

2 Hour Build - Live Stream for Non-Developers

A non-developer's live stream walkthrough of building Flow State, a Colorado river-flow app for rafters, in two hours using ChatGPT dictation, Claude Code, Claude Design, and Harper. Scaffold with npm create harper@latest and deploy to Harper Fabric. No coding background required.
Aleks Haugom
Livestream

2 Hour Build - Live Stream for Non-Developers

A non-developer's live stream walkthrough of building Flow State, a Colorado river-flow app for rafters, in two hours using ChatGPT dictation, Claude Code, Claude Design, and Harper. Scaffold with npm create harper@latest and deploy to Harper Fabric. No coding background required.
Aleks Haugom
Tutorial
GitHub Logo

Production Quality at Vibe Code Velocity: Dispatched Agent Teams with Harper

Harper enables production-grade agentic engineering by collapsing database, cache, runtime, and messaging into one process, reducing agent complexity and review burden. A multi-model dispatch workflow lets specialized agents plan, code, QA, and review in parallel while humans retain control over critical decisions.
Tutorial
Harper enables production-grade agentic engineering by collapsing database, cache, runtime, and messaging into one process, reducing agent complexity and review burden. A multi-model dispatch workflow lets specialized agents plan, code, QA, and review in parallel while humans retain control over critical decisions.
Person with very short hair and a goatee wearing a plaid button‑up shirt over a white undershirt, smiling outdoors with leafy greenery behind.
Jeff Darnton
SVP, Professional Services & Customer Success
Tutorial

Production Quality at Vibe Code Velocity: Dispatched Agent Teams with Harper

Harper enables production-grade agentic engineering by collapsing database, cache, runtime, and messaging into one process, reducing agent complexity and review burden. A multi-model dispatch workflow lets specialized agents plan, code, QA, and review in parallel while humans retain control over critical decisions.
Jeff Darnton
May 2026
Tutorial

Production Quality at Vibe Code Velocity: Dispatched Agent Teams with Harper

Harper enables production-grade agentic engineering by collapsing database, cache, runtime, and messaging into one process, reducing agent complexity and review burden. A multi-model dispatch workflow lets specialized agents plan, code, QA, and review in parallel while humans retain control over critical decisions.
Jeff Darnton
Tutorial

Production Quality at Vibe Code Velocity: Dispatched Agent Teams with Harper

Harper enables production-grade agentic engineering by collapsing database, cache, runtime, and messaging into one process, reducing agent complexity and review burden. A multi-model dispatch workflow lets specialized agents plan, code, QA, and review in parallel while humans retain control over critical decisions.
Jeff Darnton
Tutorial
GitHub Logo

Change Data Capture Into a Runtime: One Pipeline for Pages, Search, and AI Agents

Learn how Harper turns CDC streams into real-time workflows that refresh cached pages, update search indexes, and keep AI agent context current. See why landing changes in an application runtime beats warehouses, queues, and traditional CDNs.
Tutorial
Learn how Harper turns CDC streams into real-time workflows that refresh cached pages, update search indexes, and keep AI agent context current. See why landing changes in an application runtime beats warehouses, queues, and traditional CDNs.
Person with very short hair and a goatee wearing a plaid button‑up shirt over a white undershirt, smiling outdoors with leafy greenery behind.
Jeff Darnton
SVP, Professional Services & Customer Success
Tutorial

Change Data Capture Into a Runtime: One Pipeline for Pages, Search, and AI Agents

Learn how Harper turns CDC streams into real-time workflows that refresh cached pages, update search indexes, and keep AI agent context current. See why landing changes in an application runtime beats warehouses, queues, and traditional CDNs.
Jeff Darnton
May 2026
Tutorial

Change Data Capture Into a Runtime: One Pipeline for Pages, Search, and AI Agents

Learn how Harper turns CDC streams into real-time workflows that refresh cached pages, update search indexes, and keep AI agent context current. See why landing changes in an application runtime beats warehouses, queues, and traditional CDNs.
Jeff Darnton
Tutorial

Change Data Capture Into a Runtime: One Pipeline for Pages, Search, and AI Agents

Learn how Harper turns CDC streams into real-time workflows that refresh cached pages, update search indexes, and keep AI agent context current. See why landing changes in an application runtime beats warehouses, queues, and traditional CDNs.
Jeff Darnton
Tutorial
GitHub Logo

Harper + Vertex AI: The Architecture Every Agent Builder Should Know

Production agents bleed tokens and latency on repeated queries. Pair a managed model layer with a vector-indexed data layer at the edge, and an 80% cache hit rate cuts LLM spend by 80% while delivering sub-100ms responses on semantically similar requests.
Tutorial
Production agents bleed tokens and latency on repeated queries. Pair a managed model layer with a vector-indexed data layer at the edge, and an 80% cache hit rate cuts LLM spend by 80% while delivering sub-100ms responses on semantically similar requests.
Person with styled reddish‑brown hair and a full beard wearing a gray suit with a light blue shirt and dark green tie, posing outdoors with a blurred pathway and greenery behind.
Drew Chambers
CMO
Tutorial

Harper + Vertex AI: The Architecture Every Agent Builder Should Know

Production agents bleed tokens and latency on repeated queries. Pair a managed model layer with a vector-indexed data layer at the edge, and an 80% cache hit rate cuts LLM spend by 80% while delivering sub-100ms responses on semantically similar requests.
Drew Chambers
May 2026
Tutorial

Harper + Vertex AI: The Architecture Every Agent Builder Should Know

Production agents bleed tokens and latency on repeated queries. Pair a managed model layer with a vector-indexed data layer at the edge, and an 80% cache hit rate cuts LLM spend by 80% while delivering sub-100ms responses on semantically similar requests.
Drew Chambers
Tutorial

Harper + Vertex AI: The Architecture Every Agent Builder Should Know

Production agents bleed tokens and latency on repeated queries. Pair a managed model layer with a vector-indexed data layer at the edge, and an 80% cache hit rate cuts LLM spend by 80% while delivering sub-100ms responses on semantically similar requests.
Drew Chambers