-Microservices and Service Discovery history and evolution
-Service Registry & Service Discovery patterns
-Consul main concepts, architecture and use cases
6. • Virtualization
• Web/App/Db layers
• Create/Destroy in minutes
• Scale up/down dynamically
• Manually configure?
History
7. • Containerization & Microservices
• Create/Destroy in ms
• Hundreds of Services
• Impossible to manage manually
History
8. • Monolith: Hard to maintain,
troubleshoot, evolve
• Microservice: Independent,
scalable, simple
Monolith to Microservices
9. Challenges:
o Monitoring
o Logging
o Version and Configuration Management
o Distributed Transactions
o Service Discovery
o …
Microservices not a free lunch
10. • Start services in any order
• Destroy services with confidence
• Restart servers safely
• Reconfigure services easily
Practical Goals
11. • Can find services
• Can avoid and handle unhealthy services
• Can be configured externally
Robust Systems
12. • Database of available service instances
• Two approaches:
o Self Registration
o Third Party Registration
• Heartbeat vs Polling
Service Registry
15. • High Available, Distributed K/V store
• Service Discovery. DNS and HTTP Interface
• Flexible Health Checking
• Multi Datacenter
• Open Source
Consul
18. • Rest /v1/catalog/services
• DNS dig @127.0.0.1 -p 8600 testConsulApp.service.consul SRV
• CLI consul kv get myAppConfig
• Web UI
Consul Interface
19. • Register a service: PUT /agent/service/register
• List services : GET /agent/services
• Maintenance mode: /agent/service/maintenance/:service_id
• Health: GET /health/node/:node
• K/V store: /kv/:key
Consul Rest API