# The Impact of Cloud Versus Local Infrastructure on Automatic IoT-Driven Hydroponic Systems
## 3 Results
### Software Comparison Infrastructure Between AFCI and LSI
#### 3.2.2 Software Infrastructure of the LSI  
The data acquired from the M5 Stack device is transmitted to the database through an API implemented in the C# language using the ASP.NET MVC 5 framework. This API is a Web application that runs on a local server, which is represented by a PC equipped with the Windows 10 operating system. Internet Information Services (IIS) supports web applications. IIS is configured to handle HTTPS requests coming from the M5 Stack device. In the case of LSI, the M5 Stack makes the API request via localhost, which is designed as follows: https://localhost:44330/Home/ReceiveData?tempDS18B20=22.5&tempDHT2=23.1&humDHT22=60&soilMoist=99&waterLevel=82 (accessed on 10 February 2025). This web address can be accessed only by users from the same network as the server which hosts the applications. This API request is a URL that transmits the data received by the M5 Stack to a database using the parameters in the URL. Consequently, the URL is structured to transmit key-value parameters containing information about the state of the hydroponic system. The temperature recorded by the DS18B20 sensor is 22.5 \({}^{\circ}\)C, the ambient temperature detected by the DHT22 sensor is 23.1 \({}^{\circ}\)C, and the relative humidity of the air measured by the DHT22 sensor is 60%. The electrical conductivity value is 99%, and the water level in the reservoir is 82%. This approach can be disadvantageous from the perspective of parameter visualization through the URL. Anyone connected to the internal network who knows this URL construction method could add fake data to sabotage the hardware infrastructure. The script running on the process computer is identical for AFCI and LSI. This script checks in a table whether the value in the column associated with the pump is 1 or 0. A value of 1 indicates the need to start the pump. For this purpose, the script will send a command to the pump's corresponding installation, and subsequently, it will set the value to 0. The value will be modified later when the plant's optimal development conditions are no longer met. This value is set by the output of the ML service, which is not the subject of study of the present article. A detailed analysis of this issue will be presented in a subsequent article, which is expected to be published within a maximum of one month. Beyond the hardware functionality, the conjobs ensure the pipeline's operation. The difference between a local conjob and an Azure one through Stream Analytics lies in the financial resources. A locally set conjob via Windows Task Scheduler is a free resource, whereas Azure Stream Analytics charges hourly based on the resource group to which it belongs. The configuration for each service also changes the monthly costs. The cost analysis for the Microsoft Azure service used for processing and storing data from the hydroponic system outlines that the most considerable cost comes from the hydroponic import job, the Stream Analytics job, which generated a cost of EUR 8.40 per day. Other services, such as IoT Hub (m5 stackInstance) and SQL Server (hydro server/hydroponicdb), did not incur significant costs on the same day. When comparing this solution with the local implementation, referred to as LSI, which uses Task Scheduler in Windows, there are advantages and disadvantages for each approach:Costs:
* Azure Stream Analytics is relatively expensive because it processes real-time data and uses paid cloud resources;
* Task Scheduler is free and runs locally on the PC, eliminating cloud infrastructure-related costs. * Complexity:
* Configuring a Stream Analytics job requires integration with IoT Hub, SQL Server, and other Azure services, which can be highly complex for users without experience;
* Task Scheduler runs the script locally for data processing and storage, making it much simpler to configure and not requiring an experienced programmer. This directly impacts the financial resource.