fairDataSociety / fdp-contracts

Fair Data Protocol smart contracts and its utilities
4 stars 1 forks source link

Proposal: Swarm DB - Router #84

Open molekilla opened 2 years ago

molekilla commented 2 years ago

Swarm DB - Router

Swarm DB Router

Summary

A Router in Swarm DB handles compute queries that required certain amount of complexity and query planning. For simple queries with Beeson Query Language, that won't require extensive reference lookups or transform, a direct query planning estimation is enough and does not require a router.

For any other type of transaction or execution, like eg data / index jobs or work orders, availability and query planning will be required to query a router.

Guide-level explanation

Defining a registry of compute node

As specified in Swarm DB - Compute Node, a node takes care of data computations that takes certain amount of resources and complexity. Each compute node must register in a smart contract registry and be assigned an ENS name. Using EIP-3668, a off-chain call is made with a polling mechanism to get the liveness and compute cycles of the node (WASM) engine. A node also needs to implement EIP-5559: Cross Chain Write Deferral Protocol to accept storage tasks

There are two types of nodes as described in Swarm DB - Indexing and computing, indexing and compute nodes.

Router goals and use cases

Copyright

Copyright and related rights waived via CC0.

Author

@molekilla (Rogelio Morrell)