github.com/voedger/voedger@v0.0.0-20240520144910-273e84102129/design/archive/0/bus-0.0.1.md (about)

     1  # Partition Request Class Diagram
     2  
     3  ```dot
     4  digraph graphname {
     5  
     6      graph[rankdir=BT splines=ortho]
     7      node [ fontname = "Cambria" shape = "record" fontsize = 12]
     8      edge [ arrowhead = "empty" ]
     9      PR [label= "{Partition Request||}"]
    10      MR [label= "{Write Request||}"]
    11      ROR [label= "{Read Request||}"]
    12      MR -> PR;
    13      ROR -> PR;
    14  
    15  }
    16  ```
    17  
    18  - Partition Request: `Запрос к разделу`
    19  
    20  # App Container Structure
    21  
    22  ```dot
    23  digraph graphname {
    24      compound=true;
    25      node [ fontname = "Cambria" shape = "record" fontsize = 12]
    26  
    27      subgraph cluster_router_out {
    28  		label = "Router.prc"
    29          RouterOutput
    30  	}
    31  
    32      subgraph cluster_container{
    33          label = "Container";
    34          CDer [label="cder.prc"]
    35          Secrets[shape = cylinder]
    36          subgraph cluster_appcache{
    37             label = "cache.prc";
    38             Cache[shape = cylinder]
    39          }
    40          subgraph cluster_app{
    41              label = "App.prc";
    42              App[label=PEngine]
    43              ipcache
    44              ipdb
    45              module1
    46              module2
    47          }
    48          subgraph cluster_db{
    49              label = "DB Apps";
    50              state [label="state.prc"]
    51              plog [label="plog.prc"]
    52              wlog [label="wlog.prc"]
    53              stock [label="stock.prc"]
    54          }
    55      }
    56  
    57      subgraph cluster_router_in {
    58  		label = "Router.prc"
    59          RouterInput
    60  	}
    61  
    62      RouterOutput -> App
    63      App -> RouterInput
    64  
    65      edge [dir=none style=dotted]
    66      ipdb -> App
    67      Secrets -> state [lhead=cluster_db]
    68      ipdb -> state [lhead=cluster_db]
    69      ipdb -> ipcache [lhead=cluster_db]
    70      App -> module1
    71      App -> module2
    72      Cache -> ipcache
    73  
    74  
    75  }
    76  ```
    77  
    78  - `cache.prc`
    79    - Separate process allows to update `App.prc`
    80    - Shared mem (with `App`) gives the best speed
    81    - Unix sockets gives simplicity
    82  
    83  
    84  
    85  # PEngine Structure
    86  
    87  ```dot
    88  digraph graphname {
    89      graph[rankdir=BT splines=ortho]
    90      node [ fontname = "Cambria" shape = "record" fontsize = 12]
    91      App[label="App"]
    92      PEngine
    93      PHandler[label="PartitionHandler"]
    94      
    95      
    96      edge [dir=both arrowhead=none arrowtail=none]
    97      PEngine -> App
    98      PHandler -> PEngine [arrowtail=crow]
    99      PReadEngine -> PEngine
   100      WriteHandler -> PHandler
   101      RWRouter -> PHandler
   102      PCache -> PHandler
   103      ReadChannel -> PReadEngine
   104      ReadHandler -> ReadChannel [arrowtail=crow]
   105  }
   106  ```
   107  
   108  # PEngine Dataflow
   109  
   110  ```dot
   111  digraph graphname {
   112      node [ fontname = "Cambria" shape = "record" fontsize = 12]
   113  
   114      subgraph cluster_engine {
   115          label = "PEngine";
   116          subgraph cluster_ph{
   117              label = "partitionHandler1"
   118              RWRouter [label="RWRouter"]
   119              Writer [label="WriteHandler"]
   120              ipdb
   121          }
   122          subgraph cluster_readers {
   123              label = "PReadEngine"
   124              readHandler1
   125              readHandler2
   126              ReadChannel
   127          }
   128      }
   129      subgraph cluster_router_out {
   130  		label = "Router"
   131          RouterOutput
   132  	}
   133  	subgraph cluster_router_in {
   134  		label = "Router"
   135          RouterInput
   136  	}
   137  
   138  
   139      RouterOutput-> RWRouter
   140      RWRouter -> Writer
   141      RWRouter -> ReadChannel
   142      ReadChannel -> readHandler1
   143      ReadChannel -> readHandler2
   144      readHandler1 -> RouterInput
   145      readHandler2 -> RouterInput
   146      Writer -> RouterInput
   147      ipdb -> readHandler1 [style=dotted dir=none]
   148      ipdb -> readHandler2 [style=dotted  dir=none]
   149      ipdb -> Writer [style=dotted dir=none]
   150  }
   151  ```