Datacake Docs
  • Welcome
  • Get Started
  • Changelog
  • Best practices
    • Best practices: Getting started
    • Best practices: Resolution (Timeframe)
    • Best practices: Dashboards
    • Best practices: Reports
    • Best practices: Grouping Devices
  • Datacake LNS
    • Getting Started
    • Gateways
      • Milesight LoRaWAN Gateway - UG6x
      • RAKwireless WisGate Edge Light 2
    • Devices
    • Add Devices without Gateway
  • Device
    • Product
    • Configuration
    • Claiming
    • Historical Data
    • Database
      • Configuration Fields
      • Fields
        • Manual input
        • Field Roles
        • Formulas
        • Mapping Fields
      • Data retention & Datapoints
      • Examples
        • Mapping 4-20mA Signals
        • Converting Units
  • Dashboards
    • Global Dashboards
      • Setting Homepage
    • Device Dashboards
    • Multi-Device Dashboards
    • Widgets
      • Value Widget
      • Chart Widget
      • Image Map
      • Map Widget
      • Text Widget
      • SOS Widget
      • Boolean Widget
      • iFrame Widget
      • Downlink Widget
      • Set Value Widget
      • Measurement List Widget
      • Heatmap Widget
      • Table Widget
      • Image Widget
  • Portal
    • Multi-Tenancy (Workspaces)
    • Reports
      • Energy Report
    • Administrators
    • Members
      • API Users
    • Security & Privacy
    • Billing
      • Support Packages
      • VAT Exemption / Tax ID
      • SMS Credits
      • Access Invoices
      • Unused time and Remaining time in Invoices (Prorations)
      • Codes
    • White Label
    • Rules
      • Legacy Rule Engine
        • Sending notifications via Telegram
      • New Rule Engine
        • Rule Engine Table Overview
        • Copy/Paste and Template Functionality
        • Advanced Rule Engine E-Mail and Webhook Templates
        • Time Restrictions
    • Zones
  • Cake Red
    • Get Started
    • Overview
  • LoRaWAN
    • Get Started
      • CSV Import
      • Custom LoRaWAN Device
    • Configuring LNS
      • The Things Stack (TTN / TTI) Automated Setup
      • The Things Stack (TTN / TTI) Manual Setup
      • Loriot
      • Kerlink Wanesy
      • Helium
      • ChirpStack
      • Tektelic
      • Actility ThingPark
      • Senet
      • Milesight Gateway
      • KPN
    • Downlinks (LoRaWAN)
      • Set Time Frame
    • Securing Webhooks
    • Payload Decoders
      • Location and GPS
      • Access Gateway Metadata
      • Access Measurements
      • Global Variables
    • Using Cayenne LPP
    • Converting Payload
  • Generic API Devices
    • HTTP Downlinks
  • Integrations
    • MQTT
    • Particle
      • Get Started
      • Adding Integrations
      • Decoding Payloads
      • Calling Functions
      • Templates
        • Particle Tracker One
    • Incoming Webhooks
    • Outgoing Webhooks
      • Securing Outgoing Webhooks in Datacake
    • Golioth
    • Blues Wireless Notecard
    • Sigfox
    • Swarm Asset Tracker
    • Grandcentrix Modbus Cloud Connect
    • YuDash LYNX IoT Gateway
    • Dragino NB-IoT
      • Changing NB-IoT Bands
    • Hardwario CHESTER
    • 1NCE OS
  • API
    • Exporting Data
    • Record Measurements via API
    • Node RED to Datacake
    • Generate Access Token
    • Internal MQTT
      • Get Started
      • MQTT Documentation
      • MQTT over WebSocket
      • Example Code
    • GraphQL API
      • Using GraphQL
      • Device Creation
      • Tutorials
        • Read Group via Tags
  • Guides
    • Python
    • Send Slack Notifications
    • Forward Data to Cake Red
    • Multiple Data Feeds
    • Automated Dynamic Downlinks
    • Ingesting JSON Data into Datacake API Devices
    • Working with Default HTTP Decoder on API Devices and Code Examples
    • Accessing Measurements in Decoders
    • Connecting Datacake to Notion Using Zapier
    • How to set up and use location on non-GPS devices
    • How to integrate with AWS IoT Core
    • How to Schedule Mass-Downlinks (Multicast) using Datacake Rule Engine
    • How to Map Sensor Values to Ranges or Booleans, Strings using Mapping Fields
    • Understanding Internal vs. External MQTT Brokers on Datacake
    • Sending UDP Messages between 1NCE OS and Datacake
    • Concepts of LoRaWAN Payload Decoders on Datacake
    • How to check if a value stays above or below limits for given time
Powered by GitBook
On this page
  • Introduction
  • Internal MQTT Broker
  • Overview
  • Features
  • Topic Structure
  • Topic Elements
  • Examples
  • Use Case
  • More Information
  • External MQTT Brokers
  • Overview
  • Features
  • Use Case
  • More Information
  • Summary

Was this helpful?

  1. Guides

Understanding Internal vs. External MQTT Brokers on Datacake

When to use internal vs. external MQTT brokers on Datacake. What are the pro and cons?

Introduction

Datacake offers two primary MQTT broker options for users to manage and ingest data: the internal MQTT broker (mqtt.datacake.co) and external MQTT brokers through a third-party MQTT bridge. This document details the features, limitations, and usage of both options to help users select the appropriate broker based on their needs.

Internal MQTT Broker

Overview

The internal MQTT broker is tightly integrated with the Datacake backend and is primarily used for real-time communication between the backend and dashboards. It allows direct data ingestion into Datacake's database and supports user authentication.

Features

  • Real-time Communication: Enables real-time updates between Datacake's backend and dashboards.

  • Direct Database Integration: Ingests data directly into Datacake's database fields.

  • Fixed Topic Structure: Utilizes a fixed topic structure for consistency and security.

  • User Authentication: Requires user authentication for publishing and subscribing.

Topic Structure

Subscribe

To receive messages via MQTT when readings arrive in the Datacake Cloud, subscribe using the following structure:

dtck/<product_slug>/<device_id>/<field_name>

Messages are published whenever there is a change to the corresponding database field.

Publish

To upload data into the Datacake Cloud and a specific device, publish to:

dtck-pub/<product_slug>/<device_id>/<field_name>

Note: Always use the prefix dtck-pub/ to import measured values.

Topic Elements

  • Product-Slug (<product_slug>): Specifies the product path. This is useful for managing multiple devices of the same product type. The specification can be found in the metadata section of the device view.

  • Device-ID (<device_id>): Identifies a specific device. This ID is a unique UUID and can be found in the device metadata or URL.

  • Field-Name (<field_name>): The field name of the measured value as it appears in the database. Use uppercase for consistency.

Examples

Subscription

Subscribe to all measurements of a specific device:

dtck/my-product/6b98a3bb-9ae1-418f-9375-f23091a849cd/+

Subscribe to all temperature measurements of all devices under a product:

dtck/my-product/+/TEMPERATURE

Publish

Publish a temperature measurement to a specific device:

publish("dtck-pub/my-product/6b98a3bb-9ae1-418f-9375-f23091a849cd/TEMPERATURE", 22.003)

Use Case

The internal broker is ideal for users needing fast, secure, and real-time data ingestion directly into the Datacake database, with the limitation of a fixed topic structure and single measurement messages.

More Information

External MQTT Brokers

Overview

The external MQTT brokers provide more flexibility for users needing custom topics and the ability to send multiple measurements in a single message.

Features

  • Custom Topics: Users can define their own topics.

  • Multiple Measurements: Supports sending multiple measurements in a single message, including JSON format.

  • Payload Decoders: Utilizes payload decoders for processing subscriptions from external brokers.

  • Third-Party Integration: Integrates with various third-party MQTT brokers.

Use Case

The external broker is suitable for users requiring flexible topic structures, complex payloads, or integration with third-party systems.

More Information

Summary

Feature
Internal MQTT Broker
External MQTT Brokers

Real-time Communication

Yes

Depends on third-party broker

Direct Database Integration

Yes

No

Fixed Topic Structure

Yes

No

Custom Topics

No

Yes

Multiple Measurements

No

Yes

Payload Decoders

No

Yes

User Authentication Required

Yes

Depends on third-party broker

Performance

Fastest

May vary

Use Case

Direct database ingestion, real-time status updates

Flexible topic structure, complex payloads, third-party integration

This guide should assist users in understanding the differences between the internal and external MQTT brokers provided by Datacake, helping to choose the right broker based on specific needs.

Last updated 10 months ago

Was this helpful?

For detailed setup instructions, refer to the .

For detailed setup instructions, refer to the .

Datacake Internal MQTT Broker Documentation
Datacake External MQTT Broker Documentation