At Leven Labs, we're all about microservices, but something that wasn't immediately apparent to us was how to easily communicate between them.
We had 3 basic requirements:
- Freely spin up services on demand
- Quickly recover from failure
- Simple development environment (inside vagrant)
Hard-coding addresses and ports in our services wasn't an option since we'd have to redeploy whenever we want to change or add servers. We decided to use SkyDNS, which sits above the etcd key-value store and provides an easy way to do service discovery. SkyDNS exposes a REST API that lets you add and remove SRV-type DNS records that contain a host, port, priority, and weight.
Sounds perfect! Whenever a service starts up, it will make a