Files
document-haness/docs/clean-architecture-backend-template/final/evidence/rendered/a10-f005-hyperloglog-merge-budget.svg
T
DongHyeonkaandClaude Opus 5 b2963105a8 docs(keycloak-session-store): import the session-storage lab as a new project
The keycloak project ended with four open questions that design could not
settle. A two-VM lab was built to answer them by measurement, and this is
that material: 26 experiments, 125 raw command outputs, 22 browser captures.

Follows the import procedure in README.md.

  source/     the originating repository verbatim — 78 documents, 28 SVGs,
              8 manifests, plus .source-revision recording the commit
  final/      the SSOT
    document.md   729 lines written from the 29 experiment documents, not
                  concatenated: what was predicted, what was measured, and
                  where the measurement itself was wrong
    evidence/raw    125 outputs, flattened to <experiment>__<file> because
                    the originals collided (01-baseline.txt appeared three
                    times) and the audit only globs the top level
    evidence/meta   one per raw file; command and exitCode are null and the
                    README says why rather than inventing them
    evidence/browser  22 captures
    assets/       three diagrams through techviz
    .techviz/     their VizSpecs

A separate project rather than an addition to keycloak: the B-layer answers
that project's four questions, but the A, C and D layers are about cluster
failure, SSO and operations, and one document.md should hold one subject.
The four question records there can point here through 관계.

Recorded rather than papered over: only three of the 28 diagrams were
remade. The repository forbids hand-drawn SVG and forbids titles inside the
canvas; all 28 originals carry both, so converting them is redrawing, not
reformatting. They stay in source/ and the gap is written into the document.

verify-pipeline.py passes. audit-records.py reports no issues.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-04 22:51:59 +09:00

111 lines
11 KiB
XML

<svg xmlns="http://www.w3.org/2000/svg" width="1200" height="1316" viewBox="0 0 1200 1316" role="img">
<title>terminal evidence</title>
<desc>Terminal-style rendering generated from retained command output. Sensitive-looking values are redacted in the visual asset.</desc>
<rect x="1" y="1" width="1198" height="1314" rx="14" fill="#0d1117" stroke="#30363d"/>
<rect x="1" y="1" width="1198" height="44" rx="14" fill="#161b22"/>
<rect x="1" y="30" width="1198" height="14" fill="#161b22"/>
<circle cx="24" cy="22" r="6" fill="#ff5f57"/>
<circle cx="44" cy="22" r="6" fill="#febc2e"/>
<circle cx="64" cy="22" r="6" fill="#28c840"/>
<text x="92" y="27" fill="#8b949e" font-size="14" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace">terminal evidence</text>
<text x="24" y="68" fill="#c9d1d9" font-size="15" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" xml:space="preserve"><tspan x="24" dy="0">$ set -e
D=$(mktemp -d); trap &#x27;rm -rf &quot;$D&quot;&#x27; EXIT
JAR=/shared/codebase/clean-architecture-backend-template/src/adapter/ou</tspan><tspan x="24" dy="22">tbound/cache-redis/build/libs/cache-redis-0.0.1+21234e38cdb9.jar
cat &gt; &quot;$D/BudgetFillProbe.java&quot; &lt;&lt;&#x27;JAVA&#x27;
import dev.cas</tspan><tspan x="24" dy="22">keleton.adapter.outbound.cache.redis.sdk.api.RedisDeploymentMode;
import dev.caskeleton.adapter.outbound.cache.redis.sdk</tspan><tspan x="24" dy="22">.api.command.AdvancedOperationPermit;
import dev.caskeleton.adapter.outbound.cache.redis.sdk.api.command.MultiKeyPermit;</tspan><tspan x="24" dy="22">
import dev.caskeleton.adapter.outbound.cache.redis.sdk.api.command.OperationBudget;
import dev.caskeleton.adapter.outbo</tspan><tspan x="24" dy="22">und.cache.redis.sdk.api.command.PersistentKeyPermit;
import dev.caskeleton.adapter.outbound.cache.redis.sdk.api.command.</tspan><tspan x="24" dy="22">RedisPermitVerifier;
import dev.caskeleton.adapter.outbound.cache.redis.sdk.api.command.RedisPolicyAuthority;
import dev</tspan><tspan x="24" dy="22">.caskeleton.adapter.outbound.cache.redis.sdk.api.key.RedisKeyRenderer;
import dev.caskeleton.adapter.outbound.cache.redi</tspan><tspan x="24" dy="22">s.sdk.api.key.RedisNamespace;
import dev.caskeleton.adapter.outbound.cache.redis.sdk.lettuce.operations.RedisOperationCo</tspan><tspan x="24" dy="22">ntext;
import dev.caskeleton.adapter.outbound.cache.redis.sdk.lettuce.operations.RedisOperationLimits;
public final cla</tspan><tspan x="24" dy="22">ss BudgetFillProbe {
public static void main(String[] args) {
RedisOperationLimits limits = RedisOperationLimits.d</tspan><tspan x="24" dy="22">efaults();
RedisOperationContext ctx =
new RedisOperationContext(
new RedisNamespace(&quot;prod&quot;, &quot;or</tspan><tspan x="24" dy="22">ders&quot;, &quot;cache&quot;),
new RedisKeyRenderer(512),
new RedisPermitVerifier() {
public voi</tspan><tspan x="24" dy="22">d verify(AdvancedOperationPermit p, String s) {}
public void verify(MultiKeyPermit p, String s) {}
</tspan><tspan x="24" dy="22"> public void verify(PersistentKeyPermit p, String s) {}
},
new RedisPolicyAuthority() {
</tspan><tspan x="24" dy="22"> public AdvancedOperationPermit issueAdvanced(String s) { return null; }
public MultiKeyPermit </tspan><tspan x="24" dy="22">issueMultiKey(String s) { return null; }
public PersistentKeyPermit issuePersistentKey(String s) { return </tspan><tspan x="24" dy="22">null; }
},
limits,
RedisDeploymentMode.STANDALONE);
long keyCeiling = dev.caske</tspan><tspan x="24" dy="22">leton.adapter.outbound.cache.redis.sdk.api.key
.RedisKeyRules.MAX_KEY_BYTES;
long pathMax = keyCeiling * lim</tspan><tspan x="24" dy="22">its.maxCollectionElements();
System.out.println(&quot;[SDK가 채워 넣는 budget] collectionBudget(키 수, 요청 바이트)&quot;);
</tspan><tspan x="24" dy="22"> for (long bytes : new long[] {512L, 4_096L, pathMax}) {
OperationBudget b = ctx.collectionBudget(8, bytes);
</tspan><tspan x="24" dy="22"> System.out.printf(
&quot; 요청 %-9d -&gt; maxRequestBytes %-9d allowsRequestBytes(요청) %s%n&quot;,
bytes, b.</tspan><tspan x="24" dy="22">maxRequestBytes(), b.allowsRequestBytes(bytes));
}
System.out.printf(
&quot; 이 경로의 요청 최대 : 렌더된 키</tspan><tspan x="24" dy="22"> %d 바이트 x 요소 천장 %d = %d 바이트%n&quot;,
keyCeiling, limits.maxCollectionElements(), pathMax);
System.out.</tspan><tspan x="24" dy="22">println();
System.out.println(&quot;[호출자가 건네는 budget] 같은 요청을 거부할 수 있다&quot;);
OperationBudget declared =</tspan><tspan x="24" dy="22"> new OperationBudget(8, 4_096L, 65_536L, java.time.Duration.ofSeconds(2));
System.out.printf(
&quot; maxRequestB</tspan><tspan x="24" dy="22">ytes %d, 요청 8192 -&gt; allowsRequestBytes %s%n&quot;,
declared.maxRequestBytes(), declared.allowsRequestBytes(8_192L))</tspan><tspan x="24" dy="22">;
System.out.println();
System.out.println(&quot;[채워 넣은 budget이 실제로 거부하는 것]&quot;);
OperationBudget b = </tspan><tspan x="24" dy="22">ctx.collectionBudget(limits.maxCollectionElements(), 1_024L);
System.out.printf(&quot; 요소 %d개 -&gt; 통과, maxReplyBytes </tspan><tspan x="24" dy="22">%d, timeout %s%n&quot;,
limits.maxCollectionElements(), b.maxReplyBytes(), b.timeout());
try {
ctx.collecti</tspan><tspan x="24" dy="22">onBudget(limits.maxCollectionElements() + 1, 1_024L);
System.out.println(&quot; 요소 1001개 -&gt; 통과&quot;);
} catch (Ru</tspan><tspan x="24" dy="22">ntimeException e) {
System.out.println(&quot; 요소 1001개 -&gt; &quot; + e.getClass().getSimpleName() + &quot;: &quot; + e.getMessage())</tspan><tspan x="24" dy="22">;
}
System.out.println();
System.out.println(&quot;[PFCOUNT/PFMERGE가 선언하는 expectedReplyBytes] 0&quot;);
Syst</tspan><tspan x="24" dy="22">em.out.println(&quot; allowsReplyBytes(0) = &quot; + b.allowsReplyBytes(0L));
}
}
JAVA
java -version 2&gt;&amp;1 | head -1
javac -enco</tspan><tspan x="24" dy="22">ding UTF-8 -cp &quot;$JAR&quot; -d &quot;$D&quot; &quot;$D/BudgetFillProbe.java&quot;
java -Dstdout.encoding=UTF-8 -cp &quot;$JAR:$D&quot; BudgetFillProbe
</tspan></text>
<text x="24" y="838" fill="#8b949e" font-size="13" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" xml:space="preserve"><tspan x="24" dy="0">cwd: /shared/codebase/clean-architecture-backend-template/src/adapter/outbound/cache-redis</tspan></text>
<text x="24" y="860" fill="#8b949e" font-size="13" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" xml:space="preserve"><tspan x="24" dy="0">time: 2026-09-02T12:53:03+00:00 · exit 0</tspan></text>
<line x1="24" y1="874" x2="1176" y2="874" stroke="#30363d"/>
<text x="24" y="914" fill="#e6edf3" font-size="14" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" xml:space="preserve"><tspan x="24" dy="0">openjdk version &quot;21.0.12&quot; 2026-07-21</tspan></text>
<text x="24" y="936" fill="#e6edf3" font-size="14" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" xml:space="preserve"><tspan x="24" dy="0">[SDK가 채워 넣는 budget] collectionBudget(키 수, 요청 바이트)</tspan></text>
<text x="24" y="958" fill="#e6edf3" font-size="14" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" xml:space="preserve"><tspan x="24" dy="0"> 요청 512 -&gt; maxRequestBytes 512 allowsRequestBytes(요청) true</tspan></text>
<text x="24" y="980" fill="#e6edf3" font-size="14" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" xml:space="preserve"><tspan x="24" dy="0"> 요청 4096 -&gt; maxRequestBytes 4096 allowsRequestBytes(요청) true</tspan></text>
<text x="24" y="1002" fill="#e6edf3" font-size="14" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" xml:space="preserve"><tspan x="24" dy="0"> 요청 512000 -&gt; maxRequestBytes 512000 allowsRequestBytes(요청) true</tspan></text>
<text x="24" y="1024" fill="#e6edf3" font-size="14" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" xml:space="preserve"><tspan x="24" dy="0"> 이 경로의 요청 최대 : 렌더된 키 512 바이트 x 요소 천장 1000 = 512000 바이트</tspan></text>
<text x="24" y="1046" fill="#e6edf3" font-size="14" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" xml:space="preserve"><tspan x="24" dy="0"></tspan></text>
<text x="24" y="1068" fill="#e6edf3" font-size="14" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" xml:space="preserve"><tspan x="24" dy="0">[호출자가 건네는 budget] 같은 요청을 거부할 수 있다</tspan></text>
<text x="24" y="1090" fill="#e6edf3" font-size="14" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" xml:space="preserve"><tspan x="24" dy="0"> maxRequestBytes 4096, 요청 8192 -&gt; allowsRequestBytes false</tspan></text>
<text x="24" y="1112" fill="#e6edf3" font-size="14" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" xml:space="preserve"><tspan x="24" dy="0"></tspan></text>
<text x="24" y="1134" fill="#e6edf3" font-size="14" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" xml:space="preserve"><tspan x="24" dy="0">[채워 넣은 budget이 실제로 거부하는 것]</tspan></text>
<text x="24" y="1156" fill="#e6edf3" font-size="14" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" xml:space="preserve"><tspan x="24" dy="0"> 요소 1000개 -&gt; 통과, maxReplyBytes 1048576000, timeout PT2S</tspan></text>
<text x="24" y="1178" fill="#e6edf3" font-size="14" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" xml:space="preserve"><tspan x="24" dy="0"> 요소 1001개 -&gt; RedisCommandRejectedException: operation over 1001 elements exceeds the configured ceiling of 1000 [command=KEY</tspan><tspan x="24" dy="22">, mode=STANDALONE, ambiguous=false]</tspan></text>
<text x="24" y="1222" fill="#e6edf3" font-size="14" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" xml:space="preserve"><tspan x="24" dy="0"></tspan></text>
<text x="24" y="1244" fill="#e6edf3" font-size="14" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" xml:space="preserve"><tspan x="24" dy="0">[PFCOUNT/PFMERGE가 선언하는 expectedReplyBytes] 0</tspan></text>
<text x="24" y="1266" fill="#e6edf3" font-size="14" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" xml:space="preserve"><tspan x="24" dy="0"> allowsReplyBytes(0) = true</tspan></text>
</svg>