Jump into concepts and practice - no test required
or
Recommended
Test this pattern10 questions across easy, medium, and hard to know if this pattern is strong
Recall & Review
beginner
What is traffic routing in microservices?
Traffic routing is the process of directing incoming requests to specific microservice instances or versions based on rules like URL path, headers, or user location.
Click to reveal answer
beginner
Explain traffic splitting in microservices.
Traffic splitting divides incoming requests between different versions or instances of a microservice, often used for gradual rollouts or A/B testing.
Click to reveal answer
intermediate
Why use traffic splitting during deployments?
It helps test new versions with a small user group, reduces risk of failures, and allows quick rollback if issues arise.
Click to reveal answer
intermediate
Name two common tools or technologies used for traffic management in microservices.
Service meshes like Istio and API gateways like Kong or NGINX are popular tools for routing and splitting traffic.
Click to reveal answer
intermediate
What is a canary deployment in the context of traffic management?
A canary deployment sends a small percentage of traffic to a new version to monitor its behavior before full rollout.
Click to reveal answer
What does traffic routing primarily depend on in microservices?
ARequest attributes like URL or headers
BDatabase schema
CCPU usage of microservices
DUser's screen resolution
✗ Incorrect
Traffic routing uses request attributes such as URL paths or headers to decide where to send requests.
Which scenario best describes traffic splitting?
ASending all traffic to one microservice version
BDividing traffic between multiple microservice versions
CBlocking traffic from unknown users
DEncrypting traffic between services
✗ Incorrect
Traffic splitting divides requests among different versions or instances.
What is the main benefit of canary deployments?
AGradual testing of new versions with limited users
BFaster database queries
CImproved UI design
DReducing server costs
✗ Incorrect
Canary deployments allow testing new versions with a small user group before full rollout.
Which tool is commonly used for traffic management in microservices?
ADocker Compose
BMySQL
CReact
DIstio
✗ Incorrect
Istio is a service mesh that helps manage traffic routing and splitting.
Traffic routing rules can be based on which of the following?
AOperating system version
BMicroservice memory size
CUser location
DTime of day only
✗ Incorrect
Routing can consider user location among other request attributes.
Describe how traffic routing and traffic splitting differ and how they work together in microservices.
Think about directing requests versus dividing requests.
You got /5 concepts.
Explain the benefits and risks of using traffic splitting during a microservice deployment.
Consider why splitting traffic helps and what could go wrong.
You got /3 concepts.
Practice
(1/5)
1. What is the main purpose of traffic routing in microservices architecture?
easy
A. To direct incoming requests to specific services based on rules
B. To store data persistently across services
C. To encrypt communication between services
D. To monitor service health and uptime
Solution
Step 1: Understand traffic routing
Traffic routing means sending requests to the right service based on rules like URL path or user type.
Step 2: Identify the main purpose
Routing helps control where requests go, ensuring they reach the correct microservice.
Final Answer:
To direct incoming requests to specific services based on rules -> Option A
Quick Check:
Routing = directing requests [OK]
Hint: Routing means sending requests to the right place [OK]
Common Mistakes:
Confusing routing with data storage
Thinking routing encrypts data
Mixing routing with monitoring
2. Which of the following is a correct way to define a traffic splitting rule in a service mesh configuration?
Traffic splitting uses weights to divide requests between service versions, e.g., 50% to v1 and 50% to v2.
Step 2: Identify correct syntax
split:
- weight: 50
service: v1
- weight: 50
service: v2 correctly assigns weights to services for splitting. Other options mix routing and splitting or have invalid weight placement.
But requests to /user/profile are not reaching user-service-v1. What is the likely problem?
medium
A. Service name is incorrect and causes failure
B. Weight should be split between multiple services
C. The path rule matches only exact /user, not subpaths like /user/profile
D. Routing rules cannot use path matching
Solution
Step 1: Analyze the path matching rule
The rule matches exactly /user, but /user/profile is a subpath and may not match unless wildcard or prefix matching is used.
Step 2: Identify why requests fail
Since /user/profile does not match exactly /user, requests do not route to user-service-v1.
Final Answer:
The path rule matches only exact /user, not subpaths like /user/profile -> Option C
Quick Check:
Exact path matching excludes subpaths [OK]
Hint: Exact path matches exclude subpaths unless wildcard used [OK]
Common Mistakes:
Assuming weight must be split
Blaming service name without checking
Thinking routing ignores paths
5. You want to gradually roll out a new version of a payment service to 10% of users while keeping 90% on the old version. Which traffic management strategy is best suited for this?
hard
A. Use routing based on URL path to send 10% of requests to new service
B. Use traffic splitting with weights 90% to old and 10% to new service
C. Deploy both versions without traffic control and monitor errors
D. Use a load balancer that randomly sends requests without weights
Solution
Step 1: Understand gradual rollout needs
Gradual rollout means controlling what percentage of users see the new version.
Step 2: Choose traffic management method
Traffic splitting with weights allows precise control of request percentages to each version.
Step 3: Evaluate other options
Routing by URL path cannot split traffic by percentage. Random load balancing lacks control. Deploying without control risks all users seeing new version.
Final Answer:
Use traffic splitting with weights 90% to old and 10% to new service -> Option B
Quick Check:
Splitting controls rollout percentages [OK]
Hint: Use weighted splitting for gradual rollout [OK]