# A Scalable Framework for Sensor Data Ingestion and Real-Time Processing in Cloud Manufacturing
## 5 Results
### Application Architecture
#### 5.3.1 Performance Evaluation for the Monolithic Application  
The monolithic application developed in Flask was designed to ingest, process, and store the temperature and humidity data. The application includes the following functionalities:  
* Data ingestion: the application reads the temperature_humidity_data.csv file using the Pandas library. * Data processing: real-time calculation of mean temperature and humidity values facilitates immediate data analysis. * Performance measurement: response times for data processing requests are tracked and integrated into the data processing function, with results returned in JSON format, allowing for easy client-side consumption. Performance testing was conducted with Locust under user loads from 100 to 10,000 with Table 3, showing the obtained performance metrics. Algorithms A7 and A8 detail the core functionalities of the monolithic application and load testing scripts, respectively, providing insights into the system's performance under varying loads. The microservice architecture was designed to prioritize scalability and flexibility with independent deployment of each service. The following innovations are implemented to optimize performance (see Algorithms A9-A15). * Modular microservice design: each service (ingesion, processing, and storage) functions independently, promoting scalability and flexibility within the system. * Integration of Flask with data processing: Flask is used for data ingestion and processing, supporting real-time responses and improving application responsiveness. * Dynamic data processing: the system dynamically calculates mean temperature and humidity values, enabling immediate data analysis and insights. * Performance measurement: real-time response tracking is incorporated into data processing functions, providing feedback on performance impacts directly within the application. * Error handling: robust error-handling mechanisms ensure graceful failure management, enhancing the application's reliability. * Realistic load simulation: Locust simulates user behavior with varying loads and dynamic wait times, mimicking real-world interactions for accurate performance measurement. * Flexible session management: the application dynamically manages user sessions, offering a comprehensive understanding of user interactions during testing. * Real-time performance metrics: metrics are gathered during load tests, delivering immediate insights into potential bottlenecks and system performance under stress. * Kubernetes deployment: the architecture is deployed on Kubernetes, supporting high availability and scaling of microservices. The performance metrics, particularly in terms of throughput for 10,000 user counts, as depicted in Figure 6, demonstrate higher values for the three microservices compared \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Service** & **User Count** & **Average Response Time (ms)** & **Throughput (Requests/s)** & **Total Requests** \\ \hline Ingestion & 100 & 34.90 & 32.46 & 19,388 \\ Ingestion & 1000 & 3.65 & 329.48 & 197,354 \\ Ingestion & 10,000 & 11,846.57 & 607.43 & 366,940 \\ \hline Processing & 100 & 1.94 & 32.92 & 19,670 \\ Processing & 1000 & 5.07 & 329.95 & 197,656 \\ Processing & 10,000 & 10,608.47 & 677.91 & 407,950 \\ \hline Storage & 100 & 1.92 & 33.10 & 19,770 \\ Storage & 1000 & 5.27 & 330.09 & 197,786 \\ Storage & 10,000 & 10,488.53 & 687.86 & 413,726 \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Performance metrics for the microservices architecture. \begin{table}
\begin{tabular}{c c c c} \hline \hline
**User Count** & **Average Response Time (ms)** & **Throughput (Requests/s)** & **Total Requests** \\ \hline
100 & 223.68 & 44.31 & 13,239 \\
1000 & 9372.87 & 82.66 & 24,775 \\
10,000 & 23,086.79 & 336.61 & 102,972 \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Performance metrics for the monolithic application.