github.com/voedger/voedger@v0.0.0-20240520144910-273e84102129/design/hvm/README.md (about)

     1  # Functional design
     2  ```go
     3  pkgSys := DefinePackage().
     4  	WithSchemas(...),
     5  	WithFuncs(WithFunc(
     6  		QName,
     7  		...
     8  		WithRate(...),
     9  	))
    10  appRegistry := DefineApp(appQName, WithPackages(
    11  	pkgSys,
    12  ))
    13  appAirsBP := DefineApp(appQName, WithPackages(
    14  	pkgSys,
    15  	pkgAirsBP,
    16  	pkgUnTill,
    17  ))
    18  ProvideCluster(WithApps(
    19  	appAirsBP,
    20  	appRegistry,
    21  ))
    22  type Cluster struct {
    23  	ServicePipeline
    24  	VVMAPI
    25  
    26  }
    27  ```
    28  # Technical design
    29  
    30  ```mermaid
    31  erDiagram
    32  
    33  	VVMConfig ||..|| AppPartitionConfig: has
    34  	VVMConfig ||..|| VVM: "used to build"
    35  	VVMConfig ||..|| os_Args: "built using e.g."
    36  	VVM ||..|{ AppPartition: contains
    37  
    38  	AppPartitionConfig {
    39  		CommandProcessorsAmount int
    40  		QueryProcessorAmount int
    41  		Low_Medium_High_rates irates_BucketState
    42  	}
    43  
    44  	AppPartition {
    45  		Number int
    46  		Buckets irates_IBucket
    47  		ServiceChannelFactory func_serviceChannelType_serviceChannelNum
    48  	}
    49  ```
    50  
    51  ```mermaid
    52  erDiagram
    53  
    54  	VVMConfig ||..|| DefaultAppPartitionConfig: has
    55  	VVMConfig ||..|| VVM: "used to build"
    56  	VVMConfig ||..|| os_Args: "built using e.g."
    57  	VVM ||..|{ AppPartition: contains
    58  
    59  	App{
    60  
    61  	}
    62  
    63  	DefaultAppPartitionConfig {
    64  		CommandProcessorsAmount int
    65  		QueryProcessorAmount int
    66  		func_serviceChannelType_serviceChannelNum ServiceChannelFactory
    67  	}
    68  
    69  	AppPartition {
    70  		Number int
    71  		Buckets irates_IBucket
    72  		CommandProcessors IOperator
    73  		QueryPrcoessors IOperator
    74  		AppStructs IAppStructs
    75  	}
    76  ```
    77  
    78  ```mermaid
    79  erDiagram
    80  
    81  VVM ||--|| ServicePipeline: has
    82  VVM ||--|| VVMAPI: "has struct of interfaces"
    83  VVM ||--|{ IVVMApp: "has per app"
    84  VVM ||--|| MetricsServicePort: "has func"
    85  VVM ||..|| struct: is
    86  
    87  ServicePipeline ||..|| ISyncPipeline: is
    88  ServicePipeline ||--|| ForkOperator_SP : "has single"
    89  
    90  ForkOperator_SP ||--|| ForkOperator_Processors: "has branch"
    91  ForkOperator_SP ||--|| ServiceOperator_Router: "has branch"
    92  ForkOperator_SP ||--|| ServiceOperator_MetricsHTTPService: "has branch "
    93  
    94  QueryProcessorsCount ||..|| x10_q: "hardcoded"
    95  QueryProcessorsCount ||..|| QueryProcessors: "defines branches amount of"
    96  ForkOperator_Processors ||--|| QueryProcessors: "has branch"
    97  ForkOperator_Processors ||--|| AppServices: "has branch"
    98  ForkOperator_Processors ||--|| CommandProcessors: "has branch"
    99  
   100  QueryProcessors ||..|| ForkOperator_QP: is
   101  QueryProcessors ||--|{ QueryProcessor: "has branches"
   102  
   103  
   104  QueryProcessor ||..|| IService_QP: is
   105  QueryProcessor ||..|| ServiceOperator_QP: is
   106  QueryProcessor }|--|| QueryChannel: "sits on same"
   107  QueryProcessor }|--|| IAppStructsProvider: "has same"
   108  QueryChannel ||..|| ubuffered: is
   109  
   110  CommandProcessorsCount ||..|| CommandProcessors: "branches amount is"
   111  CommandProcessors ||..|| ForkOperator_CP: is
   112  CommandProcessors ||--|{ CommandProcessor: "has branches"
   113  CommandProcessor ||--|| CommandChannel: "sits on"
   114  CommandProcessor ||..|| IService_CP: is
   115  CommandProcessor ||..|| ServiceOperator_CP: is
   116  CommandChannel ||..|| PartitionID: per
   117  CommandChannel ||..|| CommandProcessorsCount: "has buffer size equal to"
   118  CommandProcessorsCount ||..|| PartitionsCount: "equals to"
   119  PartitionsCount ||..|| PartitionID: "defines amount of"
   120  CommandProcessor ||--|| PartitionID: per
   121  CommandProcessor }|--|| IAppStructsProvider: "has same"
   122  CommandProcessorsCount ||..|| x10_c: "hardcoded"
   123  
   124  
   125  ```