# mgurujagannathareddy/aether-sync-resilient-multi-master-state-sync-over-udp architecture

> Architecture diagram of the GitHub repository mgurujagannathareddy/aether-sync-resilient-multi-master-state-sync-over-udp, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mgurujagannathareddy/aether-sync-resilient-multi-master-state-sync-over-udp
- Repository: https://github.com/mgurujagannathareddy/aether-sync-resilient-multi-master-state-sync-over-udp

## Overview

Aether Sync is a Python multi-master state-sync application: users add peers and write keys through an interactive node; the node updates its local LWW store and sends reliable PUTs, while periodic gossip and incoming messages help replicas converge. The graph separates the node’s user and listener workflows, gossip, reliability, transport, and shared state. Source excerpts show the main call paths; other capabilities are included where documented in the README.

Main entry points: [`node.py`](https://github.com/mgurujagannathareddy/aether-sync-resilient-multi-master-state-sync-over-udp/blob/main/node.py) (Node runtime), [`transport.py`](https://github.com/mgurujagannathareddy/aether-sync-resilient-multi-master-state-sync-over-udp/blob/main/transport.py) (UDP transport), [`reliability.py`](https://github.com/mgurujagannathareddy/aether-sync-resilient-multi-master-state-sync-over-udp/blob/main/reliability.py) (Reliable delivery), [`gossip.py`](https://github.com/mgurujagannathareddy/aether-sync-resilient-multi-master-state-sync-over-udp/blob/main/gossip.py) (Anti-entropy gossip)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Node application"]
  node_node["Node runtime<br/>[node.py]"]
  node_peer_admin["Peer setup<br/>[node.py]"]
  node_local_write["Local writes<br/>[node.py]"]
  node_listener["Message listener<br/>[node.py]"]
  node_state_view["State display<br/>[node.py]"]
end

subgraph group_sync["Replication protocols"]
  node_gossip["Anti-entropy gossip<br/>[gossip.py]"]
  node_reliability["Reliable delivery<br/>[reliability.py]"]
  node_ack_retry["ACK and retry<br/>[reliability.py]"]
end

subgraph group_network["UDP transport"]
  node_transport["UDP transport<br/>[transport.py]"]
  node_loss["Packet-loss simulation<br/>[transport.py]"]
end

subgraph group_state["Configuration and state"]
  node_store[("LWW state store<br/>[store.py]")]
  node_config["Runtime parameters<br/>[config.py]"]
end

node_user(("Operator"))
node_peer(("Peer nodes"))

node_user -->|"uses CLI"| node_node
node_node -->|"runs commands"| node_peer_admin
node_user -->|"adds peer"| node_peer_admin
node_user -->|"enters update"| node_local_write
node_node -->|"dispatches input"| node_local_write
node_local_write -->|"merges record"| node_store
node_local_write -->|"sends PUT"| node_reliability
node_node -->|"starts listener"| node_listener
node_listener -->|"receives packets"| node_transport
node_listener -->|"merges updates"| node_store
node_listener -->|"handles ACK"| node_reliability
node_listener -->|"sends ACK"| node_transport
node_node -->|"starts loop"| node_gossip
node_gossip -->|"reads full state"| node_store
node_gossip -->|"sends gossip"| node_reliability
node_node -->|"reads state"| node_store
node_node -->|"starts retries"| node_reliability
node_reliability -->|"tracks and retries"| node_ack_retry
node_reliability -->|"sends datagrams"| node_transport
node_transport -->|"simulates drops"| node_loss
node_transport -->|"reads limits"| node_config
node_gossip -->|"reads interval"| node_config
node_peer -->|"sends datagrams"| node_transport
node_transport -->|"sends datagrams"| node_peer

click node_node "https://github.com/mgurujagannathareddy/aether-sync-resilient-multi-master-state-sync-over-udp/blob/main/node.py"
click node_peer_admin "https://github.com/mgurujagannathareddy/aether-sync-resilient-multi-master-state-sync-over-udp/blob/main/node.py"
click node_local_write "https://github.com/mgurujagannathareddy/aether-sync-resilient-multi-master-state-sync-over-udp/blob/main/node.py"
click node_listener "https://github.com/mgurujagannathareddy/aether-sync-resilient-multi-master-state-sync-over-udp/blob/main/node.py"
click node_state_view "https://github.com/mgurujagannathareddy/aether-sync-resilient-multi-master-state-sync-over-udp/blob/main/node.py"
click node_gossip "https://github.com/mgurujagannathareddy/aether-sync-resilient-multi-master-state-sync-over-udp/blob/main/gossip.py"
click node_reliability "https://github.com/mgurujagannathareddy/aether-sync-resilient-multi-master-state-sync-over-udp/blob/main/reliability.py"
click node_ack_retry "https://github.com/mgurujagannathareddy/aether-sync-resilient-multi-master-state-sync-over-udp/blob/main/reliability.py"
click node_store "https://github.com/mgurujagannathareddy/aether-sync-resilient-multi-master-state-sync-over-udp/blob/main/store.py"
click node_transport "https://github.com/mgurujagannathareddy/aether-sync-resilient-multi-master-state-sync-over-udp/blob/main/transport.py"
click node_loss "https://github.com/mgurujagannathareddy/aether-sync-resilient-multi-master-state-sync-over-udp/blob/main/transport.py"
click node_config "https://github.com/mgurujagannathareddy/aether-sync-resilient-multi-master-state-sync-over-udp/blob/main/config.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_node,node_peer_admin,node_local_write,node_listener,node_state_view toneBlue
class node_gossip,node_reliability,node_ack_retry toneAmber
class node_transport,node_loss toneMint
class node_store,node_config toneRose
class node_user,node_peer toneIndigo
```

## Components

### Node application

- [Node runtime](https://github.com/mgurujagannathareddy/aether-sync-resilient-multi-master-state-sync-over-udp/blob/main/node.py): `node.py`
- [Peer setup](https://github.com/mgurujagannathareddy/aether-sync-resilient-multi-master-state-sync-over-udp/blob/main/node.py): `node.py`
- [Local writes](https://github.com/mgurujagannathareddy/aether-sync-resilient-multi-master-state-sync-over-udp/blob/main/node.py): `node.py`
- [Message listener](https://github.com/mgurujagannathareddy/aether-sync-resilient-multi-master-state-sync-over-udp/blob/main/node.py): `node.py`
- [State display](https://github.com/mgurujagannathareddy/aether-sync-resilient-multi-master-state-sync-over-udp/blob/main/node.py): `node.py`

### Replication protocols

- [Anti-entropy gossip](https://github.com/mgurujagannathareddy/aether-sync-resilient-multi-master-state-sync-over-udp/blob/main/gossip.py): `gossip.py`
- [Reliable delivery](https://github.com/mgurujagannathareddy/aether-sync-resilient-multi-master-state-sync-over-udp/blob/main/reliability.py): `reliability.py`
- [ACK and retry](https://github.com/mgurujagannathareddy/aether-sync-resilient-multi-master-state-sync-over-udp/blob/main/reliability.py): `reliability.py`

### UDP transport

- [UDP transport](https://github.com/mgurujagannathareddy/aether-sync-resilient-multi-master-state-sync-over-udp/blob/main/transport.py): `transport.py`
- [Packet-loss simulation](https://github.com/mgurujagannathareddy/aether-sync-resilient-multi-master-state-sync-over-udp/blob/main/transport.py): `transport.py`

### Configuration and state

- [LWW state store](https://github.com/mgurujagannathareddy/aether-sync-resilient-multi-master-state-sync-over-udp/blob/main/store.py): `store.py`
- [Runtime parameters](https://github.com/mgurujagannathareddy/aether-sync-resilient-multi-master-state-sync-over-udp/blob/main/config.py): `config.py`

### Other components

- **Operator**
- **Peer nodes**

## Connections

- Operator → Node runtime: uses CLI (evidence: `README.md`)
- Node runtime → Peer setup: runs commands (evidence: `node.py`)
- Operator → Peer setup: adds peer (evidence: `README.md`)
- Operator → Local writes: enters update (evidence: `README.md`)
- Node runtime → Local writes: dispatches input (evidence: `node.py`)
- Local writes → LWW state store: merges record (evidence: `node.py`)
- Local writes → Reliable delivery: sends PUT (evidence: `node.py`)
- Node runtime → Message listener: starts listener (evidence: `node.py`)
- Message listener → UDP transport: receives packets (evidence: `node.py`)
- Message listener → LWW state store: merges updates (evidence: `node.py`)
- Message listener → Reliable delivery: handles ACK (evidence: `node.py`)
- Message listener → UDP transport: sends ACK (evidence: `node.py`)
- Node runtime → Anti-entropy gossip: starts loop (evidence: `node.py`)
- Anti-entropy gossip → LWW state store: reads full state (evidence: `gossip.py`)
- Anti-entropy gossip → Reliable delivery: sends gossip (evidence: `gossip.py`)
- Node runtime → LWW state store: reads state (evidence: `node.py`)
- Node runtime → Reliable delivery: starts retries (evidence: `node.py`)
- Reliable delivery → ACK and retry: tracks and retries (evidence: `reliability.py`)
- Reliable delivery → UDP transport: sends datagrams (evidence: `reliability.py`)
- UDP transport → Packet-loss simulation: simulates drops (evidence: `transport.py`)
- UDP transport → Runtime parameters: reads limits (evidence: `transport.py`)
- Anti-entropy gossip → Runtime parameters: reads interval (evidence: `gossip.py`)
- Peer nodes → UDP transport: sends datagrams (evidence: `README.md`)
- UDP transport → Peer nodes: sends datagrams (evidence: `transport.py`)
