feat: 가상화 문서들 추가

This commit is contained in:
DongHyeonka
2026-09-10 08:54:05 +09:00
parent e9f6a93327
commit 43e1aadef0
695 changed files with 153404 additions and 12754 deletions
@@ -0,0 +1,83 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" width="870" height="542" viewBox="0 0 870 542" role="img" aria-labelledby="diagram-title diagram-description">
<title id="diagram-title">배치는 부모를 먼저 페이징하고 자식을 IN으로 따로 가져온다</title>
<desc id="diagram-description">조회 코드가 부모 페이지를 요청하면 세션이 feed_items에 부모만 LIMIT으로 조회한다. 돌아온 부모에는 초기화되지 않은 컬렉션 프록시가 붙어 있다. 세션은 그 프록시를 batch fetch size만큼 모아 highlights를 WHERE fk IN 으로 조회하고, 받은 자식 행으로 컬렉션을 채워 조회 코드에 돌려준다.</desc>
<metadata>{&quot;techviz&quot;:{&quot;spec_version&quot;:&quot;1.1&quot;,&quot;id&quot;:&quot;batch-fetch-in-clause&quot;,&quot;profile&quot;:&quot;sequence&quot;},&quot;source_context&quot;:{&quot;document&quot;:&quot;docs/n+1liner/final/document.md&quot;,&quot;document_sha256&quot;:&quot;385ca44db5bf763cb1ff28a67d531d68876402b35d21dc54f2bc702e8bda0053&quot;,&quot;anchor&quot;:{&quot;kind&quot;:&quot;heading&quot;,&quot;value&quot;:&quot;11.5 배치가 N+1과 페이징을 함께 해결하는 이유&quot;,&quot;line&quot;:1007}},&quot;evidence_policy&quot;:&quot;Each factual element cites source lines or is marked assumption.&quot;,&quot;diagram_only&quot;:true}</metadata>
<defs>
<marker id="arrow" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse">
<path d="M 0 0 L 10 5 L 0 10 z" />
</marker>
<style>
:root { color-scheme: light; }
text { font-family: Inter, Pretendard, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; fill: #111827; }
.canvas { fill: #ffffff; }
.group-box { fill: #ffffff; stroke: #9ca3af; stroke-width: 1.4; stroke-dasharray: 7 5; }
.group-label-bg { fill: #ffffff; }
.group-label { font-size: 13px; font-weight: 650; fill: #374151; }
.edge { fill: none; stroke: #374151; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; marker-end: url(#arrow); }
.edge.style-dashed, .edge.semantic-dashed, .edge.assumption { stroke-dasharray: 7 5; }
.edge.style-dotted { stroke-dasharray: 2 5; }
.edge.emphasis-primary { stroke: #2563eb; stroke-width: 2.2; }
.edge.emphasis-muted { stroke: #9ca3af; }
.edge.emphasis-warning, .edge.kind-failure, .edge.kind-error { stroke: #dc2626; stroke-width: 2.2; }
.edge-label-bg { fill: #ffffff; }
.edge-label { font-size: 12px; font-weight: 560; text-anchor: middle; }
.node-shape { fill: #ffffff; stroke: #4b5563; stroke-width: 1.7; }
.node-shape.emphasis-primary { stroke: #2563eb; stroke-width: 2.2; }
.node-shape.emphasis-muted { stroke: #9ca3af; fill: #f9fafb; }
.node-shape.emphasis-warning { stroke: #d97706; stroke-width: 2; fill: #fffdf5; }
.node-shape.kind-database, .node-shape.kind-datastore, .node-shape.kind-storage { fill: #f8fafc; }
.node-shape.kind-queue, .node-shape.kind-event, .node-shape.kind-topic { fill: #fafafa; }
.node-shape.assumption { stroke-dasharray: 4 4; }
.storage-bottom, .controller-divider { fill: none; stroke: #4b5563; stroke-width: 1.4; }
.controller-led { fill: #4b5563; }
.actor-symbol { fill: none; stroke: #4b5563; stroke-width: 1.8; stroke-linecap: round; }
.actor-symbol.emphasis-primary { stroke: #2563eb; stroke-width: 2.2; }
.node-label { font-size: 14px; font-weight: 650; text-anchor: middle; }
.node-role { font-size: 10px; letter-spacing: 0.04em; text-anchor: middle; fill: #6b7280; }
.node-detail-divider { stroke: #d1d5db; stroke-width: 1; }
.node-detail { font-size: 11px; fill: #374151; }
.assumption-badge { font-size: 9px; font-weight: 700; fill: #92400e; }
.failure-mark { stroke: #dc2626; stroke-width: 4; stroke-linecap: round; }
.lifeline { stroke: #9ca3af; stroke-width: 1.2; stroke-dasharray: 5 5; }
.timeline-axis { stroke: #374151; stroke-width: 1.8; marker-end: url(#arrow); }
.timeline-stem { stroke: #6b7280; stroke-width: 1.3; }
.timeline-marker { fill: #ffffff; stroke: #374151; stroke-width: 1.7; }
.timeline-marker.primary { fill: #2563eb; stroke: #2563eb; }
.timeline-marker.warning { fill: #dc2626; stroke: #dc2626; }
.timeline-label { font-size: 13px; font-weight: 650; text-anchor: middle; }
.timeline-detail { font-size: 11px; fill: #4b5563; text-anchor: middle; }
</style>
</defs>
<rect class="canvas" width="870" height="542" />
<g class="actor-symbol emphasis-normal" data-evidence="1009-1010"><circle cx="120.0" cy="55.0" r="11.0" /><line x1="120.0" y1="71.0" x2="120.0" y2="74.0" /><line x1="102.0" y1="81.0" x2="138.0" y2="81.0" /><line x1="120.0" y1="74.0" x2="105.0" y2="91.0" /><line x1="120.0" y1="74.0" x2="135.0" y2="91.0" /></g>
<text class="node-label" x="120.0" y="106.0">조회 코드</text>
<line class="lifeline" x1="120.0" y1="113.0" x2="120.0" y2="512.0" />
<rect class="node-shape kind-service emphasis-normal role-participant" data-evidence="1010-1012" x="255.0" y="35.0" width="150.0" height="64.0" rx="7" />
<text class="node-label" x="330.0" y="65.0">Hibernate 세션</text>
<line class="lifeline" x1="330.0" y1="99.0" x2="330.0" y2="512.0" />
<rect class="node-shape kind-store emphasis-normal role-participant" data-evidence="1009-1010" x="465.0" y="48.0" width="150.0" height="52.0" /><ellipse class="node-shape kind-store emphasis-normal role-participant" cx="540.0" cy="48.0" rx="75.0" ry="13.0" /><path class="storage-bottom" d="M 465.0 100.0 A 75.0 13.0 0 0 0 615.0 100.0" />
<text class="node-label" x="540.0" y="75.0">feed_items</text>
<line class="lifeline" x1="540.0" y1="113.0" x2="540.0" y2="512.0" />
<rect class="node-shape kind-store emphasis-normal role-participant" data-evidence="1010-1011" x="675.0" y="48.0" width="150.0" height="52.0" /><ellipse class="node-shape kind-store emphasis-normal role-participant" cx="750.0" cy="48.0" rx="75.0" ry="13.0" /><path class="storage-bottom" d="M 675.0 100.0 A 75.0 13.0 0 0 0 825.0 100.0" />
<text class="node-label" x="750.0" y="75.0">highlights</text>
<line class="lifeline" x1="750.0" y1="113.0" x2="750.0" y2="512.0" />
<polyline class="edge kind-request style-solid emphasis-normal" points="120.0,140.0 330.0,140.0" data-evidence="1009-1010" />
<rect class="edge-label-bg" x="175.8" y="114.0" width="98.4" height="22" rx="3" />
<text class="edge-label" x="225.0" y="129.0">1. 부모 페이지 요청</text>
<polyline class="edge kind-query style-solid emphasis-normal" points="330.0,202.0 540.0,202.0" data-evidence="1009-1010" />
<rect class="edge-label-bg" x="375.8" y="176.0" width="118.5" height="22" rx="3" />
<text class="edge-label" x="435.0" y="191.0">2. 부모 LIMIT 페이징</text>
<polyline class="edge kind-response style-dashed emphasis-normal semantic-dashed" points="540.0,264.0 330.0,264.0" data-evidence="1010-1012" />
<rect class="edge-label-bg" x="359.0" y="238.0" width="152.0" height="22" rx="3" />
<text class="edge-label" x="435.0" y="253.0">3. 페이지 부모 + 미초기화 프록시</text>
<polyline class="edge kind-query style-solid emphasis-normal" points="330.0,326.0 750.0,326.0" data-evidence="1010-1012" />
<rect class="edge-label-bg" x="453.9" y="300.0" width="172.1" height="22" rx="3" />
<text class="edge-label" x="540.0" y="315.0">4. WHERE fk IN (?,…) 배치</text>
<polyline class="edge kind-response style-dashed emphasis-normal semantic-dashed" points="750.0,388.0 330.0,388.0" data-evidence="1010-1011" />
<rect class="edge-label-bg" x="507.6" y="362.0" width="64.9" height="22" rx="3" />
<text class="edge-label" x="540.0" y="377.0">5. 자식 행</text>
<polyline class="edge kind-response style-dashed emphasis-normal semantic-dashed" points="330.0,450.0 120.0,450.0" data-evidence="1012-1014" />
<rect class="edge-label-bg" x="179.2" y="424.0" width="91.7" height="22" rx="3" />
<text class="edge-label" x="225.0" y="439.0">6. 부모 + 컬렉션</text>
</svg>

After

Width:  |  Height:  |  Size: 7.8 KiB