Feature toggles are widely used in microservices architectures. What is their main purpose?
Think about how feature toggles help developers control features during runtime.
Feature toggles allow teams to turn features on or off dynamically, enabling safer deployments and testing without redeploying code.
In a microservices architecture, where should feature toggle states be stored and managed for consistency?
Consider how to keep toggle states consistent and easily changeable across many services.
A centralized configuration service ensures all microservices read the same toggle states, enabling consistent behavior and easier updates.
You have many microservices receiving thousands of requests per second. How should feature toggles be designed to avoid slowing down the system?
Think about reducing network calls and latency for each request.
Caching toggle states locally reduces network overhead and latency, while periodic refresh keeps toggles up to date without impacting performance.
Feature toggles help deploy features safely, but what is a common downside if toggles remain in code too long?
Consider how many toggles affect code readability and testing.
Keeping many toggles in code increases complexity and technical debt, making the system harder to maintain and test.
Each toggle state is stored as a boolean flag per microservice. Assuming each boolean uses 1 byte, estimate the total storage size in kilobytes (KB) needed to store all toggle states centrally.
Calculate total bytes as toggles × microservices × bytes per toggle, then convert to KB (1 KB = 1024 bytes).
1000 toggles × 50 microservices × 1 byte = 50,000 bytes ≈ 48.8 KB, rounded to approximately 50 KB.