Current section

Files

Jump to
reckon_db assets subscription_flow.svg
Raw

assets/subscription_flow.svg

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 550 280">
<defs>
<linearGradient id="clientGrad" x1="0%" y1="0%" x2="0%" y2="100%">
<stop offset="0%" style="stop-color:#e8f5e9"/>
<stop offset="100%" style="stop-color:#c8e6c9"/>
</linearGradient>
<linearGradient id="esdbGrad" x1="0%" y1="0%" x2="0%" y2="100%">
<stop offset="0%" style="stop-color:#e3f2fd"/>
<stop offset="100%" style="stop-color:#bbdefb"/>
</linearGradient>
<linearGradient id="khepriGrad" x1="0%" y1="0%" x2="0%" y2="100%">
<stop offset="0%" style="stop-color:#e1bee7"/>
<stop offset="100%" style="stop-color:#ce93d8"/>
</linearGradient>
<linearGradient id="subGrad" x1="0%" y1="0%" x2="0%" y2="100%">
<stop offset="0%" style="stop-color:#fff3e0"/>
<stop offset="100%" style="stop-color:#ffe0b2"/>
</linearGradient>
<marker id="arrow" markerWidth="8" markerHeight="8" refX="7" refY="3" orient="auto" markerUnits="strokeWidth">
<path d="M0,0 L0,6 L8,3 z" fill="#666"/>
</marker>
</defs>
<!-- Title -->
<text x="275" y="20" text-anchor="middle" font-family="Arial, sans-serif" font-size="14" font-weight="bold" fill="#333">Event Write Flow with Subscriptions</text>
<!-- Participant headers -->
<rect x="30" y="40" width="80" height="30" rx="5" fill="url(#clientGrad)" stroke="#4caf50" stroke-width="1.5"/>
<text x="70" y="60" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" font-weight="bold" fill="#2e7d32">Client</text>
<rect x="160" y="40" width="80" height="30" rx="5" fill="url(#esdbGrad)" stroke="#2196f3" stroke-width="1.5"/>
<text x="200" y="60" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" font-weight="bold" fill="#1565c0">reckon-db</text>
<rect x="290" y="40" width="80" height="30" rx="5" fill="url(#khepriGrad)" stroke="#9c27b0" stroke-width="1.5"/>
<text x="330" y="60" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" font-weight="bold" fill="#7b1fa2">Khepri/Ra</text>
<rect x="420" y="40" width="100" height="30" rx="5" fill="url(#subGrad)" stroke="#ff9800" stroke-width="1.5"/>
<text x="470" y="60" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" font-weight="bold" fill="#e65100">Subscribers</text>
<!-- Lifelines -->
<line x1="70" y1="70" x2="70" y2="260" stroke="#4caf50" stroke-width="1" stroke-dasharray="4,4"/>
<line x1="200" y1="70" x2="200" y2="260" stroke="#2196f3" stroke-width="1" stroke-dasharray="4,4"/>
<line x1="330" y1="70" x2="330" y2="260" stroke="#9c27b0" stroke-width="1" stroke-dasharray="4,4"/>
<line x1="470" y1="70" x2="470" y2="260" stroke="#ff9800" stroke-width="1" stroke-dasharray="4,4"/>
<!-- Step 1: append(events) -->
<line x1="70" y1="95" x2="195" y2="95" stroke="#666" stroke-width="1.5" marker-end="url(#arrow)"/>
<text x="135" y="88" text-anchor="middle" font-family="monospace" font-size="9" fill="#333">append(events)</text>
<!-- Step 2: put(events) -->
<line x1="200" y1="120" x2="325" y2="120" stroke="#666" stroke-width="1.5" marker-end="url(#arrow)"/>
<text x="265" y="113" text-anchor="middle" font-family="monospace" font-size="9" fill="#333">put(events)</text>
<!-- Step 3: Raft consensus box -->
<rect x="305" y="135" width="50" height="30" rx="3" fill="#f3e5f5" stroke="#9c27b0"/>
<text x="330" y="152" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#7b1fa2">Raft</text>
<text x="330" y="162" text-anchor="middle" font-family="Arial, sans-serif" font-size="7" fill="#999">replicate</text>
<!-- Step 4: {ok, version} -->
<line x1="325" y1="180" x2="205" y2="180" stroke="#666" stroke-width="1.5" marker-end="url(#arrow)"/>
<text x="265" y="173" text-anchor="middle" font-family="monospace" font-size="9" fill="#333">{ok, version}</text>
<!-- Step 5: Trigger fires -->
<line x1="330" y1="200" x2="330" y2="210" stroke="#9c27b0" stroke-width="1.5"/>
<rect x="295" y="210" width="70" height="20" rx="3" fill="#fce4ec" stroke="#e91e63"/>
<text x="330" y="224" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#ad1457">Trigger fires</text>
<!-- Step 6: Emitter broadcasts -->
<line x1="365" y1="220" x2="465" y2="220" stroke="#ff9800" stroke-width="1.5" marker-end="url(#arrow)"/>
<text x="415" y="213" text-anchor="middle" font-family="monospace" font-size="9" fill="#333">{event, E}</text>
<!-- Step 7: Return to client -->
<line x1="195" y1="245" x2="75" y2="245" stroke="#666" stroke-width="1.5" marker-end="url(#arrow)"/>
<text x="135" y="238" text-anchor="middle" font-family="monospace" font-size="9" fill="#333">{ok, version}</text>
<!-- Guarantee note -->
<text x="275" y="275" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#666">Triggers fire AFTER Raft consensus - subscribers never see uncommitted events</text>
</svg>