Skip to main content

Choose a transport

Transport choice is a deployment decision. MAGPIE keeps the application model stable, but latency, routing, reliability, network reachability, and infrastructure still differ.

ZeroMQMQTTWebRTC
TopologyDirect socketsBrokeredPeer-to-peer after signaling
Best fitLAN, localhost, controlled networksFleet/cloud, NAT, fan-outLow-latency internet data and media
InfrastructureNoneMQTT brokerSignaling; STUN/TURN as needed
Streaming✓✓✓
RPC✓✓✓
Native media tracks——Python and browser
Browser—MQTT over WebSocket✓
Python✓✓✓
C++✓OptionalOptional
TypeScript—✓Browser

A practical decision tree​

  • Start with ZeroMQ for a local Python/C++ system with fixed endpoints.
  • Start with MQTT for remote robots, fleets, browser dashboards, or services behind NAT.
  • Add WebRTC when peer-to-peer latency, bandwidth, or native audio/video tracks matter.
  • Use MQTT or HTTP only for WebRTC signaling when you do not want brokered data in the hot path.

Switching transports​

Switching normally changes connection construction and concrete class names. Topic names, payloads, handler logic, schemas, and application flow should remain stable. Treat a transport change as a deployment change and retest delivery semantics, timeouts, reconnection, and security.