# A Set of Tools and Data Management Framework for the IoT-Edge-Cloud Continuum
## 3 Data Management Framework
### The Backbone  
As the backbone for operation at any level of the IECC, a Message Queuing Telemetry Transport (MQTT) [18] broker was chosen. MQTT is a lightweight publish-subscribe protocol ideal for constrained devices and low-bandwidth, high-latency, or unreliable networks, as demonstrated by [19; 20]. Commonly used in IoT applications for efficient device communication, MQTT operates over TCP/IP and uses a broker to manage message distribution between clients. The key features of MQTT are minimal network bandwidth usage, efficient message delivery, and support for a range of quality of service (QoS) levels to ensure message reliability, which is used in the IECC DMT as a powerful, reliable, yet lightweight communication channel. The Mosquito by the Eclipse Foundation was chosen as the optimal MQTT broker because it is (i) open-source and available at no cost; (ii) lightweight and efficient, ideal for resource-constrained devices like embedded systems and IoT devices; (iii) compatible with various platforms including Linux, Windows, MacOS, and many Unix-like systems, offering deployment flexibility; (iv) supports TLS for secure communications and provides various authentication and authorization mechanisms to safeguard the broker and its data; (v) capable of managing a large number of connections, making it scalable for larger implementations; and (vi) includes a plugin system for adding custom functionality, which is beneficial for specialized applications or integrations, making it well suited for the IECC DMT implementation. To enable the MQTT broker to function as a central backbone tool, modifications were made to grant complete control over message passage for applications that can be loaded externally, from the perspective of the MQTT broker. This was carried out with the functionality of plugins natively available to the Mosquito broker. For the most suitable programming language for plugins, we choose Python because of its versatility. As Mosquito only allows for plugins to be written in the C programming language, the middleware in C was created to allow dynamic Python-based plugin loading, which will be handled by the plugin manager. The plugin manager in turn serves as the static entry point for the native Mosquito broker plugin, written in C.  
To provide extendable software support to the user, a plugin system is used, where different plugins can co-exist and provide distinct functionalities where needed. Each plugin has a separate configuration written in YAML syntax, and it can be customized differently for each separate deployment within the system. All necessary data processing is performed via a plugin interaction, where the interaction can be logged, configured, and monitored. The architecture is structured around an MQTT broker that serves as a core component of the system, and each data processing node operates its own instance of the broker. Every instance features an input topic, and all nodes, except for the root node, have an output endpoint that links to the input topic of another node, as is visible in Figure 2. This configuration creates a tree structure, with the upper layers representing the cloud infrastructure and the lower layers being closer to the IoT devices. At each node, user-defined plugins process incoming data in a specific sequence based on node-specific configurations. This setup facilitates a seamless data flow from the IoT layer, where data are collected, all the way to the Cloud layer, where it is stored. Data streams within an IECC environment are divided into two categories: 'user' and'system'. This categorization enhances the management of data and boosts operational efficiency across nodes. Information generated and utilized by client applications is referred to as user data streams. These streams typically involve the following:  
* User inputs: information derived from user interaction with devices or applications, encompassing sensor data, commands, or user feedback.