0
0
Microservicessystem_design~12 mins

Feature toggles in Microservices - Architecture Diagram

Choose your learning style9 modes available
System Overview - Feature toggles

This system manages feature toggles to enable or disable features dynamically in a microservices environment. It allows safe rollout, testing, and rollback of features without redeploying services.

Architecture Diagram
User
  |
  v
Load Balancer
  |
  v
API Gateway
  |
  v
+-----------------+       +------------------+
| Feature Toggle   |<----->| Configuration DB |
| Service         |       +------------------+
+-----------------+
        |
        v
+-----------------+
| Microservice A   |
+-----------------+
        |
        v
+-----------------+
| Microservice B   |
+-----------------+
Components
User
client
End user or client making requests to the system
Load Balancer
load_balancer
Distributes incoming requests evenly across API Gateway instances
API Gateway
api_gateway
Entry point for client requests, routes to services
Feature Toggle Service
service
Manages feature toggle states and evaluates toggle rules
Configuration DB
database
Stores feature toggle configurations and rules
Microservice A
service
Business logic service that checks feature toggles before executing features
Microservice B
service
Another business logic service that uses feature toggles for conditional behavior
Request Flow - 11 Hops
UserLoad Balancer
Load BalancerAPI Gateway
API GatewayFeature Toggle Service
Feature Toggle ServiceConfiguration DB
Configuration DBFeature Toggle Service
Feature Toggle ServiceAPI Gateway
API GatewayMicroservice A
Microservice AMicroservice B
Microservice BMicroservice A
Microservice AAPI Gateway
API GatewayUser
Failure Scenario
Component Fails:Configuration DB
Impact:Feature toggle service cannot read toggle states, so toggles cannot be evaluated. Services may default to safe fallback (e.g., disable new features).
Mitigation:Use caching in Feature Toggle Service to serve recent toggle states. Implement DB replication and failover to reduce downtime.
Architecture Quiz - 3 Questions
Test your understanding
Which component is responsible for deciding if a feature is enabled or disabled?
ALoad Balancer
BAPI Gateway
CFeature Toggle Service
DMicroservice B
Design Principle
This architecture uses a dedicated Feature Toggle Service to centralize toggle management, enabling dynamic feature control without redeploying microservices. Caching and database replication improve availability and performance.