92 lines
5.5 KiB
XML
92 lines
5.5 KiB
XML
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 720 1230" role="img" aria-labelledby="cache-consistency-matrix-title cache-consistency-matrix-desc">
|
||
<title id="cache-consistency-matrix-title">Матрица допустимых решений чтения при инвалидации кеша</title>
|
||
<desc id="cache-consistency-matrix-desc">Пять строк показывают отношения source версии, cache entry и события. Совпадающие версии дают hit, отставшая cache версия вызывает rebuild, а private source запрещает публичный ответ и очищает entry.</desc>
|
||
<defs>
|
||
<style>
|
||
.bg { fill: #101827; }
|
||
.title { fill: #f9fafb; font: 700 33px Arial, sans-serif; }
|
||
.subtitle { fill: #cbd5e1; font: 400 20px Arial, sans-serif; }
|
||
.header { fill: #1e3a5f; stroke: #60a5fa; stroke-width: 2; }
|
||
.row { fill: #172554; stroke: #334155; stroke-width: 2; }
|
||
.row-warn { fill: #3f1d2e; stroke: #fb7185; stroke-width: 2; }
|
||
.row-private { fill: #3b2f16; stroke: #fbbf24; stroke-width: 2; }
|
||
.head { fill: #e0f2fe; font: 700 21px Arial, sans-serif; }
|
||
.cell { fill: #e5e7eb; font: 400 21px Arial, sans-serif; }
|
||
.cell-ok { fill: #d1fae5; font: 700 21px Arial, sans-serif; }
|
||
.cell-warn { fill: #fecdd3; font: 700 21px Arial, sans-serif; }
|
||
.cell-private { fill: #fef3c7; font: 700 21px Arial, sans-serif; }
|
||
.line { stroke: #475569; stroke-width: 2; }
|
||
.foot { fill: #94a3b8; font: 400 19px Arial, sans-serif; }
|
||
</style>
|
||
</defs>
|
||
<rect class="bg" width="720" height="1230" rx="28"/>
|
||
<text class="title" x="42" y="64">Матрица: что вправе read</text>
|
||
<text class="subtitle" x="42" y="97">Один owner · одна public projection · учебная модель</text>
|
||
|
||
<rect class="header" x="34" y="132" width="652" height="76" rx="14"/>
|
||
<text class="head" x="54" y="163">SOURCE</text>
|
||
<text class="head" x="214" y="163">CACHE</text>
|
||
<text class="head" x="366" y="163">EVENT</text>
|
||
<text class="head" x="510" y="163">READ</text>
|
||
<text class="head" x="510" y="189">RESULT</text>
|
||
<path class="line" d="M190 132 L190 208 M344 132 L344 208 M488 132 L488 208"/>
|
||
|
||
<rect class="row" x="34" y="224" width="652" height="154" rx="14"/>
|
||
<text class="cell" x="54" y="260">public v1</text>
|
||
<text class="cell" x="214" y="260">public v1</text>
|
||
<text class="cell" x="366" y="260">нет</text>
|
||
<text class="cell-ok" x="510" y="260">hit-current</text>
|
||
<text class="cell" x="54" y="300">version равна</text>
|
||
<text class="cell" x="214" y="300">key совпал</text>
|
||
<text class="cell" x="366" y="300">—</text>
|
||
<text class="cell-ok" x="510" y="300">вернуть v1</text>
|
||
<path class="line" d="M190 224 L190 378 M344 224 L344 378 M488 224 L488 378"/>
|
||
|
||
<rect class="row-warn" x="34" y="394" width="652" height="154" rx="14"/>
|
||
<text class="cell" x="54" y="430">public v2</text>
|
||
<text class="cell" x="214" y="430">public v1</text>
|
||
<text class="cell" x="366" y="430">pending v2</text>
|
||
<text class="cell-warn" x="510" y="430">stale-rebuilt</text>
|
||
<text class="cell" x="54" y="470">source новее</text>
|
||
<text class="cell" x="214" y="470">entry старая</text>
|
||
<text class="cell" x="366" y="470">не доставлен</text>
|
||
<text class="cell-warn" x="510" y="470">вернуть v2</text>
|
||
<path class="line" d="M190 394 L190 548 M344 394 L344 548 M488 394 L488 548"/>
|
||
|
||
<rect class="row" x="34" y="564" width="652" height="154" rx="14"/>
|
||
<text class="cell" x="54" y="600">public v2</text>
|
||
<text class="cell" x="214" y="600">нет</text>
|
||
<text class="cell" x="366" y="600">applied v2</text>
|
||
<text class="cell-ok" x="510" y="600">miss-built</text>
|
||
<text class="cell" x="54" y="640">source current</text>
|
||
<text class="cell" x="214" y="640">evicted</text>
|
||
<text class="cell" x="366" y="640">v1 deleted</text>
|
||
<text class="cell-ok" x="510" y="640">собрать v2</text>
|
||
<path class="line" d="M190 564 L190 718 M344 564 L344 718 M488 564 L488 718"/>
|
||
|
||
<rect class="row" x="34" y="734" width="652" height="154" rx="14"/>
|
||
<text class="cell" x="54" y="770">public v2</text>
|
||
<text class="cell" x="214" y="770">public v2</text>
|
||
<text class="cell" x="366" y="770">late v2</text>
|
||
<text class="cell-ok" x="510" y="770">keep hit</text>
|
||
<text class="cell" x="54" y="810">version равна</text>
|
||
<text class="cell" x="214" y="810">уже rebuilt</text>
|
||
<text class="cell" x="366" y="810">v2 duplicate</text>
|
||
<text class="cell-ok" x="510" y="810">не delete</text>
|
||
<path class="line" d="M190 734 L190 888 M344 734 L344 888 M488 734 L488 888"/>
|
||
|
||
<rect class="row-private" x="34" y="904" width="652" height="166" rx="14"/>
|
||
<text class="cell" x="54" y="940">private v3</text>
|
||
<text class="cell" x="214" y="940">public v2</text>
|
||
<text class="cell" x="366" y="940">pending v3</text>
|
||
<text class="cell-private" x="510" y="940">not-visible</text>
|
||
<text class="cell" x="54" y="980">право изменилось</text>
|
||
<text class="cell" x="214" y="980">недопустима</text>
|
||
<text class="cell" x="366" y="980">не ждём</text>
|
||
<text class="cell-private" x="510" y="980">deny + evict</text>
|
||
<path class="line" d="M190 904 L190 1070 M344 904 L344 1070 M488 904 L488 1070"/>
|
||
|
||
<text class="foot" x="42" y="1132">TTL может ограничить жизнь entry, но не доказывает current version.</text>
|
||
<text class="foot" x="42" y="1164">Это не Redis, CDN, browser cache или измерение production traffic.</text>
|
||
</svg>
|