All quizzesHard
Microservices & Scaling — Series 3
Preview — 3 of 10 questions
What distinguishes the two, and what does each cost?
AClient-side discovery requires DNS; server-side does not.
BIn client-side discovery the caller queries the registry and picks an instance itself — one fewer network hop and full control over the load-balancing policy, at the cost of a discovery library in every service and language. In server-side discovery the caller addresses a stable endpoint and a load balancer or sidecar resolves it, keeping clients simple at the cost of an extra hop and another component to operate.
CThey are the same mechanism under different names.
DServer-side discovery cannot do health checking.
A mobile client needs a different response shape from the web client. What does that argue for?
AA single gateway that returns the union of both shapes.
BDuplicating every microservice per client type.
CLetting the mobile app call each microservice directly.
DA BFF per client type: a thin, client-specific aggregation layer owned by that client's team, sitting behind the shared gateway concerns (TLS, authentication, rate limiting, routing) rather than replacing them.
Why do distributed transactions across services use sagas?
ABecause 2PC requires a coordinator that holds locks across services for the duration of the transaction — unavailable during a coordinator failure and unusable at internet latencies — whereas a saga is a sequence of local transactions, each with a compensating action that semantically undoes it on failure.
BBecause sagas are ACID and 2PC is not.
CBecause sagas guarantee that intermediate states are never visible.
DBecause 2PC does not work across different database engines.
Sign up free to play
Answer all 10 questions (7 more), see explanations for every answer, and track your score.