18 / 25 · Service boundaries

Service discovery

Service discovery maps a stable service name to current usable destinations. Instances change as they deploy, fail or scale. Discovery finds candidates; routing and health policies decide how requests reach them.

What you will practise

  • Resolve a stable name
  • distinguish discovery and routing
  • handle stale endpoints

Before you start: Service name, endpoint and readiness.

About 4 minutes · offline-generated English female narration · captions included. Diagrams are conceptual; timings are illustrative.

Download MP4Captions

Listen without the videoDownload audio

The same pre-recorded voice as the video. Starting audio pauses the video, and starting the video pauses audio.

Chapters and full transcript

Let us understand service discovery. A school directory lists which rooms currently host each club. Students ask for the chess club rather than memorizing an old room number. The directory can become stale, so someone must update it and decide what happens when a listed room is closed. Service discovery maps a stable service name to current usable destinations. Instances change as they deploy, fail or scale. Discovery finds candidates; routing and health policies decide how requests reach them.

Follow the normal path. The caller requests the payment capability by service name instead of storing an individual pod address that may disappear during the next deployment. The platform or registry tracks service destinations and readiness. Registration and removal need reliable ownership and observable convergence. SeatSpot booking replicas should find the payment service even when its pod addresses change. Hard-coded ephemeral IPs become stale during routine operations.

Now change one condition. Client or server routing selects a usable endpoint. Discovery and load balancing cooperate, but they describe different responsibilities. A common misunderstanding is this: Finding an endpoint authorizes access to it. Discovery provides destinations, not identity or business permissions. Think about this. DNS resolves the payment service. Does that prove every connection will succeed? Pause the video and make your prediction. No. Name resolution can succeed while endpoints are unhealthy, changing or unreachable. Timeouts and failure handling still apply.

Let us reason with a concrete example. Three payment pods are replaced during a rolling deployment. Their individual IPs may change while a Kubernetes Service name remains stable. Endpoint/readiness propagation and existing connections still create a transition interval. Use the platform service abstraction and test replacement with live requests. Do not promise instantaneous convergence from a stable name. These figures are teaching examples, not production guarantees.

Turn the idea into a design decision. An old instance becomes unready and a replacement joins. Cached addresses and existing connections can outlive the registry update. A failed connection may use a safe bounded retry against current membership. Do not hide repeated errors with unlimited retries. When you try the practice task, look for this result. Stable naming helps callers, but does not imply instantaneous endpoint convergence.

Check your understanding. Knowing an address does not authorize a request. Validate the relevant identity, transport security and resource permissions at the appropriate boundaries. Here is a challenge. DNS resolves the service but requests fail. What do you check next? Pause before the answer. Check ready endpoints, target port, network reachability/policy, TLS identity and the dependency itself. Compare resolution with an actual bounded request and inspect traces. For an interview, compare client-side selection with a stable service/proxy address. Say what you would measure, not only which tool you would buy.

Start with an everyday picture

A school directory lists which rooms currently host each club. Students ask for the chess club rather than memorizing an old room number. The directory can become stale, so someone must update it and decide what happens when a listed room is closed.

Why SeatSpot needs this

SeatSpot booking replicas should find the payment service even when its pod addresses change. Hard-coded ephemeral IPs become stale during routine operations.

Trace one step at a time

Move through the diagram at your pace. Teal paths are active; unavailable components are labelled.

Booking callerService nameReady AReady BEndpoint registry

Step 1 of 6 · Name the capability

Ask for a stable name

The caller requests the payment capability by service name instead of storing an individual pod address that may disappear during the next deployment.

Read all six mechanism steps
  1. Ask for a stable name

    The caller requests the payment capability by service name instead of storing an individual pod address that may disappear during the next deployment.

  2. Maintain endpoints

    The platform or registry tracks service destinations and readiness. Registration and removal need reliable ownership and observable convergence.

  3. Choose a destination

    Client or server routing selects a usable endpoint. Discovery and load balancing cooperate, but they describe different responsibilities.

  4. Replace an instance

    An old instance becomes unready and a replacement joins. Cached addresses and existing connections can outlive the registry update.

  5. Retry within a budget

    A failed connection may use a safe bounded retry against current membership. Do not hide repeated errors with unlimited retries.

  6. Verify service identity

    Knowing an address does not authorize a request. Validate the relevant identity, transport security and resource permissions at the appropriate boundaries.

Pause and make a prediction

DNS resolves the payment service. Does that prove every connection will succeed?

Answer aloud or write your reasoning in the lesson notes before revealing the explanation.

Correct a common misunderstanding

Claim to question: Finding an endpoint authorizes access to it.

Better explanation: Discovery provides destinations, not identity or business permissions.

Follow a rolling endpoint replacement

A paper or whiteboard task. No cloud account or paid infrastructure is required.

  1. Write a stable service name and three changing instance addresses.
  2. Replace one instance and mark propagation/readiness delay.
  3. Trace an existing connection and a newly resolved connection separately.

Check what you can explain

This is your self-check, not an automated grade. Try again without the diagram tomorrow.

0 of 3 goals checked. Choose one remaining idea to practise next.

These checkboxes reset when you leave. Use your saved lesson notes and completion marker to record lasting progress.

Teach it back

Without looking, explain what this component changes, what it does not solve and what happens if it fails. Use the animation to check your explanation, then switch to Engineering.

Try it before viewing the solution

DNS resolves the service but requests fail. What do you check next?

Check one key idea

A discovered service name proves:

Your explanation and interview notes

Saved only in this browser when storage is available. Export a backup from the course page before clearing browser data or moving devices.

Loading your local notes…

Official references and next reading

The explanation, fictional examples and animations are original teaching material. Vendor behavior depends on the specific product/version; use its documentation before deploying.