Consider migration to FastAPI framework

We are currently using Flask v1 for policy service. As discussed in 2022/07/20 E&O dev meeting, there are a number of benefits for using FastAPI over Flask.

  • Data validation (via Pydantic), serialization and deserialization (for building an API)
  • Blazing performance over Flask
  • Async request capability
  • Automatic documentation (via JSON Schema and OpenAPI)

In addition, while lightweight and easy to use, Flask’s built-in server which we are using is not suitable for production as it doesn’t scale well and by default serves only one request at a time.

Edited by Shane Hutchins