Softwr

Networking · head to head

MQTT vs Preact

MQTT logo

MQTT

Networking

Lightweight messaging protocol for IoT devices

From
Free
Free plan
Yes
Preact logo

Preact

Web Development

3kB alternative to React with the same modern API

From
Free
Free plan
Yes

The short version

  • Both are free.
  • Only MQTT lists QoS Levels; only Preact lists 3kB runtime.
  • Where MQTT falls short: MQTT is an open-source protocol standard with no commercial pricing; not a commercial product.
  • Where Preact falls short: compatibility through preact/compat is good but not total, and some React libraries break in ways that are hard to diagnose.

How do MQTT and Preact differ?

MQTT and Preact differ on pricing model, platforms and category (Networking against Web Development). Only the attributes on which MQTT and Preact actually diverge.

Attributes where MQTT and Preact differ
AttributeMQTTPreact
Pricing modelOpen-sourceOpen source, no licence fee
PlatformsAny platform, Embedded devices, Web, Browser extensionWeb
CategoryNetworkingWeb Development

Identical on both: starting price (Free), free tier (Yes).

Not yet recorded: founded for Preact.

Which features does each one have?

They share no listed features; 12 appear only for MQTT and 4 only for Preact. Drawn from each product's published feature list. An absence here means we hold no record of it - not that the product lacks it.

Only in MQTT

  • Publish-Subscribe
  • Lightweight
  • QoS Levels
  • Retained Messages
  • IoT platforms
  • Home automation
  • Cloud services
  • Edge devices

Only in Preact

  • 3kB runtime
  • preact/compat
  • Same modern API
  • Fast rendering

What is each one used for?

MQTT is most often brought in for IoT messaging; Preact for embedded widgets that load inside someone else’s page and must stay small. The jobs each tool is most often brought in to do.

MQTT

  • IoT messagingnot Preact
  • Sensor datanot Preact
  • Real-time updatesnot Preact
  • Device telemetrynot Preact

Preact

  • Embedded widgets that load inside someone else’s page and must stay smallnot MQTT
  • Marketing and content sites where JavaScript payload affects Core Web Vitalsnot MQTT
  • Applications targeting low-bandwidth or low-powered devicesnot MQTT

Where do MQTT and Preact fall short?

MQTT's most cited limit: MQTT is an open-source protocol standard with no commercial pricing; not a commercial product. Preact's: behavioural differences from React exist in edge cases, particularly around event handling. Documented limitations, not opinions. Every one is a constraint you would hit in normal use.

MQTT

  • MQTT is an open-source protocol standard with no commercial pricing; not a commercial product
  • Security is not built into the protocol: encryption relies on TLS or application level encryption, and TLS adds network overhead
  • Clients cannot exchange messages directly: a broker server is required to route published messages to subscribers
  • Delivery has only three quality of service levels (at most once, at least once, exactly once), so richer routing needs broker features

Preact

  • Compatibility through preact/compat is good but not total, and some React libraries break in ways that are hard to diagnose
  • Behavioural differences from React exist in edge cases, particularly around event handling
  • A much smaller community, so unusual problems have fewer existing answers than React

How much do MQTT and Preact cost?

MQTT is free to use; Preact is free to use. Plan by plan below, from each vendor's own pricing page.

MQTT

Free
  • Open ProtocolFree
    • Publish-subscribe
    • Lightweight
    • QoS levels

Preact

Free
  • PreactFree
    • Full library
    • Commercial use permitted
    • No usage limits

Which should you pick?

Choose MQTT if

  • You need publish-subscribe.
  • You want to start without paying.
  • You work on Any platform, Embedded devices, Web, Browser extension.
  • You also want lightweight.

Choose Preact if

  • You need 3kb runtime.
  • You want to start without paying.
  • You also want preact/compat.

Questions people ask

Is MQTT or Preact better?
It depends on the job. MQTT fits ioT messaging; Preact fits embedded widgets that load inside someone else’s page and must stay small. MQTT starts at Free and Preact at Free.
Which is cheaper, MQTT or Preact?
MQTT starts at Free and Preact at Free.
Does MQTT or Preact run on more platforms?
MQTT runs on Any platform, Embedded devices, Web, Browser extension. Preact runs on Web.
Can I use MQTT for free?
Both have a free tier, so you can try either at no cost before committing.
What is MQTT best used for?
MQTT is most often used for iot messaging, sensor data, real-time updates, device telemetry. Of those, iot messaging and sensor data are not what Preact is typically brought in for.
What can MQTT do that Preact cannot?
MQTT covers Publish-Subscribe, Lightweight, QoS Levels, Retained Messages. Preact covers 3kB runtime, preact/compat, Same modern API, Fast rendering.

Answered from the vendors’ own pages

MQTT: Does MQTT have a commercial license cost?

MQTT is an open-source communication protocol and standard. No pricing is published because MQTT itself is not a commercial product for sale.

Source
Preact: Is Preact free?

Yes, open source under the MIT licence.

Preact: Can I use React libraries with Preact?

Most, through the preact/compat layer. Compatibility is good but not complete, so libraries relying on React internals can break.

Preact: Why choose Preact over React?

Bundle size, almost always. If payload is not a binding constraint, React’s ecosystem is usually the better trade.

Share

Related pages

Other head to heads