Failing to see how ambassador pattern enhances modularity / simplicty of container architecture in Docker - Stack Overflow
I fail to see how implementing the ambassador pattern would help us simplify / modularize the design of our container architecture.
Let's say that I have a database container db
on host A and is used by a program db-client
which sits on host B, which are connected via ambassador containers db-ambassador
and db-foreign-ambassador
over a network:
[host A (db) --> (db-ambassador)] <- ... -> [host B (db-forgn-ambsdr) --> (db-client)]
Connections between containers in the same machine, e.g. db
to db-ambassador
, and db-foreign-ambassador
to db-client
are done via Docker's --link
parameter while db-ambassador
and db-foreign-ambassador
talks over the network.
But , --link
is just a fancy way of inserting ip addresses, ports and other info from one container to another. When a container fails, the other container which is linked to it does not get notified, nor will it know the new IP address of the crashing container when it restarts. In short, if a container which is linked to another went dead, the link is also dead.
To consider my example, lets say that db
crashed and restarts, thus get assigned to a different IP. db-ambassador
would have to be restarted too, in order to update the link between them... Except you shouldn't. If db-ambassador
is restarted, the IP would have changed too, and foreign-db-ambassador
won't know where to reach it at the new IP address.
Read full article from Failing to see how ambassador pattern enhances modularity / simplicty of container architecture in Docker - Stack Overflow