Files
hse-2026/materials/09-data-replication/seminar/media/wal.svg
T
2026-11-12 11:31:33 +03:00

131 lines
8.8 KiB
XML

<?xml version="1.0" encoding="UTF-8" standalone="no"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" contentStyleType="text/css" height="249px" preserveAspectRatio="none" style="width:699px;height:249px;background:#FFFFFF;" version="1.1" viewBox="0 0 699 249" width="699px" zoomAndPan="magnify"><defs/><g><g id="elem_Client"><rect fill="#F1F1F1" height="21.6094" style="stroke:#181818;stroke-width:0.5;" width="50" x="7" y="49"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="36" x="14" y="65.5332">Client</text></g><g id="elem_KVStore"><rect fill="#F1F1F1" height="21.6094" style="stroke:#181818;stroke-width:0.5;" width="66" x="271.5" y="49"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="52" x="278.5" y="65.5332">KVStore</text></g><g id="elem_Log"><rect fill="#F1F1F1" height="108.0469" style="stroke:#181818;stroke-width:0.5;" width="139" x="235" y="134"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="24" x="292.5" y="150.5332">Log</text><line style="stroke:#181818;stroke-width:1.0;" x1="235" x2="374" y1="155.6094" y2="155.6094"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="8" x="240" y="172.1426">1</text><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="111" x="258" y="172.1426">Set(key1, value1)</text><line style="stroke:#181818;stroke-width:1.0;" x1="253" x2="253" y1="155.6094" y2="177.2188"/><line style="stroke:#181818;stroke-width:1.0;" x1="235" x2="374" y1="177.2188" y2="177.2188"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="8" x="240" y="193.752">2</text><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="111" x="258" y="193.752">Set(key2, value4)</text><line style="stroke:#181818;stroke-width:1.0;" x1="253" x2="253" y1="177.2188" y2="198.8281"/><line style="stroke:#181818;stroke-width:1.0;" x1="235" x2="374" y1="198.8281" y2="198.8281"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="8" x="240" y="215.3613">3</text><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="111" x="258" y="215.3613">Set(key3, value3)</text><line style="stroke:#181818;stroke-width:1.0;" x1="253" x2="253" y1="198.8281" y2="220.4375"/><line style="stroke:#181818;stroke-width:1.0;" x1="235" x2="374" y1="220.4375" y2="220.4375"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="8" x="240" y="236.9707">4</text><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="111" x="258" y="236.9707">Set(key4, value4)</text><line style="stroke:#181818;stroke-width:1.0;" x1="253" x2="253" y1="220.4375" y2="242.0469"/></g><g id="elem_GMN149"><path d="M565,165 L565,182.5 L382.22,186.5 L565,190.5 L565,207.7031 A0,0 0 0 0 565,207.7031 L692,207.7031 A0,0 0 0 0 692,207.7031 L692,175 L682,165 L565,165 A0,0 0 0 0 565,165 " fill="#F7F8FE" style="stroke:#181818;stroke-width:0.5;"/><path d="M682,165 L682,175 L692,175 L682,165 " fill="#F7F8FE" style="stroke:#181818;stroke-width:0.5;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="97" x="571" y="183.4951">Write Ahead Log</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="106" x="571" y="199.8467">/var/log/wal000.log</text></g><g id="elem_Storage"><rect fill="#F1F1F1" height="108.0469" style="stroke:#181818;stroke-width:0.5;" width="92" x="582.5" y="7"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="50" x="603.5" y="23.5332">Storage</text><line style="stroke:#181818;stroke-width:1.0;" x1="582.5" x2="674.5" y1="28.6094" y2="28.6094"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="30" x="587.5" y="45.1426">key1</text><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="42" x="627.5" y="45.1426">value1</text><line style="stroke:#181818;stroke-width:1.0;" x1="622.5" x2="622.5" y1="28.6094" y2="50.2188"/><line style="stroke:#181818;stroke-width:1.0;" x1="582.5" x2="674.5" y1="50.2188" y2="50.2188"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="30" x="587.5" y="66.752">key2</text><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="42" x="627.5" y="66.752">value2</text><line style="stroke:#181818;stroke-width:1.0;" x1="622.5" x2="622.5" y1="50.2188" y2="71.8281"/><line style="stroke:#181818;stroke-width:1.0;" x1="582.5" x2="674.5" y1="71.8281" y2="71.8281"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="30" x="587.5" y="88.3613">key3</text><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="42" x="627.5" y="88.3613">value3</text><line style="stroke:#181818;stroke-width:1.0;" x1="622.5" x2="622.5" y1="71.8281" y2="93.4375"/><line style="stroke:#181818;stroke-width:1.0;" x1="582.5" x2="674.5" y1="93.4375" y2="93.4375"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="30" x="587.5" y="109.9707">key4</text><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="42" x="627.5" y="109.9707">value4</text><line style="stroke:#181818;stroke-width:1.0;" x1="622.5" x2="622.5" y1="93.4375" y2="115.0469"/></g><!--MD5=[ba17a017a94be6b6cb9e4f6f8df77bf3]
link Client to KVStore--><g id="link_Client_KVStore"><path codeLine="36" d="M65.09,59.5 C112.95,59.5 203.23,59.5 257.92,59.5 " fill="none" id="Client-to-KVStore" style="stroke:#070D4A;stroke-width:1.0;"/><polygon fill="#070D4A" points="263.1,59.5,254.1,55.5,258.1,59.5,254.1,63.5,263.1,59.5" style="stroke:#070D4A;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="100" x="96" y="55.9951">Set(key4, value4)</text></g><!--MD5=[d15b131dd1a0d42a2b4e7ff26cddba69]
link KVStore to Log--><g id="link_KVStore_Log"><path codeLine="37" d="M304.5,77.7 C304.5,90.1 304.5,107.32 304.5,124.4 " fill="none" id="KVStore-to-Log" style="stroke:#070D4A;stroke-width:1.0;"/><polygon fill="#070D4A" points="304.5,129.69,308.5,120.69,304.5,124.69,300.5,120.69,304.5,129.69" style="stroke:#070D4A;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="59" x="263" y="109.2451">1. Append</text></g><!--MD5=[937f200f8032e7ed6e8781237a59e151]
link KVStore to Storage--><g id="link_KVStore_Storage"><path codeLine="38" d="M345.63,59.5 C401.79,59.5 504.2,59.5 568.9,59.5 " fill="none" id="KVStore-to-Storage" style="stroke:#070D4A;stroke-width:1.0;"/><polygon fill="#070D4A" points="574.26,59.5,565.26,55.5,569.26,59.5,565.26,63.5,574.26,59.5" style="stroke:#070D4A;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="121" x="413" y="55.9951">2. Set(Key4, Value4)</text></g><!--MD5=[5ce81b978b9f5bd89690ef5bf57354bc]
@startuml
left to right direction
!include ../style.puml
map Client {
}
map KVStore {
}
map Log {
1=>Set(key1, value1)
2=>Set(key2, value4)
3=>Set(key3, value3)
4=>Set(key4, value4)
}
note right of Log
Write Ahead Log
/var/log/wal000.log
end note
map Storage {
key1=>value1
key2=>value2
key3=>value3
key4=>value4
}
Client - -> KVStore: Set(key4, value4)
KVStore -r-> Log: 1. Append
KVStore -d-> Storage: 2. Set(Key4, Value4)
@enduml
@startuml
left to right direction
skinparam shadowing false
skinparam sequenceParticipant{
BackgroundColor #F7F8FE
BorderColor #070D4A
}
skinparam sequenceLifeLine {
BackgroundColor #F7F8FE
BorderColor #070D4A
}
skinparam sequence {
ArrowColor #070D4A
}
skinparam Note {
BackgroundColor #F7F8FE
BorderColor #070D4A
}
skinparam Node {
BackgroundColor #F7F8FE
BorderColor #070D4A
}
skinparam object {
BackgroundColor #F7F8FE
BorderColor #070D4A
}
skinparam actor {
BackgroundColor #F7F8FE
BorderColor #070D4A
}
hide footbox
map Client {
}
map KVStore {
}
map Log {
1=>Set(key1, value1)
2=>Set(key2, value4)
3=>Set(key3, value3)
4=>Set(key4, value4)
}
note right of Log
Write Ahead Log
/var/log/wal000.log
end note
map Storage {
key1=>value1
key2=>value2
key3=>value3
key4=>value4
}
Client - -> KVStore: Set(key4, value4)
KVStore -r-> Log: 1. Append
KVStore -d-> Storage: 2. Set(Key4, Value4)
@enduml
PlantUML version 1.2022.6(Tue Jun 21 14:34:49 ADT 2022)
(GPL source distribution)
Java Runtime: Java(TM) SE Runtime Environment
JVM: Java HotSpot(TM) 64-Bit Server VM
Default Encoding: UTF-8
Language: en
Country: CA
--></g></svg>