International Journal of Advance Research Publication and Reviews

International Journal of Advance Research Publication and Reviews
Peer-Reviewed | Multi-Disciplinary Journal

Python Web Frameworks: A Review of Architecture, Performance, Scalability, and Development Features

Author

Dr. D. Richard, Francis Xaviar J

Abstract

 Python is one of the most widely used languages for building web applications and back-end services, and its ecosystem offers several mature web frameworks with very different design philosophies. This work presents a review and an empirical comparison of three of the most popular ones: Flask, a lightweight micro-framework; Django, a full-stack "batteries-included" framework; and FastAPI, a modern asynchronous framework built on the ASGI standard. The review part examines the architecture, request-handling model, and built-in development features of each framework. The experimental part implements an identical Task Manager REST API in all three frameworks and evaluates it under controlled conditions using the Locust load-testing tool. Throughput (requests per second), average and 95th-percentile latency, and memory consumption are measured at 50, 100, and 500 concurrent users and with 1, 2, and 4 server workers. Development effort is compared through lines of code, setup time, documentation quality, and available built-in features. The results are analysed to identify which framework best suits which class of application. In the sample results, FastAPI achieved the highest throughput and lowest latency, Django the lowest throughput but the richest set of built-in features, and Flask fell between them with the smallest memory footprint.


Keywords

Python, Flask, Django, FastAPI, WSGI, ASGI, web framework, REST API, performance benchmarking, scalability

Full Text:

Download Paper PDF

References

[1] Python Software Foundation, "asyncio — Asynchronous I/O," Python 3 Documentation. [Online]. Available: https://docs.python.org/3/library/asyncio.html

[2] R. T. Fielding, "Architectural styles and the design of network-based software architectures," Ph.D. dissertation, Dept. Inf. Comput. Sci., Univ. California, Irvine, CA, USA, 2000.

[3] P. J. Eby, "PEP 3333 — Python Web Server Gateway Interface v1.0.1," Python Enhancement Proposals, 2010. [Online]. Available: https://peps.python.org/pep-3333/

[4] "Gunicorn documentation." [Online]. Available: https://docs.gunicorn.org/

[5] "ASGI (Asynchronous Server Gateway Interface) specification." [Online]. Available: https://asgi.readthedocs.io/

[6] "Uvicorn documentation." [Online]. Available: https://www.uvicorn.org/

[7] Python Software Foundation, "Glossary: global interpreter lock," Python 3 Documentation. [Online]. Available: https://docs.python.org/3/glossary.html#term-global-interpreter-lock

[8] Pallets Projects, "Flask documentation." [Online]. Available: https://flask.palletsprojects.com/

[9] M. Grinberg, Flask Web Development: Developing Web Applications with Python, 2nd ed. Sebastopol, CA, USA: O’Reilly Media, 2018.

[10] Django Software Foundation, "Django documentation." [Online]. Available: https://docs.djangoproject.com/

[11] "Django REST framework." [Online]. Available: https://www.django-rest-framework.org/

[12] S. Ramírez, "FastAPI documentation." [Online]. Available: https://fastapi.tiangolo.com/

[13] "Starlette." [Online]. Available: https://www.starlette.io/

[14] "Pydantic documentation." [Online]. Available: https://docs.pydantic.dev/

[15] OpenAPI Initiative, "OpenAPI Specification." [Online]. Available: https://spec.openapis.org/oas/latest.html

[16] B. Lubanovic, FastAPI: Modern Python Web Development. Sebastopol, CA, USA: O’Reilly Media, 2023.

[17] "SQLAlchemy documentation." [Online]. Available: https://docs.sqlalchemy.org/

[18] TechEmpower, "TechEmpower Framework Benchmarks." [Online]. Available: https://www.techempower.com/benchmarks/

[19] "Locust documentation." [Online]. Available: https://docs.locust.io/

 

 

Top