# The Impact of Cloud Versus Local Infrastructure on Automatic IoT-Driven Hydroponic Systems
## 4 Discussion  
The comparative analysis of the AFCI and the LSI has shown that, from a hardware perspective, the two systems are identical, featuring the same monitoring and control components. The two approaches' hardware infrastructure uses the same equipment for monitoring and controlling the hydroponic system. The main hardware components include the M5 Stack unit for data acquisition and transmission, the DS18B20 sensor (for measuring liquid temperature), DHT22 (for ambient temperature and humidity), FC-28 (for liquid electrical conductivity), and SEN18 (for water level).  
The hardware element ensuring the automation of the liquid feeding process for the container is controlled by the process computer, represented by a compact HP PC. Both AFCI and LSI use the same hardware infrastructure. The differences between AFCI and LSI arise at the software functionality level. In AFCI, this computer runs a cron job that checks a flag in the cloud database to activate the irrigation pump. In the case of LSI, the PC equipment has a more complex role, managing both the database and the Web application. At the same time, it executes the cron job that controls the pump activation.  
Regarding communication, AFCI uses the MQTT protocol to send data to the cloud, while LSI uses HTTP to send requests to the local server. Thus, although the equipment used is identical, the differences between AFCI and LSI appear at the software and data management levels.  
Significant differences emerge at the level of software infrastructure and data management. In the case of AFCI, the M5 Stack unit sends data to Azure IoT Hub as a JSON object. This message is picked up by the Azure Stream Analytics service, which processes and stores it using the SQL database managed on Azure. A major challenge of this method is understanding Azure services, their compatibility, optimal configuration to avoid high costs, and programming at the code level when necessary. Programming is performed in Arduino IDE, and interaction with Azure requires knowledge of SQL, JSON, and Azure development.  
In contrast, LSI uses a different software approach. The data is sent from the M5 Stack to a local API implemented in C# and ASP:NET MVC 5, which runs on a local web server based on IIS. This method allows greater autonomy over the software infrastructure but presents security risks since the information is transmitted via a URL accessible within the internal network. A vulnerability is the possibility of unauthorized users who know the URL structure inserting false data. For data flow management, in the case of LSI, Windows Task Scheduler runs a local cron job that checks the database and activates the irrigation pump when necessary. This is a cost-effective, free solution, but the local PC must always be turned on to ensure continuous operation.  
The tests have shown that the AFCI infrastructure offers a longer response time than LSI. Additionally, AFCI comes with higher operational costs. On the other hand, the LSIsolution presents the advantage of total control over data, with reduced long-term costs, but involves greater complexity in managing the local infrastructure and dependency on proprietary hardware resources. Furthermore, the tests highlighted that data security is more straightforward to ensure in the case of AFCI. At the same time, LSI requires the development of custom security layers, which cannot match the Microsoft security services developed and tested by large teams of programmers and testers.