Redevil10 / fastapi-jwt

FastAPI with JWT authentication demo
0 stars 0 forks source link

How to handle multiple fast API apps #3

Open kean-fetchpet opened 1 year ago

kean-fetchpet commented 1 year ago

Hey @Redevil10, how would you change the structure to allow for multiple fast API apps , therefore multiple app engines/cloud runs? And how would you create a centralised api access permissions? I.e. some apps are available for some sources not but other sources etc? Thanks.

Redevil10 commented 1 year ago
  1. Do you really need multiple FastAPI apps? There is a way to mount sub applications under one root app.
  2. For permission management, I found some examples [1, 2, auth0], need to dive deeper to understand the differences and find out which one meet the application requirements.
  3. There are many articles [1, 2, 3, 4] about pros and cons in Microservices vs Monolithic architecture. The complexity of managing multiple services multiplies as the number of microservices grows, should take these into consideration when deciding which way to go for a small team.
    • multiple source repos: is it easy to reuse code, debug and test locally
    • mulitiple deployments: multiple cicd pipelines, dependency between services, the order of serivces release roll out matters
    • multiple cloud infrastructure: cost, at least one instance per microservice per environment, possible underutilise resources if not enough traffic. Also communicating between services.
    • monitoring: setup alerts, check logs, errors, and try to reproduce