# An IoT-Based Encapsulated Design System for Rapid Model Identification of Plant Development
## 4 Software Architecture
### Central Data Server  
The central data server is a local server that collects the telemetry data and status reports from multiple encapsulated design devices, archives the data, and conducts advanced data processing, such as experiment scheduling or executing tailored AI algorithms. After the initial data collection and pre-processing, the processed data is stored in a cloud-based NoSQL database where it is made available to third parties through a web API. The data is retrieved through the developed web API from the cloud service with a daily frequency and stored in the PostgreSQL database on the central data server. The server integrates the data from all the growing chambers and makes it available for advanced processing, i.e., modeling through the use of ML approaches. A set of obtained and stored measurements from one device amounts to 140 kilobytes of data per day. An exemplary snippet of such data is presented in Figure 9. If this logic is further extended to the planned two years of experiments with four separate chambers, the overall amount of collected data would be 140 \(\times\) 365 \(\times\) 2 \(\times\) 4 = 408,800 kB, or \(\sim\)408 MB. The raw measurements are accompanied with meta data containing information about devices, zones, and plants; however, since this is mostly static data, their memory allocation is negligible with respect to the collected measurements. Among the data collected from the chambers via the cloud service, multi-spectral camera images are obtained from the multi-spectral cameras once per day and are also stored on the central server computer. Through the processing of the obtained images, the vegetation indices presented in Table 2 are calculated and stored, thus rounding up the available data from the plant development side. Indices calculated from camera images amount to 1.5 kB per day, which amounts to a total of 1.5 \(\times\) 365 \(\times\) 2 \(\times\) 4 = 4380 kB, or \(\sim\)4 MB. The accompanying raw images are stored among the calculated indices, with average size of 2.3 MB. With three separate images stored (three light specters) for each of the eight plants within a single chamber, the overall amount of stored data is estimated to amount to 2.3 \(\times\) 3 \(\times\) 8 \(\times\) 365 \(\times\) 2 \(\times\) 4 = 161,184 MB, or \(\sim\)180 GB. The fetching of the chamber climate measurements to the cloud is performed in a range of milliseconds, while its daily collection through the web API and storage to the central server database takes an average of 3 s.  
Figure 9: Exemplary snippet of zone climate measurement data stored in the central data server PostgreSQL database. The capturing of multi-spectral images is performed in under 2 min, while their storage is performed in a range of milliseconds. A prolonged time of 2 min is necessary in order to rotate both the camera as well as the individual chamber towers such that separate images of each individual chamber zone/plant can be obtained. This is due to the significantly higher camera price than the device price, hence fewer cameras then devices are used in the process. The main reasoning behind the separation of device telemetry data cloud storage and central server storage is to facilitate the flexibility for the inclusion of more devices without the burden of the heavy numerical requirements generated by the data analysis algorithms, e.g., tuning of ML models. Additionally, ML algorithms as well as most other data analytic approaches, almost always require the entire historical dataset to be available, thus generating heavy database loads when they are fetched. By keeping the various data storage spaces separate, the cloud database queries are limited to one-day datasets such that the processing power of the cloud storage is preserved for serving clients and collecting the devices' telemetry data. Additionally, the computer cloud serves as a sophisticated data archive, providing backup of experimental data that has been accumulated over the years.