Files
progcode/web/public/assets/editorial/2021/data-consistency-state-machine-2021.svg
huncode c561263bfc
Build and deploy / deploy (push) Successful in 14s
revise April 2021 data consistency articles
2026-07-31 12:32:46 +03:00

66 lines
4.6 KiB
XML

<svg xmlns="http://www.w3.org/2000/svg" width="720" height="1260" viewBox="0 0 720 1260" role="img" aria-labelledby="title desc">
<title id="title">Порядок состояний owner и fulfillment проекции</title>
<desc id="desc">Вертикальная схема показывает owner заказа paid версии 2, контролируемую компенсацию cancelled версии 3, отложенное событие версии 3 в fulfillment, применение версии 2 и replay версии 3. Отгрузка остаётся заблокированной.</desc>
<defs>
<style>
.bg { fill: #0b1220; }
.frame { fill: #101c31; stroke: #2e4264; stroke-width: 3; }
.owner { fill: #153a5b; stroke: #55b6e6; stroke-width: 3; }
.consumer { fill: #20394f; stroke: #9cc4e4; stroke-width: 3; }
.warn { fill: #52331c; stroke: #f6b850; stroke-width: 3; }
.stop { fill: #552b35; stroke: #ff8992; stroke-width: 3; }
.ok { fill: #19443d; stroke: #6bd5b5; stroke-width: 3; }
.title { fill: #f5f8ff; font: 700 32px Arial, sans-serif; }
.section { fill: #ffffff; font: 700 26px Arial, sans-serif; }
.copy { fill: #d9e5f5; font: 22px Arial, sans-serif; }
.small { fill: #b8cbe0; font: 20px Arial, sans-serif; }
.accent { fill: #8de0ff; font: 700 22px Arial, sans-serif; }
.arrow { fill: none; stroke: #8de0ff; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; marker-end: url(#arrowhead); }
.muted { fill: none; stroke: #f6b850; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; marker-end: url(#arrowhead); }
</style>
<marker id="arrowhead" markerWidth="10" markerHeight="10" refX="8" refY="5" orient="auto">
<path d="M 0 0 L 10 5 L 0 10 z" fill="#8de0ff"/>
</marker>
</defs>
<rect class="bg" width="720" height="1260" rx="32"/>
<rect class="frame" x="34" y="30" width="652" height="104" rx="22"/>
<text class="title" x="62" y="73">Один owner, две версии проекции</text>
<text class="copy" x="62" y="108">Расхождение видно до следующего действия</text>
<rect class="owner" x="68" y="174" width="584" height="142" rx="20"/>
<text class="section" x="96" y="218">1. order-service — owner</text>
<text class="accent" x="96" y="255">order-417: paid · version 2</text>
<text class="copy" x="96" y="286">Только owner принимает новое доменное решение</text>
<path class="arrow" d="M360 316 L360 358"/>
<rect class="warn" x="68" y="368" width="584" height="142" rx="20"/>
<text class="section" x="96" y="412">2. Проверенный учебный отказ</text>
<text class="copy" x="96" y="449">reason + order version совпадают</text>
<text class="small" x="96" y="480">unknown timeout не становится компенсацией сам</text>
<path class="muted" d="M360 510 L360 552"/>
<rect class="owner" x="68" y="562" width="584" height="164" rx="20"/>
<text class="section" x="96" y="606">3. Новое решение owner-а</text>
<text class="accent" x="96" y="643">compensation key → cancelled · version 3</text>
<text class="copy" x="96" y="678">v2 остаётся фактом истории, а не стирается</text>
<text class="small" x="96" y="706">Создан event: order.cancelled v3</text>
<path class="arrow" d="M360 726 L360 768"/>
<rect class="consumer" x="68" y="778" width="584" height="156" rx="20"/>
<text class="section" x="96" y="822">4. fulfillment получает v3 первой</text>
<text class="copy" x="96" y="859">current v1, expected v2 → defer version gap</text>
<text class="small" x="96" y="890">projection не меняется, evidence сохранён</text>
<text class="small" x="96" y="918">v3 ждёт, а не применяется поверх v1</text>
<path class="arrow" d="M360 934 L360 976"/>
<rect class="ok" x="68" y="986" width="584" height="164" rx="20"/>
<text class="section" x="96" y="1030">5. Приходит v2, затем replay v3</text>
<text class="copy" x="96" y="1067">accepted v1 → awaiting-reservation v2</text>
<text class="copy" x="96" y="1097">→ cancelled v3; duplicate не меняет projection</text>
<text class="accent" x="96" y="1128">readyToShip = false</text>
<path class="arrow" d="M360 1150 L360 1182"/>
<rect class="stop" x="68" y="1190" width="584" height="46" rx="16"/>
<text class="section" x="156" y="1222" style="font-size:23px">Рискованный шаг заблокирован</text>
</svg>