Files
document-haness/docs/clean-architecture-backend-template/final/evidence/rendered/a10-f004-pub-sub-bound.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

148 lines
14 KiB
XML

<svg xmlns="http://www.w3.org/2000/svg" width="1200" height="1734" viewBox="0 0 1200 1734" 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="1732" 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/PubSubBoundProbe.java&quot; &lt;&lt;&#x27;JAVA&#x27;
import dev.ca</tspan><tspan x="24" dy="22">skeleton.adapter.outbound.cache.redis.sdk.api.codec.RedisCodec;
import dev.caskeleton.adapter.outbound.cache.redis.sdk.a</tspan><tspan x="24" dy="22">pi.key.QualifiedRedisKey;
import dev.caskeleton.adapter.outbound.cache.redis.sdk.api.key.RedisKeyName;
import dev.caskel</tspan><tspan x="24" dy="22">eton.adapter.outbound.cache.redis.sdk.api.key.RedisKeyRenderer;
import dev.caskeleton.adapter.outbound.cache.redis.sdk.a</tspan><tspan x="24" dy="22">pi.key.RedisKeyRules;
import dev.caskeleton.adapter.outbound.cache.redis.sdk.api.key.RedisNamespace;
import dev.caskelet</tspan><tspan x="24" dy="22">on.adapter.outbound.cache.redis.sdk.api.key.RedisSlotTag;
import dev.caskeleton.adapter.outbound.cache.redis.sdk.api.ope</tspan><tspan x="24" dy="22">rations.PubSubChannel;
import dev.caskeleton.adapter.outbound.cache.redis.sdk.api.operations.PubSubPattern;
import dev.c</tspan><tspan x="24" dy="22">askeleton.adapter.outbound.cache.redis.sdk.api.operations.ShardedPubSubChannel;
import java.nio.charset.StandardCharsets</tspan><tspan x="24" dy="22">;
public final class PubSubBoundProbe {
private static String token(int n) {
return &quot;a&quot;.repeat(n - 1) + &quot;z&quot;;
}</tspan><tspan x="24" dy="22">
private static int bytes(String s) {
return s.getBytes(StandardCharsets.UTF_8).length;
}
private static fin</tspan><tspan x="24" dy="22">al RedisCodec&lt;String&gt; CODEC =
new RedisCodec&lt;&gt;() {
public String id() { return &quot;probe-utf8&quot;; }
pub</tspan><tspan x="24" dy="22">lic byte[] encode(String v) { return v.getBytes(StandardCharsets.UTF_8); }
public String decode(byte[] b) { retu</tspan><tspan x="24" dy="22">rn new String(b, StandardCharsets.UTF_8); }
};
public static void main(String[] args) {
RedisNamespace ns =</tspan><tspan x="24" dy="22"> new RedisNamespace(token(64), token(64), token(64));
RedisKeyName name = new RedisKeyName(token(64), token(128));
</tspan><tspan x="24" dy="22"> System.out.println(&quot;MAX_KEY_BYTES = &quot; + RedisKeyRules.MAX_KEY_BYTES);
System.out.println();
System.out.print</tspan><tspan x="24" dy="22">ln(&quot;[구성 요소의 상한] 토큰 64, 식별자 128, 슬롯 태그 128&quot;);
System.out.println(&quot; namespace.prefix() 길이 : &quot; + byt</tspan><tspan x="24" dy="22">es(ns.prefix()));
System.out.println();
System.out.println(&quot;[채널] 구성 요소를 최대로 채운 렌더&quot;);
String c</tspan><tspan x="24" dy="22">h = new PubSubChannel&lt;&gt;(ns, name, CODEC).render();
String sh = new ShardedPubSubChannel&lt;&gt;(ns, name, CODEC).render();</tspan><tspan x="24" dy="22">
System.out.printf(&quot; PubSubChannel 렌더 %d 바이트 여유 %d%n&quot;,
bytes(ch), RedisKeyRules.MAX_KEY_BYTE</tspan><tspan x="24" dy="22">S - bytes(ch));
System.out.printf(&quot; ShardedPubSubChannel 렌더 %d 바이트 여유 %d%n&quot;,
bytes(sh), RedisKeyRul</tspan><tspan x="24" dy="22">es.MAX_KEY_BYTES - bytes(sh));
System.out.println();
System.out.println(&quot;[키] 같은 규칙을 받은 조각들, 슬롯 태</tspan><tspan x="24" dy="22">그 하나가 더 붙는다&quot;);
RedisKeyRenderer renderer = new RedisKeyRenderer(RedisKeyRules.MAX_KEY_BYTES);
System.out</tspan><tspan x="24" dy="22">.println(&quot; 태그 없음 -&gt; 렌더 &quot; + bytes(renderer.render(QualifiedRedisKey.of(ns, name))) + &quot; 바이트&quot;);
QualifiedRedi</tspan><tspan x="24" dy="22">sKey tagged =
QualifiedRedisKey.tagged(ns, name, new RedisSlotTag(token(128)));
try {
System.out.print</tspan><tspan x="24" dy="22">ln(&quot; 태그 있음 -&gt; 렌더 &quot; + bytes(renderer.render(tagged)) + &quot; 바이트&quot;);
} catch (IllegalArgumentException e) {
</tspan><tspan x="24" dy="22"> System.out.println(&quot; 태그 있음 -&gt; &quot; + e.getMessage());
}
System.out.println();
System.out.println(&quot;[기본</tspan><tspan x="24" dy="22"> 이름공간] 설정 기본값 local:sample-service:shared&quot;);
RedisNamespace def = new RedisNamespace(&quot;local&quot;, &quot;sample-servi</tspan><tspan x="24" dy="22">ce&quot;, &quot;shared&quot;);
System.out.println(&quot; prefix 길이 : &quot; + bytes(def.prefix()));
System.out.println(&quot; 채널 렌더 </tspan><tspan x="24" dy="22">: &quot; + bytes(new PubSubChannel&lt;&gt;(def, name, CODEC).render()) + &quot; 바이트&quot;);
QualifiedRedisKey defTagged =
Qual</tspan><tspan x="24" dy="22">ifiedRedisKey.tagged(def, name, new RedisSlotTag(token(128)));
try {
System.out.println(&quot; 태그 붙인 키 : &quot; + </tspan><tspan x="24" dy="22">bytes(renderer.render(defTagged)) + &quot; 바이트&quot;);
} catch (IllegalArgumentException e) {
System.out.println(&quot; </tspan><tspan x="24" dy="22">태그 붙인 키 -&gt; &quot; + e.getMessage());
}
System.out.println();
System.out.println(&quot;[패턴] 접미가 토큰 규칙을 </tspan><tspan x="24" dy="22">받지 않는다 (이름공간은 위와 같은 최대치)&quot;);
for (int n : new int[] {64, 317, 318}) {
try {
PubSubPatt</tspan><tspan x="24" dy="22">ern&lt;String&gt; p = new PubSubPattern&lt;&gt;(ns, token(n), CODEC);
System.out.printf(&quot; suffix %-4d -&gt; 생성됨, 렌더 %d 바</tspan><tspan x="24" dy="22">이트%n&quot;, n, bytes(p.render()));
} catch (IllegalArgumentException e) {
System.out.printf(&quot; suffix %-4d -&gt;</tspan><tspan x="24" dy="22"> %s%n&quot;, n, e.getMessage());
}
}
System.out.println();
System.out.println(&quot;[상한을 어디서 가져오는가]&quot;</tspan><tspan x="24" dy="22">);
System.out.println(&quot; RedisKeyRenderer : 생성자 인자 (1..512)&quot;);
System.out.println(&quot; PubSubPattern : Red</tspan><tspan x="24" dy="22">isKeyRules.MAX_KEY_BYTES 상수&quot;);
RedisKeyRenderer tight = new RedisKeyRenderer(256);
try {
tight.render(Qu</tspan><tspan x="24" dy="22">alifiedRedisKey.of(ns, name));
System.out.println(&quot; 상한 256 렌더러에 키 388 바이트 -&gt; 통과&quot;);
} catch (Illeg</tspan><tspan x="24" dy="22">alArgumentException e) {
System.out.println(&quot; 상한 256 렌더러에 키 -&gt; &quot; + e.getMessage());
}
System.out.p</tspan><tspan x="24" dy="22">rintln(&quot; 같은 배포의 채널 &quot; + bytes(ch) + &quot; 바이트 -&gt; 검사 없음&quot;);
}
}
JAVA
javac -encoding UTF-8 -cp &quot;$JAR&quot; -d &quot;$D&quot; </tspan><tspan x="24" dy="22">&quot;$D/PubSubBoundProbe.java&quot;
java -Dstdout.encoding=UTF-8 -cp &quot;$JAR:$D&quot; PubSubBoundProbe
</tspan></text>
<text x="24" y="1014" 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="1036" 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-02T11:21:34+00:00 · exit 0</tspan></text>
<line x1="24" y1="1050" x2="1176" y2="1050" stroke="#30363d"/>
<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">MAX_KEY_BYTES = 512</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">[구성 요소의 상한] 토큰 64, 식별자 128, 슬롯 태그 128</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"> namespace.prefix() 길이 : 194</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"></tspan></text>
<text x="24" y="1200" 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="1222" fill="#e6edf3" font-size="14" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" xml:space="preserve"><tspan x="24" dy="0"> PubSubChannel 렌더 388 바이트 여유 124</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"> ShardedPubSubChannel 렌더 388 바이트 여유 124</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"></tspan></text>
<text x="24" y="1288" 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="1310" fill="#e6edf3" font-size="14" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" xml:space="preserve"><tspan x="24" dy="0"> 태그 없음 -&gt; 렌더 388 바이트</tspan></text>
<text x="24" y="1332" fill="#e6edf3" font-size="14" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" xml:space="preserve"><tspan x="24" dy="0"> 태그 있음 -&gt; rendered key is 519 bytes and exceeds the configured 512</tspan></text>
<text x="24" y="1354" 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="1376" fill="#e6edf3" font-size="14" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" xml:space="preserve"><tspan x="24" dy="0">[기본 이름공간] 설정 기본값 local:sample-service:shared</tspan></text>
<text x="24" y="1398" fill="#e6edf3" font-size="14" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" xml:space="preserve"><tspan x="24" dy="0"> prefix 길이 : 27</tspan></text>
<text x="24" y="1420" fill="#e6edf3" font-size="14" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" xml:space="preserve"><tspan x="24" dy="0"> 채널 렌더 : 221 바이트</tspan></text>
<text x="24" y="1442" fill="#e6edf3" font-size="14" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" xml:space="preserve"><tspan x="24" dy="0"> 태그 붙인 키 : 352 바이트</tspan></text>
<text x="24" y="1464" 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="1486" 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="1508" fill="#e6edf3" font-size="14" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" xml:space="preserve"><tspan x="24" dy="0"> suffix 64 -&gt; 생성됨, 렌더 259 바이트</tspan></text>
<text x="24" y="1530" fill="#e6edf3" font-size="14" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" xml:space="preserve"><tspan x="24" dy="0"> suffix 317 -&gt; 생성됨, 렌더 512 바이트</tspan></text>
<text x="24" y="1552" fill="#e6edf3" font-size="14" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" xml:space="preserve"><tspan x="24" dy="0"> suffix 318 -&gt; rendered key is 513 bytes and exceeds the configured 512</tspan></text>
<text x="24" y="1574" 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="1596" 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="1618" fill="#e6edf3" font-size="14" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" xml:space="preserve"><tspan x="24" dy="0"> RedisKeyRenderer : 생성자 인자 (1..512)</tspan></text>
<text x="24" y="1640" fill="#e6edf3" font-size="14" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" xml:space="preserve"><tspan x="24" dy="0"> PubSubPattern : RedisKeyRules.MAX_KEY_BYTES 상수</tspan></text>
<text x="24" y="1662" fill="#e6edf3" font-size="14" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" xml:space="preserve"><tspan x="24" dy="0"> 상한 256 렌더러에 키 -&gt; rendered key is 388 bytes and exceeds the configured 256</tspan></text>
<text x="24" y="1684" fill="#e6edf3" font-size="14" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" xml:space="preserve"><tspan x="24" dy="0"> 같은 배포의 채널 388 바이트 -&gt; 검사 없음</tspan></text>
</svg>