Often services need to be run in different environments. Environment-specific configuration is required, such as secret keys, database credentials, and so on. Changing the service for each environment has a number of drawbacks. So how we can enable a service to run in multiple environments without modification?
Here comes the Externalized configuration pattern as this enables the externalization of all application configurations including the database credentials and network location.
For example, the Spring Boot framework enables externalized configuration, which allows you to read configuration from many sources and potentially change previously specified configuration settings based on the reading order. FastAPI, thankfully, has built-in support for externalized configuration.