Comparative Evaluation of Flask and web2py for AI Microservices: An Empirical Benchmark on Model-Inference Workloads

Main Article Content

Oyetola Florence Idowu
Abolade David Omiyale
https://orcid.org/0000-0002-8146-8515

Abstract

Microservice-based deployments are increasingly used to serve AI models, but systematic empirical guidance on framework selection is limited. This paper presents a comparative evaluation of two Python frameworks (Flask 2.3.2 and web2py 2.24.1) for AI microservices through the implementation of a common AI Microservice Agent and controlled benchmarking. Experiments were run on Ubuntu 22.04 LTS with Python 3.10 on an Intel i7-12700 (16 GB RAM). The benchmark workload uses a logistic-regression inference task on a 10,000-row CSV dataset. It includes measurements of average latency (ms), throughput (requests/sec), peak memory (MB), CPU utilisation (%), and per-request computational time (ms). With under 100 concurrent clients, Flask achieved an average latency of 1.8 ms and a throughput of 556 req/s (peak memory ≈ usage 120 MB), while web2py recorded a latency of 4.2 ms and a throughput of 238 req/s (peak memory ≈ usage 280 MB). Results were stable across n = 10 repeated trials (95% CI reported in Section 4), and paired statistical tests confirm the observed performance differences (p < 0.01). We discuss trade-offs between rapid prototyping and production scalability, document reproducible setup details, and propose directions for expanding the benchmark to FastAPI, GPU workloads, and cloud-native orchestration.

Downloads

Download data is not yet available.

Article Details

How to Cite
[1]
O. F. Idowu and A. D. Omiyale, “Comparative Evaluation of Flask and web2py for AI Microservices: An Empirical Benchmark on Model-Inference Workloads”, AJERD, vol. 9, no. 1, pp. 12–27, Jan. 2026.
Section
Articles

References

Rusek, M. & Landmesser, J. (2018), Time complexity of a distributed algorithm for load balancing of microservice-oriented applications in the cloud, ITM Web Conference, 21, 00018, doi: 10.1051/itmconf/20182100018.

Di Francesco, P., Lago, P. & Malavolta, I. (2019), Architecting with microservices: A systematic mapping study, Journal of Systems and Software, 150, 77–97, doi: 10.1016/j.jss.2019.01.001.

Dai, F., Liu, G., Xu, X., Mo, Q., Qiang, Z. & Liang, Z. (2022), Compatibility checking for cyber-physical systems based on microservices, Software Practice and Experience, 52(11), 2393–2410, doi: 10.1002/spe.3131.

Fawad, E. (2023), Efficient workload allocation and scheduling strategies for AI-intensive tasks in cloud infrastructures, Pakistan Science and Technology, 47(4), 82–102, doi: 10.52783/pst.160.

Rajendran, R.M.R. (2022), Cross-platform AI development – A comparative analysis of .NET and other frameworks, International Journal of Multidisciplinary Research, 4(6), doi: 10.36948/ijfmr.2022.v04i06.13407.

Sharma, K., Salagrama, S., Parashar, D. & Chugh, R. (2024), AI-driven decision making in the age of data abundance: Navigating scalability challenges in big data processing, Revue d’Intelligence Artificielle, 38(4), 1335–1340, doi: 10.18280/ria.380427.

Lin, C., Huang, A. & Yang, S. (2023), A review of AI-driven conversational chatbots implementation methodologies and challenges (1999–2022), Sustainability, 15(5), 4012, doi: 10.3390/su15054012.

Odeh, A., Odeh, N. & Mohammed, A. (2024), A comparative review of AI techniques for automated code generation in software development: Advancements, challenges, and future directions, TEM Journal, 13(1), 726–739, doi: 10.18421/TEM131-76.

Bai, L. & Zhang, C. (2023), Trace-based microservice anomaly detection through deep learning, Proceedings of SPIE 12506, International Conference on Computer Vision, Image and Deep Learning, doi: 10.1117/12.2674784.

Auer, F., Lenarduzzi, V., Felderer, M. & Taibi, D. (2021), From monolithic systems to microservices: An assessment framework, Information and Software Technology, 137, 106600, doi: 10.1016/j.infsof.2021.106600.

Ntentos, E., Zdun, U., Plakidas, K., Meixner, S. & Geiger, S. (2020), Assessing architecture conformance to coupling-related patterns and practices in microservices, Microservices: Science and Engineering, 3–20, doi: 10.1007/978-3-030-58923-3_1.

Hasselbring, W., Wojcieszak, M. & Dustdar, S. (2021), Control flow versus data flow in distributed systems integration: Revival of flow-based programming for the industrial internet of things, IEEE Internet Computing, 25(4), 5–12, doi: 10.1109/MIC.2021.3053712.

Söylemez, M., Tekinerdogan, B. & Tarhan, A. (2022), Challenges and solution directions of microservice architectures: A systematic literature review, Applied Sciences, 12(11), 5507, doi: 10.3390/app12115507.

Aksakallı, İ., Çelik, T., Can, A. & Tekinerdogan, B. (2021), A model-driven architecture for automated deployment of microservices, Applied Sciences, 11(20), 9617, doi: 10.3390/app11209617.

Laigner, R., Zhou, Y., Salles, M.A.V., Liu, Y. & Kalinowski, M. (2021), Data management in microservices, Proceedings of the VLDB Endowment, 14(13), 3348–3361, doi: 10.14778/3484224.3484232.

Moreschini, S. et al. (2025), AI techniques in the microservices life-cycle: A systematic mapping study, Computing, 107(4), doi: 10.1007/s00607-025-01432-z.

Alelyani, A., Datta, A. & Hassan, G. (2024), Optimizing cloud performance: A microservice scheduling strategy for enhanced fault-tolerance, reduced network traffic, and lower latency, IEEE Access, 12, 35135–35153, doi: 10.1109/ACCESS.2024.3373316.

Aydemir, F. & Başçiftçi, F. (2024), Performance and availability analysis of API design techniques for API gateways, Arabian Journal for Science and Engineering, doi: 10.1007/s13369-024-09474-9.

Ziyatbekova, G., Aralbayev, S. & Kisala, P. (2023), Security issues of containerization of microservices, KazUTB Journal, 4(21), doi: 10.58805/kazutb.v.4.21-198.

Chen, C. & Liu, C. (2021), Person re-identification microservice over artificial intelligence internet of things edge computing gateway, Electronics, 10(18), 2264, doi: 10.3390/electronics10182264.

Megargel, A., Shankararaman, V. & Walker, D. (2020), Migrating from monoliths to cloud-based microservices: A banking industry example, Advances in Information Systems Development, 85–108, doi: 10.1007/978-3-030-33624-0_4.

Aitlmoudden, O., Housni, M., Safeh, N. & Namir, A. (2023), A microservices-based framework for scalable data analysis in agriculture with IoT integration, International Journal of Interactive Mobile Technologies, 17(19), 147–156, doi: 10.3991/ijim.v17i19.40457.

Saucedo, A. & Rodríguez, G. (2024), Migration of monolithic systems to microservices using AI: A systematic mapping study, Proceedings of CIBSE 2024, 1–15, doi: 10.5753/cibse.2024.28435.

Miles, M. (2016), Using web2py Python framework for creating data-driven web applications in the academic library, Library Hi Tech, 34(1), 164–171, doi: 10.1108/LHT-08-2015-0082.

Hussein, S., Lahami, M. & Torjmen, M. (2023), Assessing the quality of microservice and monolithic architectures: Systematic literature review, Research Square, doi: 10.21203/rs.3.rs-3497708/v1.

Hassan, S., Bahsoon, R. & Buyya, R. (2022), Systematic scalability analysis for microservices granularity adaptation design decisions, Software Practice and Experience, 52(6), 1378–1401, doi: 10.1002/spe.3069.

Ramu, V.B. (2023), Performance impact of microservices architecture, Review of Contemporary Science and Academic Studies, 3(6), doi: 10.55454/rcsas.3.06.2023.010.

Kazanavičius, J., Mažeika, D. & Kalibatienė, D. (2022), An approach to migrate a monolith database into multi-model polyglot persistence based on microservice architecture, Applied Sciences, 12(12), 6189, doi: 10.3390/app12126189.

Beaulieu, N., Dascalu, S.M. & Hand, E. (2022), API-first design: A survey of the state of academia and industry, Proceedings of the International Conference on Information Technology – New Generations, 73–79.

Shadija, D., Rezai, M. & Hill, R. (2017), Towards an understanding of microservices, Proceedings of the International Conference on Advanced Computing, doi: 10.23919/IConAC.2017.8082018.

Hevner, A.R., March, S.T., Park, J. & Ram, S. (2004), Design science in information systems research, MIS Quarterly, 28(1), 75–105, doi: 10.2307/25148625.

Gregor, S. & Hevner, A.R. (2013), Positioning and presenting design science research for maximum impact, MIS Quarterly, 37(2), 337–355, doi: 10.25300/MISQ/2013/37.2.01.

Merkel, D. (2014), Docker: Lightweight Linux containers for consistent development and deployment, Linux Journal, 2014(239), 2.

Petrucci, A., Massari, L. & Santucci, G. (2022), Web application performance benchmarking methodologies, Journal of Systems and Software, 182, 111078, doi: 10.1016/j.jss.2021.111078.

Buyya, R., Calheiros, R.N. & Li, X. (2018), High Performance Cloud Computing: Metrics and Benchmarks, Springer, doi: 10.1007/978-3-319-77434-1.