Skip to content
_CORE
AI & Agentic Systems Core Information Systems Cloud & Platform Engineering Data Platform & Integration Security & Compliance QA, Testing & Observability IoT, Automation & Robotics Mobile & Digital Banking & Finance Insurance Public Administration Defense & Security Healthcare Energy & Utilities Telco & Media Manufacturing Logistics & E-commerce Retail & Loyalty
References Technologies Blog Know-how Tools
About Collaboration Careers
CS EN DE
Let's talk

Service Discovery — How Services Find Each Other

17. 11. 2023 Updated: 24. 03. 2026 1 min read intermediate
This article was published in 2023. Some information may be outdated.

Architecture Intermediate

Service Discovery — How Services Find Each Other

Service DiscoveryMicroservicesConsul 3 min read

Service discovery mechanisms in microservice architecture. Client-side vs server-side discovery, Consul and Kubernetes DNS.

Why Service Discovery?

In microservices, services are dynamically started and stopped. IP addresses change. Service Discovery solves the question: how does service A find the current address of service B?

Client-Side Discovery

The client queries the registry and decides which instance to send the request to.

const consul = require('consul')();
async function getServiceUrl(serviceName) {
    const services = await consul.health.service({
        service: serviceName, passing: true
    });
    const idx = Math.floor(Math.random() * services.length);
    const svc = services[idx].Service;
    return \`http://\${svc.Address}:\${svc.Port}\`;
}

Server-Side Discovery

Kubernetes uses server-side discovery natively:

apiVersion: v1
kind: Service
metadata:
  name: order-service
spec:
  selector:
    app: order-service
  ports:
    - port: 80
      targetPort: 8080
# Call: http://order-service.default.svc.cluster.local

Tools

  • Consul — health checking, KV store, multi-datacenter
  • etcd — foundation of Kubernetes
  • Eureka — Netflix OSS, Java/Spring

Summary

In Kubernetes, service discovery is solved out-of-the-box. Outside K8s, consider Consul or Eureka.

Need Help with Implementation?

Our team has experience designing and implementing modern architectures. We’re happy to help.

Free Consultation

Share:

CORE SYSTEMS team

We build core systems and AI agents that keep operations running. 15 years of experience with enterprise IT.