Overview

The Shared DB Channel is a simplistic, non-blockchain implementation of an IGL Node. Due to its non-distributed nature (the “channel medium” is a central, shared DB), it is only intended for use in development situations.

Architecture

A shared database is used by multiple channel endpoints:

@startuml
caption High level channel architecture

[Intergov Node 1] as intergov_node_1
[Intergov Node 2] as intergov_node_2
[Intergov Node 3] as intergov_node_3

package "Channel" {
   [<<Flask API>>\nChannel Endpoint 1] as channel_endpoint_1
   [<<Flask API>>\nChannel Endpoint 2] as channel_endpoint_2
   [<<Flask API>>\nChannel Endpoint 3] as channel_endpoint_3
   Database "<<PostgreSQL DB>>\nChannel Medium\nShared DB" as channel_medium
}

intergov_node_1 <--> channel_endpoint_1
intergov_node_2 <-- channel_endpoint_2
intergov_node_3 --> channel_endpoint_3
channel_endpoint_1 <--> channel_medium
channel_endpoint_2 <-- channel_medium
channel_endpoint_3 --> channel_medium
@enduml

Each instance of a shared DB channel has one PostgreSQL DB and 2 or more channel endpoints. A separate channel would have its own instance of the shared DB and its own instances of channel endpoints.

digraph d {
pagedir="TL";
rankdir="LR";

{
    rank="min";
    subscriber [label="<<IGL Node>>\nSubscriber" shape="component"];
}

subgraph cluster_channel_endpoint{
    clusterrank="local";
    label="Channel Endpoint";
    {
        rank="same";
        api [label="<<Flask API>>\nChannel Endpoint API" shape="component"];
        message_observer [label="<<Python>>\nIncoming Message Observer" shape="component"];
        callback_spreader [label="<<Python>>\nCallback Spreader" shape="component"];
        callback_delivery [label="<<Python>>\nCallback Delivery" shape="component"];
    }
    {
        rank="same";
        channel_store [label="<<Minio>>\nChannel Store" shape="cylinder"];
        subscription_store [label="<<Minio>>\nSubscription Store" shape="cylinder"];
        subscription_event_queue [label="<<ElasticMQ>>\nSubscription Event Queue" shape="rectangle"];
        subscription_delivery_queue [label="<<ElasticMQ>>\nSubscription Delivery Queue" shape="rectangle"];
    }
}

{
    rank="sink";
    channel_medium [label="<<PostgreSQL DB>>\nChannel Medium\nShared DB" shape="cylinder"];
}


subscriber -> api;
api -> subscription_store;
api -> channel_medium [dir=both];

message_observer -> channel_store [dir=both];
message_observer -> subscription_event_queue;
message_observer -> channel_medium;
subscription_event_queue -> callback_spreader;
subscription_store -> callback_spreader;
callback_spreader -> subscription_delivery_queue;
subscription_delivery_queue -> callback_delivery;
callback_delivery -> subscriber;
}

See Development for instructions on how to spin up instances locally.