0
0
Microservicessystem_design~12 mins

Why externalized config enables flexibility in Microservices - Architecture Impact

Choose your learning style9 modes available
System Overview - Why externalized config enables flexibility

This system shows how externalized configuration helps microservices stay flexible and easy to update. Instead of hardcoding settings inside each service, configs are stored outside and loaded at runtime. This allows changing settings without restarting or redeploying services, supporting dynamic updates and environment-specific configs.

Architecture Diagram
User
  |
  v
Load Balancer
  |
  v
API Gateway
  |
  v
+-------------------+       +---------------------+
| Config Server      |<----->| Microservice A       |
| (Externalized Config) |       |                     |
+-------------------+       +---------------------+
                                |
                                v
                         +--------------+
                         | Database     |
                         +--------------+
Components
User
client
Sends requests to the system
Load Balancer
load_balancer
Distributes incoming requests evenly to API Gateway instances
API Gateway
api_gateway
Routes requests to appropriate microservices
Config Server
config_server
Stores and serves configuration data externally to microservices
Microservice A
service
Handles business logic and loads config from Config Server
Database
database
Stores persistent data for microservice
Request Flow - 8 Hops
UserLoad Balancer
Load BalancerAPI Gateway
API GatewayMicroservice A
Microservice AConfig Server
Microservice ADatabase
Microservice AAPI Gateway
API GatewayLoad Balancer
Load BalancerUser
Failure Scenario
Component Fails:Config Server
Impact:Microservices cannot fetch updated configuration, may continue running with cached config or default settings, risking outdated behavior
Mitigation:Use local config cache in microservices and replicate Config Server for high availability
Architecture Quiz - 3 Questions
Test your understanding
Why does Microservice A fetch configuration from the Config Server at runtime?
ATo improve network security
BTo reduce database load
CTo allow changing settings without redeploying the service
DTo speed up user requests
Design Principle
Externalizing configuration separates settings from code, enabling microservices to adapt dynamically to changes without redeployment. This improves flexibility, supports multiple environments, and simplifies updates.