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

65 lines
4.4 KiB
XML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<svg xmlns="http://www.w3.org/2000/svg" width="720" height="1280" viewBox="0 0 720 1280" role="img" aria-labelledby="title desc">
<title id="title">Контролируемая компенсация между owner и consumer</title>
<desc id="desc">Вертикальная схема отделяет отказ учебного резерва, проверку owner-а, запись компенсационного ключа и новое событие отмены от обработки consumer-ом и подавления дубликата.</desc>
<defs>
<style>
.bg { fill: #0b1220; }
.frame { fill: #101c31; stroke: #2e4264; stroke-width: 3; }
.owner { fill: #153a5b; stroke: #55b6e6; stroke-width: 3; }
.check { fill: #47351a; stroke: #f6c45a; stroke-width: 3; }
.ledger { fill: #24473f; stroke: #6bd5b5; stroke-width: 3; }
.consumer { fill: #293950; stroke: #a8c8e7; stroke-width: 3; }
.stop { fill: #552b35; stroke: #ff8992; 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; }
.green { fill: #93e6cb; font: 700 22px Arial, sans-serif; }
.arrow { fill: none; stroke: #8de0ff; 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="1280" 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="122" rx="20"/>
<text class="section" x="96" y="218">1. Owner: paid · version 2</text>
<text class="copy" x="96" y="255">Исходное решение и объект известны</text>
<path class="arrow" d="M360 296 L360 334"/>
<rect class="check" x="68" y="344" width="584" height="142" rx="20"/>
<text class="section" x="96" y="388">2. Вход для компенсации</text>
<text class="copy" x="96" y="425">reason, order id и version проверены</text>
<text class="small" x="96" y="456">unknown timeout → не автоматическая отмена</text>
<path class="arrow" d="M360 486 L360 524"/>
<rect class="ledger" x="68" y="534" width="584" height="162" rx="20"/>
<text class="section" x="96" y="578">3. Локальный compensation ledger</text>
<text class="green" x="96" y="615">key: order-417 / reservation / v2</text>
<text class="copy" x="96" y="646">тот же вход второй раз → already-recorded</text>
<text class="small" x="96" y="675">одна локальная граница, не две базы сразу</text>
<path class="arrow" d="M360 696 L360 734"/>
<rect class="owner" x="68" y="744" width="584" height="142" rx="20"/>
<text class="section" x="96" y="788">4. Owner создаёт cancelled · v3</text>
<text class="accent" x="96" y="825">event id + source + type + version</text>
<text class="copy" x="96" y="856">v2 не удаляется; появляется следующий факт</text>
<path class="arrow" d="M360 886 L360 924"/>
<rect class="consumer" x="68" y="934" width="584" height="164" rx="20"/>
<text class="section" x="96" y="978">5. Consumer применяет по version</text>
<text class="copy" x="96" y="1015">v3 до v2 → defer с expected version</text>
<text class="copy" x="96" y="1045">v2 → apply; затем replay v3</text>
<text class="small" x="96" y="1076">тот же event id → duplicate suppressed</text>
<path class="arrow" d="M360 1098 L360 1136"/>
<rect class="stop" x="68" y="1146" width="584" height="92" rx="20"/>
<text class="section" x="96" y="1186">6. Предел контракта</text>
<text class="copy" x="96" y="1219">Нет version + evidence → нет следующего effect</text>
</svg>