From 40b9ffe46ae8b72679753f21f2776736d8ad222d Mon Sep 17 00:00:00 2001 From: Nikita Vilunov Date: Fri, 10 May 2024 15:43:26 +0200 Subject: [PATCH] wip --- crates/lavina-core/src/lib.rs | 6 +++--- docs/scalability.md | 31 ------------------------------- 2 files changed, 3 insertions(+), 34 deletions(-) delete mode 100644 docs/scalability.md diff --git a/crates/lavina-core/src/lib.rs b/crates/lavina-core/src/lib.rs index dfc62db..f5df5e6 100644 --- a/crates/lavina-core/src/lib.rs +++ b/crates/lavina-core/src/lib.rs @@ -1,12 +1,12 @@ //! Domain definitions and implementation of common chat logic. -use crate::clustering::{ClusterConfig, LavinaClient}; +use std::sync::Arc; + use anyhow::Result; use prometheus::Registry as MetricsRegistry; -use std::sync::Arc; -use tokio::sync::Mutex; use crate::auth::Authenticator; use crate::clustering::broadcast::Broadcasting; +use crate::clustering::{ClusterConfig, LavinaClient}; use crate::dialog::DialogRegistry; use crate::player::PlayerRegistry; use crate::repo::Storage; diff --git a/docs/scalability.md b/docs/scalability.md deleted file mode 100644 index c2a31a3..0000000 --- a/docs/scalability.md +++ /dev/null @@ -1,31 +0,0 @@ -## Step 1 – players and dialogs centralized, rooms distributed -All players are located on the same node. The client traffic is terminated on the same node - -Rooms and their history could be located on other nodes. - -The membership data: -- If the room and the player are located on the same node, it is on the same node and updated atomically. -- If the room and the player are located on different nodes, the membership data is split into two parts: - - The player-specific membership contains all data necessary to validate commands on the player's node side. - It is located on the player's node. - - The room-specific membership contains all data needed to respond to queries such as "list users". - It is located on the room's node. - -Dialogs and their history are located on the same node, as all players. - -The allocation is specified statically in the configuration file. - -## Step 2 – players and dialogs distributed -Different players could be located on different nodes. The traffic is still terminated on the same node. -A client must connect to the node which hosts the player, otherwise the connection is terminated. - -Dialogs are located on the first player's node. This depends on how the first player is decided, -which is implemented by sorting the players lexicographically. - -The allocation is still specified statically in the configuration file. - -## Step 3 – dynamic allocation and consensus - -## Step 4 – all data replicated - -## Step 5 – chat history fragmented