Cirrus Link frequently gets questions around Sparkplug and quality of service. Users want to understand how Sparkplug leverages MQTT, what QoS Sparkplug uses and why, and if there is the potential for data loss when using MQTT Sparkplug. Below we discuss Sparkplug's use of MQTT QoS 0, why this QoS was chosen and how we minimize potential data loss when using QoS 0.


Legend

Why do we use MQTT QoS 0 for Sparkplug Birth and Data messages? 

To summarize, data loss with QoS 0 messages can occur in the MQTT Keep Alive window when a connection fails ungracefully. To mitigate this risk, Sparkplug uses Primary Host Id, and MQTT Store and Forward at the edge with a rolling buffer*. This will not guarantee zero data loss, but it will provide the highest possibility of delivering high speed OT data at scale with a minimal possibility of data loss. 

*Rolling buffer is a Cirrus Link solution implemented on top of Sparkplug and is not in the Sparkplug spec currently.