0
0
Microservicessystem_design~20 mins

Correlation IDs in Microservices - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Correlation ID Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Purpose of Correlation IDs in Microservices

What is the main purpose of using correlation IDs in a microservices architecture?

ATo uniquely identify and trace a request as it travels through multiple microservices.
BTo encrypt data between microservices for security purposes.
CTo balance the load evenly across all microservices instances.
DTo store user session data centrally for all microservices.
Attempts:
2 left
💡 Hint

Think about how you can follow a single request across different services.

Architecture
intermediate
2:00remaining
Where to Generate Correlation IDs

In a microservices system, where is the best place to generate a correlation ID for a client request?

AAt the client side before sending the request.
BAt every microservice independently when processing the request.
COnly in the database when storing the request data.
DAt the first entry point or API gateway that receives the client request.
Attempts:
2 left
💡 Hint

Consider where the request first enters the system.

scaling
advanced
2:30remaining
Handling Correlation IDs in Asynchronous Messaging

How should correlation IDs be handled when microservices communicate asynchronously via message queues?

AInclude the correlation ID in the message headers so the receiving service can continue tracing.
BGenerate a new correlation ID for each message to avoid confusion.
CDo not use correlation IDs in asynchronous communication as they are only for HTTP requests.
DStore correlation IDs only in the database and not in messages.
Attempts:
2 left
💡 Hint

Think about how tracing continues across asynchronous boundaries.

tradeoff
advanced
2:30remaining
Tradeoffs of Using Correlation IDs in Logs

What is a potential tradeoff when including correlation IDs in every log entry across microservices?

AIncluding correlation IDs slows down the network communication between services.
BCorrelation IDs cause security vulnerabilities by exposing sensitive data.
CLogs become larger and may increase storage and processing costs.
DCorrelation IDs make logs unreadable and useless for debugging.
Attempts:
2 left
💡 Hint

Consider the impact on log size and storage.

estimation
expert
3:00remaining
Estimating Correlation ID Storage Impact

A microservices system processes 1 million requests per hour. Each request generates logs in 5 services, each log entry includes a 36-character UUID correlation ID. Estimate the additional storage needed per hour just for storing correlation IDs in logs, assuming each log entry stores only the correlation ID as a string (1 character = 1 byte).

AApproximately 36 MB per hour
BApproximately 180 MB per hour
CApproximately 720 MB per hour
DApproximately 5 MB per hour
Attempts:
2 left
💡 Hint

Calculate total log entries and multiply by correlation ID size in bytes.