SONM DWH — a new component in SONM platform

The decision to build own Sidechain resulted in new challenges for the team and affected the architecture of the SONM platform.

One of the primary goals of the project is to make the platform as decentralized as possible. The Sidechain removes restrictions on the cost of transactions and allows running the entire deal cycle directly on the Sidechain, including:

● Placement of orders (BID and ASK) for the purchase and sale of computing resources;

● Verification of the deal terms (parameters of a BID and ASK orders match each other, the parties did not blacklist each other);

● Direct deal conclusion, confirmation from the other party is not needed (the presence of an order means the order owner agrees to make a deal under the specified conditions);

● Amendments to the terms of the deal (in some cases requires the approval of counterparty);

● The deal termination.

Besides, the SONM Sidechain will store the data of user profiles, which will allow potential counterparties to decide whether to conclude the deal or not:

● Contact details and other public data that the user wants to share;

● A sign of passing the KYC procedure.

This approach is a big step towards the platform decentralization and creating the most trustable and clear terms for interaction between the users of the SONM network.

However, the need to obtain this data from the Sidechain on the client side (for example, SONM Wallet interface) would require a far more complicated API and the internal data structure in the smart contracts (additional indexes, search methods and data filtering to retrieve information on many items with a single request).

Frequent requests can cause a significant workload on the nodes that provide the functioning of the SONM Sidechain. Moreover, obtaining this data directly from the Sidechain and creating the necessary connections and representations requires considerable time, which would have a negative impact on the user satisfaction and the overall speed of operations.

What is SONM DWH?

DWH is a traditional abbreviation for Data Warehouse.

Typically, it is a component that can receive data from various sources, store it, generate additional data slices (built from obtained data), and submit this data to external consumers.

In SONM environment, the DWH is a node that keeps a copy of the data that has passed through the Sidechain and provides fast access mechanisms to this data in a convenient way for the end user (client applications and other SONM platform infrastructure components).

Search for data in the Sidechain is not an efficient way, while the DWH uses special techniques for that — relational databases, indexes, etc.

The diagram below illustrates the location of SONM DWH in the overall architecture of the platform (for simplicity, some components are not reflected in the diagram).

SONM DWH monitors all operations in the SONM Sidechain.

DWH stores the current state of all data objects in the SONM Sidechain (and in some cases, the history of their changes). Based on this information, DWH generates all the data segments necessary for the implementation of SONM platform logic, and provides a programming interface (API) to other platform components:

● SONM Wallet

● SONM Node

● SONM Worker

DWH will allow the user to obtain the following information quickly (from here on, the “user” is referred to a person using the SONM Wallet / CLI functions, and “bot” — special SONM software that runs operations on its behalf):

● List of transactions at the user’s address in the SONM Sidechain;

● List of SONM network users profiles;

● Detailed profile information of any user;

● Statistics of any user (deals, orders, amount of earned and/or spent SNM tokens and other aspects);

● List of active orders of any network user;

● List of active orders (BID or ASK) placed on the SONM market, meeting the criteria specified by the user;

● Detailed parameters of the order;

● List of deals;

● Detailed information about the specific deal;

● Proposals for changing the terms of the deal, placed by the counterparty, and waiting for user approval;

● List of blacklisted addresses;

● List of SONM worker nodes operating on the SONM network on behalf of the current user (relevant for the owner of computing resources).

The accuracy of the provided information can be verified in the Sidechain, if necessary.

SONM DWH will operate as a decentralized component of the system; it can function as a SONM network task (executed in a docker container on the equipment of the owner of computing resources leased in the SONM network on general terms). Any SONM user will be able to run his own DWH node which is implemented in the same way as geth node — everyone may have it’s own. It’s like a personal caching layer between client and blockchain. It’s made for “light clients” convenience and it’s not a critical centralized component of the system.