서버 사이드 디스커버리
클라이언트 대신 LB/라우터가 레지스트리를 조회해 서비스 엔드포인트를 해석하는 패턴
구조와 동작 원리
구성 요소와 배치 원칙 (조사 기반 개념 설명 · 연결 순서나 토폴로지는 특정하지 않음)
레지스트리(등록/해지), 헬스 신호, 조회 경로가 핵심이며 서버 측은 LB/라우터가 조회를 대행
서비스 카탈로그(레지스트리)를 단일 진실 원천으로 두고 서비스 정보를 중앙에 저장·조회
컨테이너/가상화 환경에서 인스턴스 수와 위치가 동적으로 변해 고정 주소 호출이 어려운 문제를 해결
기대 효과
클라이언트를 디스커버리에서 분리하고 언어별 라이브러리 없이 중앙에서 LB
트레이드오프
추가 네트워크 홉과 고가용 컴포넌트 운영 부담이 트레이드오프
라우터/LB가 추가 인프라로서 고가용성이 필요하고 네트워크 홉·지연이 늘어나는 상황은 주의
운영 및 적용 가이드
종합 설명 · 원문 인용으로 검증된 항목과 구분됩니다. 실제 적용 전 확인이 필요합니다.
언제 사용하는가
동적으로 스케일·재배포되는 마이크로서비스 환경에서 클라이언트가 개별 인스턴스 주소를 몰라도 고정된 LB/라우터를 통해 서비스 호출을 수행할 때 적합하다.
시나리오
예: 일 5천만 요청 규모 이커머스가 수십 개 마이크로서비스를 K8s에서 운영하며, 오토스케일·롤링 배포로 Pod IP가 자주 바뀌고 클라이언트 언어가 다양하다. 각 서비스는 고정된 내부 LB/게이트웨이 주소만 호출하고, LB가 레지스트리/서비스 디스커버리에서 건강한 인스턴스를 선택해 전달한다. 요구사항은 무중단 배포, 수평 확장, 언어 독립성, 장애 인스턴스 자동 우회다.
배치 원칙
- 서비스 레지스트리는 고가용 클러스터로 중앙 배치
- 라우터/LB는 클라이언트와 서비스 사이의 고정 진입점으로 배치
- 헬스 체크와 readiness를 서비스 인스턴스에 두고 LB가 주기적으로 조회
- 레지스트리 장애 대비 마지막 정상 캐시를 라우터/LB에 배치
- Kubernetes에서는 Service/Ingress와 kube-dns/컨트롤러를 통해 엔드포인트 해석을 위임
온프레미스
레지스트리·LB/라우터를 HA(다중 노드, VIP/keepalived, LB 이중화)로 배포하고, 레지스트리 데이터 백업·Raft/쿼럼 디스크 I/O 모니터링, 점진 도입과 폴백 경로, 헬스체크·캐시 TTL 운영.
클라우드
관리형 LB/서비스 디스커버리(예: ELB, Cloud DNS, GKE Service/Ingress)를 사용하고, IaC/매니페스트 기반으로 LB·백엔드·방화벽을 프로비저닝하며 오토스케일·트래픽 변화에 맞춘 헬스체크와 DNS 캐시 TTL을 운영.
Kubernetes
Service/Ingress로 고정 엔드포인트를 노출하고 readiness/liveness 분리, kube-dns/NodeLocal DNSCache, 엔드포인트 슬라이스/컨트롤러 관찰, 롤링 배포 중 연결 드레이닝과 PDB를 운영.
장애 대응
대표 장애는 레지스트리 불가, stale 캐시로 죽은 인스턴스 라우팅, 등록 실패, DNS/LB 장애. 절차: 영향 범위 확인→마지막 정상 캐시/폴백 전환→죽은 엔드포인트 제거·서킷브레이커/재시도→레지스트리·LB·DNS 헬스/쿼럼/디스크 복구→원인 분석 및 TTL·HA·헬스체크 재조정.
14개 관점별 근거
조사 당시 근거 보유 여부입니다. 출처의 정확성과 최신성을 별도로 판단하세요.
정의·개요근거 있음
클라이언트 대신 LB/라우터가 레지스트리를 조회해 서비스 엔드포인트를 해석하는 패턴
this pattern shifts the responsibility to a load balancer or router, which queries the service registry해결하는 문제근거 있음
컨테이너/가상화 환경에서 인스턴스 수와 위치가 동적으로 변해 고정 주소 호출이 어려운 문제를 해결
the number of instances of a service and their locations changes dynamically주요 구성 컴포넌트·리소스근거 있음
레지스트리(등록/해지), 헬스 신호, 조회 경로가 핵심이며 서버 측은 LB/라우터가 조회를 대행
a registry (where instances register on startup and deregister on shutdown), a health signal, and a lookup path for clients데이터·에셋 배치 원칙근거 있음
서비스 카탈로그(레지스트리)를 단일 진실 원천으로 두고 서비스 정보를 중앙에 저장·조회
This service catalog acts as a single source of truth that allows your services to query and communicate with each other.대표 유스케이스근거 있음
동적 컨테이너/클라우드 마이크로서비스에서 K8s Service나 AWS ELB처럼 중앙 LB가 엔드포인트를 해석하는 유스케이스
Kubernetes Services and AWS Elastic Load Balancer are server-side discovery.시나리오 예시근거 있음
클라이언트는 고정 주소의 LB/라우터로 요청하고, 해당 컴포넌트가 레지스트리를 조회해 적절한 인스턴스로 전달
The client goes to a fixed address (load balancer, router), which looks up the registry and forwards the request부적합 상황·주의근거 있음
라우터/LB가 추가 인프라로서 고가용성이 필요하고 네트워크 홉·지연이 늘어나는 상황은 주의
The router is an additional infrastructure component that must be highly available. It adds a network hop and latency.온프레미스 관점(개발·배포·운영)근거 있음
온프레미스에서는 라우터/LB를 고가용 인프라로 배포·운영해야 함
The router is an additional infrastructure component that must be highly available.클라우드 관점(개발·배포·운영)근거 있음
클라우드에서는 Ingress/Service 컨트롤러가 매니페스트에 따라 LB·백엔드를 생성하고 트래픽/환경 변화에 맞춰 관리
The controller continues managing the load balancer and backends based on environmental and traffic changes.Kubernetes 관점(개발·배포·운영)근거 있음
K8s Service가 여러 Pod를 단일 네트워크 엔드포인트로 노출해 디스커버리를 제공
In Kubernetes, a Service is a method for exposing a network application that is running as one or more Pods in your cluster.장애 대응 관점근거 있음
레지스트리 불가 시 신규 인스턴스 등록과 토폴로지 변경 발견이 불가해지며, 마지막 정상 캐시·서킷브레이커·재시도로 완화
When the registry is unreachable, new instances cannot register and topology changes are not discoverable.장점근거 있음
클라이언트를 디스커버리에서 분리하고 언어별 라이브러리 없이 중앙에서 LB
Client is decoupled from discovery. No language-specific libraries needed. The router handles load balancing centrally.단점·트레이드오프근거 있음
추가 네트워크 홉과 고가용 컴포넌트 운영 부담이 트레이드오프
An extra network hop and a highly available component to run대표 기술·도구근거 있음
대표 기술로 Kubernetes Service와 AWS ELB가 서버 측 디스커버리로 분류됨
Kubernetes Services and AWS Elastic Load Balancer are server-side discovery.추가 참고 문헌 (22)
- Pattern: Server-side service discovery ↗
- Service Discovery Explained | Consul | HashiCorp Developer ↗
- Service Discovery in Microservices: Key Patterns ↗
- Service Discovery: A Survey | Xinyu Ma ↗
- Understanding Service Discovery for Microservices Architecture ↗
- Service Discovery: Client-Side, Server-Side, Kubernetes DNS and .NET Service Discovery — Mert Özen ↗
- Service Discovery Patterns: DNS, Consul, and Kubernetes-Native Approaches ↗
- BEE-19007: Service Discovery | Backend Engineering Essentials ↗
- Service | Kubernetes ↗
- Cross-cluster Service Discovery using Federated Services - Kubernetes ↗
- About service discovery | GKE networking ↗
- Overview of Service networking in GKE Stay organized with collections Save and categorize content based on your preferences. ↗
- Connecting Applications with Services | Kubernetes ↗
- Multi-Cluster Service Discovery in K8s and Service Mesh ↗
- Kubernetes Service Discovery - Learn By Example ↗
- Service discovery at Stripe ↗
- Common Failure Modes and Mitigation Strategies in Service Discovery | Service Discovery - System Overflow ↗
- How systems find each other — Service Discovery without magic ↗
- Distributed Systems: Service Discovery & Configuration | Andrews Notebook ↗
- Upstream Discovery ↗
- Service Discovery and Configuration — Distributed Systems | Socratopia Library ↗
- How to Build API Health Checks That Don't Lie ↗