English 中文(简体)
External Configuration
  • 时间:2024-11-03

External Configuration


Previous Page Next Page  

Problem Statement

Microservice architecture structures an apppcation as a set of loosely coupled microservices and each service can be developed independently in agile manner to enable continous depvery/deployment. These services often interacts with infrastructure services or 3rd party services.

Insfrastructure services may include a service registry, a message broker, database server. 3rd party services can be payment services, email services, messaging services. Apart from varying services, environments often vary. Consider the following cases −

    Configuration Data − Configurations to external/3rd party services should be provided to the micro services e.g. database credentials, network urls etc.

    Multiple Environments − There are often varying environments pke dev, qa, test, staging or pre-prod and production. A service should be deployed on each environments without any code modifications.

    Varying configuration data − Configurations to external/3rd party services also varies from dev to production e.g. dev databse to production database, test payment processor vs original payment processor services.

Solution

We can externapze all configurations from database credentials to network urls. Service will read the configuration data during startup e.g. from a properties file/ system environment variables or using command pne arguments. This pattern helps in deploying the microservices without any modification/recompilation needed.

Advertisements