Which statement best describes the main difference between request-response and event-driven communication in microservices?
Think about whether the sender waits for a response or not.
Request-response communication is synchronous, meaning the sender waits for the receiver to respond before continuing. Event-driven communication is asynchronous; the sender emits an event and continues without waiting for a reply.
You are designing a user login microservice that must verify credentials and immediately respond with success or failure. Which communication style is most appropriate?
Consider if the client needs an immediate answer or can wait.
Login requires immediate feedback to the user, so request-response is suitable because it provides synchronous communication with immediate results.
Which advantage does event-driven architecture provide when scaling microservices compared to request-response?
Think about how asynchronous processing affects load handling.
Event-driven architecture decouples services, allowing them to handle events asynchronously and independently, which improves scalability and fault tolerance.
What is a common tradeoff when choosing event-driven communication over request-response in microservices?
Consider the challenges of asynchronous systems.
Event-driven systems often face challenges like eventual consistency, increased complexity, and difficulty tracing errors compared to synchronous request-response systems.
A microservice emits an event for every user action. If there are 10,000 users each performing 5 actions per minute, how many events per second does the system generate?
Calculate total events per minute, then convert to per second.
Total events per minute = 10,000 users * 5 actions = 50,000 events/minute. Divide by 60 seconds to get approximately 833 events/second.