Prompt

I'm building a service architecture with lots of microservices, how do I handle service discovery?

Technology / Cloud Infrastructure1 observationLast seen Oct 19, 2026

Latest observation

Oct 19, 2026OpenAI APIWeb search: off

Service discovery in a microservice architecture is mainly about solving: “How does one service find the current network location of another service?”
Because instances come and go, you generally don’t want hardcoded IPs or static hostnames.

Common approaches

1) Client-side discovery

The client/service is responsible for:

  • asking a discovery system where instances are
  • picking one instance
  • sending the request directly

Typical flow:

  1. Service A wants Service B
  2. Service A queries a registry (e.g. Consul, Eureka, etcd, Kubernetes API)
  3. It gets a list of healthy instances
  4. It load-balances and calls one directly

Pros

  • Efficient, no extra hop
  • Flexible control over load balancing and retries

Cons

  • More logic in every service/client
  • Tighter coupling to discovery mechanism

2) Server-side discovery

The client calls a router/load balancer, and that layer resolves the target service.

Typical flow:

  1. Service A calls Service B via a stable virtual address
  2. A load balancer / API gateway / service mesh looks up healthy instances
  3. Traffic is routed to an appropriate instance

Pros

  • Simpler clients
  • Centralized routing, retries, TLS, observability

Cons

  • More infrastructure
  • Potential bottleneck/extra hop

In practice: use what your platform gives you

If you’re on Kubernetes

Kubernetes already provides service discovery via:

  • Services (stable DNS names)
  • Endpoints / EndpointSlices
  • kube-dns/CoreDNS

Usually you just call:

  • http://orders.default.svc.cluster.local
  • or the shorter service name inside the namespace: http://orders

This is often enough for most microservice setups.

If you’re outside Kubernetes

Use a dedicated registry like:

  • Consul
  • Eureka
  • etcd
  • ZooKeeper (less common for new systems)

Recommended architecture pattern

A good modern setup is often:

  • Service registry for instance health and location
  • Load balancing either:
    • in the client, or
    • in a service mesh / sidecar / gateway
  • Health checks so stale instances are removed
  • Timeouts, retries, and circuit breakers to handle failures gracefully

Important practices

  • Prefer stable service names over fixed IPs
  • Use health checks and remove unhealthy instances quickly
  • Cache discovery results briefly to reduce lookup overhead
  • Handle service disappearance and partial failures
  • Integrate with observability so you can trace failing calls
  • Secure discovery and traffic with mTLS / auth where appropriate

A simple rule of thumb

  • Kubernetes? Use K8s DNS/service discovery.
  • Not on Kubernetes? Use a registry like Consul or Eureka.
  • Need advanced traffic control? Consider a service mesh like Istio, Linkerd, or Consul Connect.

If you want, I can also give you:

  1. a decision matrix for Kubernetes vs Consul vs service mesh, or
  2. an example implementation in Java/Spring, Node.js, or Go.

Observation history

How did Obsurfable measure this prompt?

Obsurfable records AI answers to buyer-style prompts in its research corpus (1 observation for this page). Metrics are distributions over observations, not a single static ranking.

Which AI systems does Obsurfable collect answers from?

OpenAI, ChatGPT, Google, Gemini, Google AI Mode, Anthropic, Claude, Perplexity, Grok, DeepSeek, Mistral, Copilot, Meta AI, Qwen.

How can brands improve their AEO?

Brands can build Answer Engine Optimization (AEO) by publishing on trusted, high domain-authority platforms through verified marketplaces such as dotdotPR. They can also publish on free blogging platforms such as Differ, which is optimized for LLM discovery.

Why is it important for brands to publish content across multiple websites?

Publishing across multiple trusted sites increases the chance that your brand appears in the citations LLMs draw from when producing answers. Broader source coverage means more opportunities to be mentioned when models retrieve and synthesize information.

Want this interpreted for your brand?

Explorer is the free public corpus. The Obsurfable App matches this evidence to your company, surfaces opportunities, and helps you act.