A service have its own con guration at
I am here with this address, port etc...
A service require other service
Where the database is, which password i should use, etc...
The service should reports its owns status
I am alive and responsive (for healthcheck)
other services can check the health report for the maintenance mode
or to shortcircuit the service dependency
To expose the coordination problem we create an
users that tweet with this handle
create a reserved API service [ JSON over HTTP ]
GET /tweet - list my tweets
POST /tweet - record a new
The database to store tweets is self-contained in the API service
Now every service is exposed with a unique pair
address:port in the swarm
every box is a container (service)
blinks for activities (publish new tweets)
Service Worker (need a distributed lock)
a lock identi es the service deployment
on missing => service deploy
on existing => publish messages
Per user container
A proxy to list users and redirects requests
Every user have its own network address and
Every user expose its own API
How do we connect services together?
DNS as a coordination system
DNS is a good solution to point things in a network
DNS SRV expose a service address con guration
$ dig srv _auth._tcp.walterdalmut.com +short
1 10 8080 1.api.walterdalmut.com
1 10 8080 2.api.walterdalmut.com
And service con gurations?
K / V
Several coordination systems available
Etcd is one of the most interesting coordination system available
Consul integrates di erent things together like: DNS, KV, etc...
many other: zookeeper, etc...