# The Impact of Cloud Versus Local Infrastructure on Automatic IoT-Driven Hydroponic Systems
## 3 Results
### Metrics Results for Performance Comparison Between AFCI and LSI
Based on these considerations, both infrastructures receive one point in Table 2 for the proposed infrastructure's flexibility and scalability. Regarding the DA indicator, the tests confirmed both hypotheses DA-H1 and DA-H2:  
* For AFCI, global data accessibility is advantageous. Figure 11 lists data from the database stored in the cloud. This database can be accessed from anywhere;
* For LSI, access is limited to the local network only. Therefore, AFCI allows the system to be monitored from any location, an advantage for distributed farms. At the same time, LSI can operate autonomously, but the lack of remote access is a limitation. Based on these considerations, in Table 2, AFCI is awarded one point, while LSI receives 0, as it is inferior to AFCI from the perspective of DA. For AFCI, DS is advanced, with no risk of unauthorized access. The way data is sent by the M5 Stack is primarily secured through the MQTT protocol, which uses SAS 2023 (Shared Access Signature) data encryption mechanisms. In addition, communication between the M5 Stack device and the cloud infrastructure is carried out via an encrypted channel using SAS encryption mechanisms, which ensure connection security. SAS encryption  
Figure 11: Global Data Access Demonstration for AFCI. generates a temporary shared access signature with a session-specific authentication token. This approach ensures that only authorized entities can communicate with Azure services, thus restricting cloud resource access to specific periods and restricting permissions. SAS tokens are generated based on a shared secret known only to Azure and the client device, eliminating any possibility of interception or identity spoofing. Figure 12 presents a screenshot that enabled the generation of the SAS for 24 h from the corresponding Azure Bash interface. Figure 12 presents the Shared Access Policies section for m5 StackInstance. The access policies can be observed in the upper part of the image, each having specific permissions such as Registry Read, Registry Write, Service Connect, and Device Connect. These permissions control how devices and services can interact with the IoT Hub. The command in the lower part of the image generates a SAS for the access policy named cosminaSAS. This custom access policy provides a security token to control access to Azure resources without exposing the primary or secondary access keys. Furthermore, Azure IoT Hub, which serves as the entry point for data in the cloud infrastructure, uses SAS to manage device-level access. Each device, including M5 Stack, receives a unique SAS key to generate temporary authentication tokens. The M5 Stack also uses the primary access key of the IoT Hub service, which is securely stored. As a result, data transfer is triple-secured through the MQTT protocol, SAS, and the primary key of the service. Regarding LSI, no security measures are in place unless they are explicitly implemented. Furthermore, anyone who knows the URL can add data through URL parameters. These parameter values are directly inserted into the database. Therefore, assuming someone sets the liquid level to 0 via the URL, the system will trigger the pump activation, even if it is unnecessary. Figure 12: Shared Access Policies for m5 StackInstance in Azure IoT Hub. In summary, AFCI excludes the risks of cyberattacks, while LSI requires protection measures to be implemented from scratch. In correlation with OC, it follows that securing LSI may introduce additional costs. Based on these considerations, one point will be added for AFCI and zero points for LSI in Table 2. The results confirm the two initial hypotheses, DS-H1 and DS-H2. By analyzing Table 2, it can be observed that LSI is superior in terms of RT, OR, OC, and IC. AFCI is superior in terms of DA and DS. Both infrastructures are equal regarding CS. Based on these considerations, an LSI-type infrastructure is sufficient when the scales are specific to a single building for modeling the challenges of hydroponic systems.