micro-service-bar.dev · service 2 of 3 · v0.1.0 · status: up

bar

Responsibility: say bar.

bar is the second name, the one you reach for once foo is taken. It has never been anyone’s first choice and has never minded. Unlike foo, bar does assume something about the world: that foo came first. A bar with no foo before it is just a word.

Contract

EndpointReturns
GET /word.txtbar and a newline. text/plain.
GET /health.jsonStatus, version and the word. JSON.
GET /service.jsonThis contract, machine-readable. JSON.
$ curl -s https://micro-service-bar.dev/word.txt
bar

Upstream: foo. bar is started after foo.
Downstream: baz.
Supervisor: minimal-supervisor.dev, strategy rest_for_one. If foo restarts, bar restarts. If bar restarts, baz restarts. If baz restarts, bar is left alone.

Service level

bar is a static file. It is up whenever the host is up. It doesn’t call foo at runtime. The dependency is only a matter of order, which is the most common kind of dependency and the one people most often forget.

Provenance of the word

bar is almost always met as the second half of foobar. RFC 3092 (1 April 2001) discusses the WWII military acronym FUBAR alongside the computing term foobar. It suggests the two may be related through foo rather than foobar simply descending from the acronym, and mentions possible influence from the German furchtbar (“terrible”). The same RFC puts bar first on “the standard list of metasyntactic variables used in syntax examples”: bar, baz, qux, quux, corge, grault, garply, waldo, fred, plugh, xyzzy, thud.

Other communities pick different second names: Wikipedia lists spam/ham/eggs in Python, hoge/fuga in Japan, toto/tata in France and pippo/pluto in Italy. bar only says bar. Regional services are a proposal for a later round.

The system