Closed Pedrobc89 closed 1 month ago
This is a design proposal of the Distributed AtomSpace (DAS) Node.
Initial design will focus on Messaging and Leader Election.
For this use case we will assume that the nodes are already up and running, the network topology is full mesh. All nodes can communicate with each other and are all aware of each other. All nodes remain in a latent state until a job is requested.
MESSAGE: a data structure to encapsulate pieces of information we want to transport from one NODE to another.
Full Mesh:
Ring:
Tree:
Torus/Grid:
Arbitrary/Custom Topologies:
For the initial implementation, MQTT was chosen, since it is easy to start using, and it is very low latency, with high performance. It is also a good match for a number of topologies. MQTT does not guarantee the ordering of messages, so that would be required in the message itself. Note that the default max size of a message is 256 MB.
For this initial version, the messaging layer will have to implement methods for: leader election, job management, and telemetry.
Messaging layer API:
LeaderElection:
Telemetry:
JobManagement:
Leader election is a fundamental problem in distributed systems. It involves designating a single node as the coordinator (leader) of some task distributed among several nodes. The leader coordinates the work among the other nodes, ensuring efficient and reliable task completion. Below, I’ll cover some essential concepts, common algorithms, and implementation considerations for leader election.
Bully Algorithm:
Raft Algorithm:
Paxos Algorithm:
ZooKeeper:
For the initial implementation, Bully was chosen for it's simplicity and ease of development, as the project evolves, a new algorithm can be added. Since we opted for a modular design, we can add new algorithms as needed.
Perform a single query to the remote DAS Server, process all the results and perform some extra computation on each result in order to evaluate each result's quality.
JOB should be defined as a script in some programming language. DASNode should be able to support multiple programming languages here so the design must be flexible. Initially we'll support only Python scripts doing queries to a remote DAS Server.
This baseline test case should run with speedup of at least 70% * N considering the execution in a network with N (1 < N < 6) equally resourced NODEs against the execution in a single NODE.
Design the basic version of DASNode, which will be implemented in https://github.com/singnet/das/issues/42