Deploy
This commit is contained in:
1 parent
8bbcf8ecd9
commit
45dd65b48e
116 files changed
+20457
-1164
No files matched your search
@@ -209,6 +209,126 @@
|
||||
"<span class='chapter-number'>3</span> <span class='chapter-title'>[Part II — Cross the process boundary]{.en}[Partie II — Franchir la frontière de processus]{.fr}[Teil II — Die Prozessgrenze überschreiten]{.de}</span>"
|
||||
]
|
||||
},
|
||||
{
|
||||
"objectID": "03-part-iii-distributed.html",
|
||||
"href": "03-part-iii-distributed.html",
|
||||
"title": "4 Part III — Make it actually distributed",
|
||||
"section": "",
|
||||
"text": "4.1 Syncthing replicates; it does not deliver\nFive processes on one computer still share one filesystem. Steps 19 to 27 put them on two machines, replicate the message board between them with Syncthing, measure what that costs, and then break a mediator on purpose. By the end, the mediators’ price is a number rather than an opinion.\nSyncthing keeps a directory replicated between machines. That is all it is asked to do here. It knows nothing about Intent, Status, Event, ROT13 or mediators, and it has no concept of a consumer: no subscriptions, no topics, no delivery guarantees, no notion that anybody is waiting.\nThe trigger is still ours. Each service runs its own WatchService on a local directory; Syncthing only makes files appear there. That is why none of the three services changed a single line when the system became distributed.\nTwo consequences follow, and both show up later as observations rather than warnings:",
|
||||
"crumbs": [
|
||||
"<span class='chapter-number'>4</span> <span class='chapter-title'>[Part III — Make it actually distributed]{.en}[Partie III — Le rendre réellement distribué]{.fr}[Teil III — Es wirklich verteilen]{.de}</span>"
|
||||
]
|
||||
},
|
||||
{
|
||||
"objectID": "03-part-iii-distributed.html#sec-syncthing-not-a-broker",
|
||||
"href": "03-part-iii-distributed.html#sec-syncthing-not-a-broker",
|
||||
"title": "4 Part III — Make it actually distributed",
|
||||
"section": "",
|
||||
"text": "replication is asynchronous — the .tmp → .msg rename is atomic on each machine separately, and nothing promises ordering or atomicity between machines;\nthe filesystem is a serious transport with its own strengths: files can be large, replicas survive a reboot, and every message is readable with cat.",
|
||||
"crumbs": [
|
||||
"<span class='chapter-number'>4</span> <span class='chapter-title'>[Part III — Make it actually distributed]{.en}[Partie III — Le rendre réellement distribué]{.fr}[Teil III — Es wirklich verteilen]{.de}</span>"
|
||||
]
|
||||
},
|
||||
{
|
||||
"objectID": "03-part-iii-distributed.html#sec-one-layer",
|
||||
"href": "03-part-iii-distributed.html#sec-one-layer",
|
||||
"title": "4 Part III — Make it actually distributed",
|
||||
"section": "4.2 Test one layer at a time",
|
||||
"text": "4.2 Test one layer at a time\nBefore any Java touched the replicated folder, the dullest possible test ran first: write hello.txt on one machine, confirm it appears on the other, delete it, confirm the deletion travels back. Both directions worked.\nThat order matters. When the distributed run later failed, the question “is it replication or is it my program?” had already been answered for the transport, and the search could start one layer up.",
|
||||
"crumbs": [
|
||||
"<span class='chapter-number'>4</span> <span class='chapter-title'>[Part III — Make it actually distributed]{.en}[Partie III — Le rendre réellement distribué]{.fr}[Teil III — Es wirklich verteilen]{.de}</span>"
|
||||
]
|
||||
},
|
||||
{
|
||||
"objectID": "03-part-iii-distributed.html#sec-keystroke-cost",
|
||||
"href": "03-part-iii-distributed.html#sec-keystroke-cost",
|
||||
"title": "4 Part III — Make it actually distributed",
|
||||
"section": "4.3 What one keystroke costs",
|
||||
"text": "4.3 What one keystroke costs\nWith the sensor on one machine and the mediators, ROT13 and the actuator on the other, one typed line produced four .msg files, one per mailbox:\n\n\n\nmailbox\ncontent\ntimestamp inside\n\n\n\n\nconsoleIn/outbox\nHello World\n23:02:05.315\n\n\nrot13/inbox\nHello World\n23:02:05.315\n\n\nrot13/outbox\nUryyb Jbeyq\n23:02:13.471\n\n\nconsoleOut/inbox\nUryyb Jbeyq\n23:02:13.471\n\n\n\nThe repeated timestamps are the evidence that two of those four publications are pure copies: the mediators republish the message unchanged, timestamp included. They compute identity(x) = x, as separate distributed processes.\nThe timing, taken from the four files’ modification times on one machine so that no clock skew enters: the sensor’s file appears at 01:02:05.432, the other three at 01:02:13.460, .504 and .532 — 8.10 s later, and within 72 ms of each other. So the chain’s own work took milliseconds; the eight seconds are Syncthing’s propagation. The same chain, run entirely on one machine, completes in about 24 ms.",
|
||||
"crumbs": [
|
||||
"<span class='chapter-number'>4</span> <span class='chapter-title'>[Part III — Make it actually distributed]{.en}[Partie III — Le rendre réellement distribué]{.fr}[Teil III — Es wirklich verteilen]{.de}</span>"
|
||||
]
|
||||
},
|
||||
{
|
||||
"objectID": "03-part-iii-distributed.html#sec-break-a-mediator",
|
||||
"href": "03-part-iii-distributed.html#sec-break-a-mediator",
|
||||
"title": "4 Part III — Make it actually distributed",
|
||||
"section": "4.4 Break a mediator",
|
||||
"text": "4.4 Break a mediator\nStop the first mediator and type two lines. ConsoleIn is alive, ROT13 is alive, ConsoleOut is alive, Syncthing is alive — and the business flow is dead. The two lines pile up in consoleIn/outbox; nothing moves past it. The mediators are part of the availability chain.\nThen restart the mediator. Nothing is delivered. FileMessageBoard.watch registers a directory for ENTRY_CREATE and blocks in watcher.take(); it never lists what is already there. The two files are still on disk, in both replicas — so no data was lost. What has no memory is the subscription.\nThat distinction is worth keeping: the messages survived, the delivery did not. A broker answers this with session state and retained messages; in our own code it would be one line — list the existing .msg files before entering the watch loop — which the material deliberately does not write yet.",
|
||||
"crumbs": [
|
||||
"<span class='chapter-number'>4</span> <span class='chapter-title'>[Part III — Make it actually distributed]{.en}[Partie III — Le rendre réellement distribué]{.fr}[Teil III — Es wirklich verteilen]{.de}</span>"
|
||||
]
|
||||
},
|
||||
{
|
||||
"objectID": "03-part-iii-distributed.html#sec-configurable-mediator",
|
||||
"href": "03-part-iii-distributed.html#sec-configurable-mediator",
|
||||
"title": "4 Part III — Make it actually distributed",
|
||||
"section": "4.5 The mediator becomes an ordinary service",
|
||||
"text": "4.5 The mediator becomes an ordinary service\nBefore removing the mediators, one asymmetry gets removed: the services receive their work as messages, while the mediator received its route as shell arguments. So the mediator is given only a name, ConfigurableMediator mediator1, from which it derives one permanent control mailbox, mediators/mediator1/inbox, and the route arrives as a message:\nROUTE\nconsoleIn/outbox\nrot13/inbox\nfrom and to travel in one message on purpose: as two, the mediator would briefly hold a new source with the old destination and forward to the wrong place. A route is one fact, and one fact belongs in one message.\nA short-lived orchestrator publishes both routes and exits, so the topology is visible in one place and is not in the data path. Running it after the services, and typing a line before it, shows both halves at once: the early line is stranded, the later one flows.\nWhat improved: the mediator now has an identity, takes configuration through its own inbox, keeps a generic capability, and gets its topology from an orchestrator. What did not improve: the data path. It is still event → mediator → copied event, still a process in the availability chain, still copying every message without adding meaning. And this version accepts exactly one route: waitForRoute(...) returns, then the mediator enters watch(route.from(), …) and never reads its control inbox again. Live rewiring is not promised, because one blocking watch cannot serve a control inbox and a source at the same time — the reason a subscription helper appears later.",
|
||||
"crumbs": [
|
||||
"<span class='chapter-number'>4</span> <span class='chapter-title'>[Part III — Make it actually distributed]{.en}[Partie III — Le rendre réellement distribué]{.fr}[Teil III — Es wirklich verteilen]{.de}</span>"
|
||||
]
|
||||
},
|
||||
{
|
||||
"objectID": "03-part-iii-distributed.html#sec-part-iii-result",
|
||||
"href": "03-part-iii-distributed.html#sec-part-iii-result",
|
||||
"title": "4 Part III — Make it actually distributed",
|
||||
"section": "4.6 What part III moved",
|
||||
"text": "4.6 What part III moved\n\n\n\n\n\n\n\n\nstage\nwhere the topology lives\nin the data path?\n\n\n\n\nstep 18\nthe operator’s command lines\nthe mediators are\n\n\nstep 27\nan orchestrator, published as Intent\nthe mediators still are\n\n\n\nThe question the part ends on is therefore sharp rather than rhetorical: why can’t the service interested in the data simply listen to it itself?",
|
||||
"crumbs": [
|
||||
"<span class='chapter-number'>4</span> <span class='chapter-title'>[Part III — Make it actually distributed]{.en}[Partie III — Le rendre réellement distribué]{.fr}[Teil III — Es wirklich verteilen]{.de}</span>"
|
||||
]
|
||||
},
|
||||
{
|
||||
"objectID": "04-part-iv-rewind.html",
|
||||
"href": "04-part-iv-rewind.html",
|
||||
"title": "5 Part IV — Rewind",
|
||||
"section": "",
|
||||
"text": "5.1 The obvious shortcut, and its trap\nSteps 28 to 34 go back to one JVM on purpose. With no replication delay and no five-terminal setup, the only thing that can change is who knows whom — so the idea can be tried in seconds instead of in a distributed debugging session.\nIf the first mediator only copies messages, delete it and let ROT13 read the source itself:\nThe mediator is gone. But ask the recurring question: ROT13 now contains the name of ConsoleIn’s mailbox. The topology moved out of the mediator and into the service. As the material puts it: “We removed the mediator… and put topology back into the service. Oops.”",
|
||||
"crumbs": [
|
||||
"<span class='chapter-number'>5</span> <span class='chapter-title'>[Part IV — Rewind]{.en}[Partie IV — Rembobinage]{.fr}[Teil IV — Zurückspulen]{.de}</span>"
|
||||
]
|
||||
},
|
||||
{
|
||||
"objectID": "04-part-iv-rewind.html#sec-the-trap",
|
||||
"href": "04-part-iv-rewind.html#sec-the-trap",
|
||||
"title": "5 Part IV — Rewind",
|
||||
"section": "",
|
||||
"text": "listen(\"consoleIn.outbox\");",
|
||||
"crumbs": [
|
||||
"<span class='chapter-number'>5</span> <span class='chapter-title'>[Part IV — Rewind]{.en}[Partie IV — Rembobinage]{.fr}[Teil IV — Zurückspulen]{.de}</span>"
|
||||
]
|
||||
},
|
||||
{
|
||||
"objectID": "04-part-iv-rewind.html#sec-capability-vs-topology",
|
||||
"href": "04-part-iv-rewind.html#sec-capability-vs-topology",
|
||||
"title": "5 Part IV — Rewind",
|
||||
"section": "5.2 Capability is not topology",
|
||||
"text": "5.2 Capability is not topology\nROT13 may know two things: I can transform text, and I am capable of listening for compatible text messages. It may not know my input always comes from consoleIn.outbox — that is deployment topology.\nSo the name is not compiled in; it arrives at runtime:\nTOPIC consoleIn.outbox\nROT13 learns its wiring from data. Note who sends it: in DynamicQueueRot13.java it is main() that publishes both TOPIC messages — a configurator, outside the data path, in the role the orchestrator played before. It cannot be ConsoleIn: if ConsoleIn told ROT13 what to subscribe to, ConsoleIn would have to know ROT13 exists, and the topology would simply have moved into a different capability.",
|
||||
"crumbs": [
|
||||
"<span class='chapter-number'>5</span> <span class='chapter-title'>[Part IV — Rewind]{.en}[Partie IV — Rembobinage]{.fr}[Teil IV — Zurückspulen]{.de}</span>"
|
||||
]
|
||||
},
|
||||
{
|
||||
"objectID": "04-part-iv-rewind.html#sec-dynamic-mechanics",
|
||||
"href": "04-part-iv-rewind.html#sec-dynamic-mechanics",
|
||||
"title": "5 Part IV — Rewind",
|
||||
"section": "5.3 What changes in the code",
|
||||
"text": "5.3 What changes in the code\nlisten(...) is nothing exotic: a virtual thread that repeatedly calls take() on one of the same queues. subscribe(...) starts one such thread per subscribed name. The consequence is visible in the mailboxes:\n\nROT13 takes straight from consoleIn.outbox — the name it was told;\nrot13.inbox is no longer a payload mailbox. It carries control messages, and ROT13’s loop reads it to decide whether a message is a TOPIC to act on.\n\nNothing writes into rot13.inbox to move data anymore. The mailbox did not disappear; it changed job, from carrying payload to carrying Intent.\nOne observation from running it: after Ctrl+D, output stops but the program stays up. Nothing was interrupted — runConsoleIn returns on end of input, so the producer is gone, while both subscriber threads sit blocked in take() on sources that will never publish again. The JVM stays alive because main ends with Thread.currentThread().join(). “The flow stopped” always has to be traced to which participant stopped.",
|
||||
"crumbs": [
|
||||
"<span class='chapter-number'>5</span> <span class='chapter-title'>[Part IV — Rewind]{.en}[Partie IV — Rembobinage]{.fr}[Teil IV — Zurückspulen]{.de}</span>"
|
||||
]
|
||||
},
|
||||
{
|
||||
"objectID": "04-part-iv-rewind.html#sec-route-topic-intent",
|
||||
"href": "04-part-iv-rewind.html#sec-route-topic-intent",
|
||||
"title": "5 Part IV — Rewind",
|
||||
"section": "5.4 ROUTE and TOPIC are Intent",
|
||||
"text": "5.4 ROUTE and TOPIC are Intent\nApply two tests to TOPIC consoleIn.outbox. Does it describe something that happened? No. Something currently true? No. It says please begin listening here — desired behaviour, which is Intent. The mediator’s ROUTE is the same kind of message: please forward from here to there.\nOne trap worth naming, because it is tempting in a defence: publishing an Intent is of course something that happened. Classification follows what the message says, not the fact that it exists.\nAnd one condition, which returns later: the dynamic version is not automatically superior. It makes sense only if the consumer actually understands the producer’s message contract.\nSTATIC MEDIATED DYNAMIC DIRECT\nProducer → Mediator → Consumer Intent → (Producer ──► Consumer)",
|
||||
"crumbs": [
|
||||
"<span class='chapter-number'>5</span> <span class='chapter-title'>[Part IV — Rewind]{.en}[Partie IV — Rembobinage]{.fr}[Teil IV — Zurückspulen]{.de}</span>"
|
||||
]
|
||||
},
|
||||
{
|
||||
"objectID": "glossary.html",
|
||||
"href": "glossary.html",
|
||||
|
||||
Reference in new issue
Block a user