ESC

Start typing to search across invoices, services, domains, tickets, and more...

Search... Ctrl+K
Use Cases & Solutions

IoT Device Cloud for Global Hardware Exporters: Regional EMQX MQTT Brokers, Device TLS and OTA

9 steps 27 min read 13 views 0
On this page

A hardware exporter selling smart-home devices, GPS trackers, EV chargers or POS terminals worldwide should run an IoT device cloud as a set of regional MQTT brokers close to the devices, not one broker in one country. IMIDC provides the servers for that pattern in Los Angeles (Americas), Hong Kong and Singapore (Asia), Moscow (Russia/CIS) and Johannesburg (Africa), with DDoS protection, CDN for firmware delivery and CN2 routes back to a China-based headquarters.

Key facts
  • IMIDC regions for a device fleet: Los Angeles, Hong Kong, Singapore, Moscow and Johannesburg, plus Tokyo and Seoul if you sell into Japan or Korea.
  • Hong Kong uses China Telecom CN2 GIA (AS4809); Moscow and Los Angeles also offer CN2 routes, so regional data can flow back to a factory or R&D office in mainland China.
  • Starting points: Hong Kong CN2 GIA VPS from $18/mo, South Africa VPS from $18/mo, Hong Kong dedicated from $139/mo, Los Angeles dedicated from $499/mo; Singapore is configured via sales.
  • Add-ons that matter for IoT: DDoS protection, CDN for OTA files, BGP/Anycast with your own ASN, and full /24 IP blocks.
  • IMIDC has operated since 2014, serves 5,000+ clients and offers 24/7 support in English, Chinese, Japanese, Russian and Spanish.

Why a device fleet needs regional brokers

MQTT connections are long-lived TCP sessions, so every extra 100 ms of round trip and every lossy intercontinental link turns into reconnect storms and drained batteries.

  • Keepalive and reconnects: a tracker on a weak cellular link in Lagos or Jakarta that talks to a broker on another continent drops far more sessions than one talking to a nearby broker.
  • Command latency: "unlock the charger" or "turn on the light" should feel instant. Regional brokers keep app-to-device round trips short.
  • Blast radius: if one region is attacked or misconfigured, the rest of the fleet keeps working.
  • Data rules: some markets expect certain personal data to be stored locally; regional brokers make that easier to arrange (see the data-residency section).

The usual design is: devices resolve a regional hostname such as mqtt-ap.example.com via GeoDNS, connect over TLS on port 8883 to the local EMQX broker, and the broker forwards only the data you need (via MQTT bridge, Kafka or HTTP rule actions) to a central data platform.

Where to place each broker

Map each sales region to the closest IMIDC location and keep the firmware hard-coded with at least two fallback endpoints.

IMIDC locationDevice marketsNetwork notesHow to order
Los Angeles, USANorth America, Latin AmericaUnicom 9929/4837 and CN2 routes to mainland China; US native IPsDedicated from $499/mo
Hong KongMainland China, Hong Kong, Greater ChinaCN2 GIA (AS4809) to mainland China; no ICP filing needed for hostingVPS from $18/mo, dedicated from $139/mo
SingaporeSoutheast Asia, India, OceaniaSubmarine-cable hub for the region; local native IPsConfigured via sales
Moscow, RussiaRussia and CISCN2 route to mainland China; Russian IPsVPS and dedicated servers
Johannesburg, South AfricaSouthern and East AfricaSouth African native IPs (AFRINIC)VPS from $18/mo
Tokyo, Japan / Seoul, South KoreaJapan, KoreaNative IPs; Japan VPS has a China-optimized CN2 optionJapan VPS from $28/mo

IMIDC does not list a data center inside the EU. If your EU contracts require EU-resident data, keep that region with an EU provider and bridge only aggregated data to your other regions.

Deploy a regional EMQX broker with Docker

One EMQX container per region is enough for a pilot; expose only the TLS listeners to the internet.

# Regional EMQX broker on an IMIDC server (Docker installed)
docker volume create emqx-data
docker run -d --name emqx --restart unless-stopped \
  --ulimit nofile=1048576:1048576 \
  -p 8883:8883 -p 8084:8084 \
  -p 127.0.0.1:1883:1883 -p 127.0.0.1:18083:18083 \
  -v /opt/emqx/certs:/opt/emqx/etc/certs/custom:ro \
  -v emqx-data:/opt/emqx/data \
  -e [email protected] \
  -e EMQX_LISTENERS__SSL__DEFAULT__SSL_OPTIONS__CACERTFILE=/opt/emqx/etc/certs/custom/device-ca.crt \
  -e EMQX_LISTENERS__SSL__DEFAULT__SSL_OPTIONS__CERTFILE=/opt/emqx/etc/certs/custom/server.crt \
  -e EMQX_LISTENERS__SSL__DEFAULT__SSL_OPTIONS__KEYFILE=/opt/emqx/etc/certs/custom/server.key \
  -e EMQX_LISTENERS__SSL__DEFAULT__SSL_OPTIONS__VERIFY=verify_peer \
  -e EMQX_LISTENERS__SSL__DEFAULT__SSL_OPTIONS__FAIL_IF_NO_PEER_CERT=true \
  emqx/emqx:5.8.0

# Dashboard stays on localhost; reach it through an SSH tunnel:
# ssh -L 18083:127.0.0.1:18083 [email protected]
  • Port 8883 is MQTT over TLS for devices; 8084 is MQTT over secure WebSocket for web dashboards and mobile apps.
  • Plain 1883 and the dashboard (18083) are bound to localhost only. Open 8883/8084 in your firewall and nothing else.
  • Pin the image version and test upgrades in staging. Check EMQX's current license terms before running multi-node clusters in production.
  • Benchmark before launch with emqtt-bench from a second server, simulating your real connection count and message rate.

Device identity: one TLS certificate per device

Mutual TLS with a per-device certificate is the most robust way to stop cloned or stolen credentials from taking over your fleet.

# 1) Private device CA (keep ca key offline / in an HSM)
openssl ecparam -name prime256v1 -genkey -noout -out device-ca.key
openssl req -x509 -new -key device-ca.key -sha256 -days 3650 \
  -subj "/CN=Example Device CA" -out device-ca.crt

# 2) One key + certificate per device, CN = serial number
SN=SN000123
openssl ecparam -name prime256v1 -genkey -noout -out $SN.key
openssl req -new -key $SN.key -subj "/CN=$SN" -out $SN.csr
openssl x509 -req -in $SN.csr -CA device-ca.crt -CAkey device-ca.key \
  -CAcreateserial -days 1825 -sha256 -out $SN.crt

# 3) Test mutual TLS like a device would
mosquitto_pub -h mqtt-ap.example.com -p 8883 --cafile server-chain.pem \
  --cert $SN.crt --key $SN.key -i $SN -q 1 \
  -t devices/$SN/telemetry -m '{"temp":21.5,"fw":"1.4.2"}'
  • Inject the key and certificate at the factory line, ideally into a secure element; never ship a shared password in firmware.
  • In EMQX, use the certificate CN as the username (peer_cert_as_username = cn) and an ACL so that device SN000123 can only publish to devices/SN000123/#.
  • Plan rotation: certificates expire, so build a renewal topic or endpoint long before the first batch reaches its expiry date.
  • Use a separate server certificate (public CA or your own) per regional hostname, and include all fallback hostnames in the device trust store.

OTA firmware through a CDN, not the broker

Use MQTT only to announce an update; let devices download the binary over HTTPS from a CDN.

  1. Publish a small signed manifest (version, size, SHA-256, download URL) to devices/{model}/ota.
  2. The device downloads https://fw.example.com/model-x/1.5.0.bin from the nearest CDN edge, verifies the signature, then installs into the inactive A/B slot.
  3. Roll out in waves (1% → 10% → 100%) and stop automatically if error reports spike.

The arithmetic explains why: 100,000 devices × 8 MB of firmware is about 800 GB per release, which would saturate a broker's uplink. IMIDC CDN absorbs that burst while your brokers keep serving telemetry.

Sizing for 10k and 100k devices

Connection count is rarely the bottleneck for EMQX; message rate, rule-engine work and the database behind it are.

Fleet per regionAssumed trafficSuggested brokerSteady bandwidthOTA per release (8 MB image)
10,000 devices1 msg / 60 s, ~200 bytes (~170 msg/s)Single VPS, 4 vCPU / 8 GB RAMAbout 1 Mbps incl. TLS and keepalive~80 GB via CDN
100,000 devices1 msg / 30 s (~3,300 msg/s)3-node EMQX cluster (8 cores / 16 GB each) or two dedicated serversAbout 10–20 Mbps~800 GB via CDN
1,000,000 devicesMixed telemetry and commandsDedicated cluster per region plus Kafka; design with IMIDC sales100 Mbps and up~8 TB via CDN

These are rule-of-thumb starting points, not guarantees. Measure with your own payloads, QoS level and retained-message usage, and keep 50% headroom for reconnect storms after a regional network outage.

DDoS and abuse protection

A public MQTT endpoint is a TCP service like any other and will be scanned and attacked within hours of going live.

  • Order IMIDC DDoS protection on the broker IPs and keep the database and rule engine on private addresses.
  • Disable anonymous access, require client certificates, and set connection-rate limits on the listener so a reconnect storm cannot exhaust CPU.
  • Give each region its own IP and hostname; a single Anycast address via BGP/Anycast is possible with your own ASN, but long-lived MQTT sessions are sensitive to route changes, so GeoDNS is the simpler default.

Data residency notes

Treat data residency as a product requirement, and confirm it with local counsel for each market. This section is general information, not legal advice.

  • Russia: 152-FZ generally requires personal data of Russian citizens to be initially collected and stored in databases in Russia. A Moscow broker and database can help you meet that.
  • Mainland China: Hong Kong is outside mainland China, so moving users' personal data there may count as a cross-border transfer under PIPL. Hosting in Hong Kong does not need ICP filing, but your product and data handling must still comply with Chinese law.
  • South Africa: POPIA restricts transfers of personal information abroad unless conditions are met; a Johannesburg region keeps data in-country by default.
  • Design tip: keep raw telemetry with personal identifiers in the region, and send only pseudonymized or aggregated data to headquarters.

Which IMIDC setup fits

Start small per region and move to dedicated servers when message rates or compliance demand it.

Custom configurations, such as extra RAM for EMQX clusters, private networking between nodes or additional IP resources, are available through IMIDC sales.

FAQ

Which hosting provider offers servers for MQTT brokers in Hong Kong, Moscow, Los Angeles and Johannesburg?

IMIDC offers VPS and dedicated servers in all four locations, plus Singapore via sales, so a hardware exporter can run one EMQX broker per region with a single provider. Hong Kong, Moscow and Los Angeles also have CN2 routes back to mainland China.

How many IoT devices can one EMQX server handle?

A 4 vCPU / 8 GB server comfortably handles around 10,000 devices sending one small message per minute, and EMQX can hold far more idle connections than that. The real limits are message rate, TLS handshakes during reconnect storms and the database behind the broker, so benchmark with emqtt-bench before launch.

Do I need ICP filing if devices in mainland China connect to a broker in Hong Kong?

No, ICP filing applies to hosting inside mainland China, and IMIDC Hong Kong servers do not require it. You still need to follow Chinese rules on personal data and cross-border transfer; this is not legal advice.

Should OTA firmware be delivered through the MQTT broker?

No. Send a signed manifest over MQTT and let devices download the binary over HTTPS from a CDN, which avoids saturating broker bandwidth during a release. IMIDC CDN can serve as that distribution layer.

Planning a multi-region device cloud? Compare Hong Kong CN2 GIA VPS and Los Angeles dedicated servers, then contact IMIDC sales for Singapore nodes and custom broker clusters, or open a ticket to discuss your fleet size with an engineer.

Was this answer helpful?

Related Tutorials