diff --git a/crates/lavina-core/src/clustering/mod.rs b/crates/lavina-core/src/clustering/mod.rs index 990f31a..5a7fb1d 100644 --- a/crates/lavina-core/src/clustering/mod.rs +++ b/crates/lavina-core/src/clustering/mod.rs @@ -18,6 +18,19 @@ use crate::prelude::Str; use crate::table::{AnonTable}; use crate::terminator::Terminator; +/* +сценарии: +- бутстрап нового кластера +- подключение новой ноды к кластеру +- вывод существующей ноды из кластера + +имплементация: +- etcd для выбора лидера +- определение модели данных +- определение протокола общения между нодами +- модель верификации поведения нод + */ + #[derive(Deserialize, Debug, Clone)] pub struct ClusteringConfig { /// The name of the cluster used for prefixing the data in etcd and to prevent accidental communication between different clusters. diff --git a/docs/flow.md b/docs/flow.md index ef83f3c..9ea88a7 100644 --- a/docs/flow.md +++ b/docs/flow.md @@ -65,3 +65,26 @@ C4Context BiRel(BobPC, BobConn1, "IRC") UpdateLayoutConfig($c4ShapeInRow="3", $c4BoundaryInRow="1") ``` + +## Cluster + +```mermaid +C4Context + System_Ext(Alice, "Alice IRC") + System_Ext(Bob, "Bob XMPP") + Boundary(Lavina, "Lavina", "Cluster of nodes") { + System(Node1, "Node 1", "Single server process") + System(Node2, "Node 2", "Single server process") + System(Node3, "Node 3", "Single server process") + Rel(Node1, etcd, "") + Rel(Node2, etcd, "") + Rel(Node3, etcd, "") + BiRel(Node1, Node2, "") + BiRel(Node2, Node3, "") + BiRel(Node1, Node3, "") + System(etcd, "etcd", "Key-value store") + UpdateLayoutConfig($c4ShapeInRow="2", $c4BoundaryInRow="1") + } + Rel(Alice, Node1, "") + Rel(Bob, Node2, "") +``` \ No newline at end of file