|
6 | 6 | [](https://app.codecov.io/gh/vmware-labs/multi-tenant-persistence-for-saas)
|
7 | 7 | [](https://github.com/vmware-labs/multi-tenant-persistence-for-saas/actions/workflows/daily.yml)
|
8 | 8 |
|
9 |
| - |
10 | 9 | ## Overview
|
11 | 10 |
|
12 | 11 | Multi-tenant Persistence for SaaS services acts as data abstraction layer for
|
@@ -68,6 +67,92 @@ sequenceDiagram
|
68 | 67 | end
|
69 | 68 | ```
|
70 | 69 |
|
| 70 | +Sample use case of the realization store where two threads T1, T2 that are parallelly |
| 71 | +realizing the resource that just got updated at two different enforcement points |
| 72 | +E1, E2 looks as follows, |
| 73 | + |
| 74 | +```mermaid |
| 75 | +sequenceDiagram |
| 76 | + actor T0 |
| 77 | + actor T1 |
| 78 | + actor T2 |
| 79 | + participant E1 |
| 80 | + participant E2 |
| 81 | + participant RS as RealizationStore |
| 82 | + participant R as ResourceTable |
| 83 | + participant O as OverallStatusTable |
| 84 | + participant E as EnforcementStatusTable |
| 85 | +
|
| 86 | + rect rgb(200,220,240) |
| 87 | + T0 ->>+ RS: PersistIntent P1 |
| 88 | + RS -->> R: UPSERT ID=P1 |
| 89 | + RS -->> O: Set OverallStatus ID=P1 Status=Pending |
| 90 | + RS ->>- T0: Done |
| 91 | +
|
| 92 | + T0 ->>+ RS: GetOverallStatus P1 |
| 93 | + RS -->> O: SELECT ID=P1 |
| 94 | + O -->> RS: |P1|PENDING| |
| 95 | + RS ->>- T0: Return PENDING |
| 96 | + end |
| 97 | +
|
| 98 | + rect rgb(220,240,260) |
| 99 | + note right of T1: T1 realizing P1 at E1 |
| 100 | + T1 ->>+ RS: MarkPending P1 at E1 |
| 101 | + RS -->> E: Set Status ID=P1 Enforcement=E1 Status=Pending |
| 102 | + RS -->> O: Set Status ID=P1 Status=Pending |
| 103 | + RS ->>- T1: Return |
| 104 | +
|
| 105 | + T1 ->> E1: Realize Resource P1 at E1 |
| 106 | + note right of T1: T1 SUCCEEDED realizing at E1 |
| 107 | + T1 ->>+ RS: MarkSuccess P1 at E1 |
| 108 | + RS -->> E: Set Status ID=P1 Enforcement=E1 Status=REALIZED |
| 109 | + RS -->> E: List Status ID=P1 Enforcement=* |
| 110 | + E -->> RS: |P1|E1|REALIZED|, |P1|E2|PENDING| |
| 111 | + RS -->> O: Set OverallStatus ID=P1 Status=Pending |
| 112 | + RS ->>- T1: Return |
| 113 | + note right of T1: T1 COMPLETED realizing P1 at E1 |
| 114 | + end |
| 115 | +
|
| 116 | + rect rgb(240,260,280) |
| 117 | + note right of T2: T2 realizing P1 at E2 |
| 118 | + T2 ->>+ RS: MarkPending P1 at E2 |
| 119 | + RS -->> E: Set Status ID=P1 Enforcement=E2 Status=Pending |
| 120 | + RS -->> O: Set OverallStatus ID=P1 Status=Pending |
| 121 | + RS ->>- T2: Return |
| 122 | + T2 ->> E2: Realize Resource P1 at E2 |
| 123 | + end |
| 124 | +
|
| 125 | + rect rgb(200,220,240) |
| 126 | + note right of T0: T0 Fetching OverallStatus of P1 |
| 127 | + T0 ->>+ RS: GetOverallStatus P1 |
| 128 | + RS -->> O: SELECT ID=P1 |
| 129 | + O -->> RS: |P1|PENDING| |
| 130 | + RS ->>- T0: Return PENDING |
| 131 | + end |
| 132 | +
|
| 133 | + rect rgb(240,260,280) |
| 134 | + note right of T2: T2 SUCCEEDED realizing at E2 |
| 135 | + T2 ->>+ RS: MarkSuccess P1 at E2 |
| 136 | + RS -->> E: Set Status ID=P1 Enforcement=E2 Status=REALIZED |
| 137 | + RS -->> E: List Status ID=P1 Enforcement=* |
| 138 | + E -->> RS: |P1|E1|REALIZED|, |P1|E2|REALIZED| |
| 139 | + RS -->> O: Set OverallStatus ID=P1 Status=REALIZED |
| 140 | + RS ->>- T2: Return |
| 141 | + note right of T2: T2 COMPLETED realizing P1 at E2 |
| 142 | + end |
| 143 | +
|
| 144 | + rect rgb(200,220,240) |
| 145 | + note right of T0: T0 Fetching OverallStatus of P1 |
| 146 | + T0 ->>+ RS: GetOverallStatus P1 |
| 147 | + RS -->> O: SELECT ID=P1 |
| 148 | + O -->> RS: |P1|REALIZED| |
| 149 | + RS ->>- T0: Return REALIZED |
| 150 | + end |
| 151 | +``` |
| 152 | + |
| 153 | +Note that in the scenarios above, it is not necessary for the consumers of |
| 154 | +`IRealizationStore` to be the same software component. |
| 155 | + |
71 | 156 | ## Features
|
72 | 157 |
|
73 | 158 | Currently, following features are supported:
|
@@ -96,23 +181,23 @@ Currently, following features are supported:
|
96 | 181 | .If instancer is not configured `instance_id` column doesnt have any special meaning
|
97 | 182 | .and treated as normal attribute.
|
98 | 183 |
|
99 |
| - |
100 |
| - |
101 | 184 | ## Documentation
|
102 | 185 |
|
103 |
| -Refer to [DOCUMENTATION.md](docs/DOCUMENTATION.md) for the interfaces exposed like `Datastore`, `Authorizer`, `Protostore` |
| 186 | +Refer to [DOCUMENTATION.md](docs/DOCUMENTATION.md) for the interfaces exposed like |
| 187 | +`Datastore`, `Authorizer`, `Protostore`, `Realization Store` |
104 | 188 |
|
105 | 189 | ## Future Support
|
106 | 190 |
|
107 | 191 | - Support for services to subscribe for updates to tables.
|
108 | 192 |
|
109 | 193 | ## Contributing
|
110 | 194 |
|
111 |
| -The multi-tenant-persistence-for-saas project team welcomes contributions from the community. Before you start |
112 |
| -working with multi-tenant-persistence-for-saas, please read our [CONTRIBUTING.md](CONTRIBUTING_CLA.md). All |
113 |
| -contributions to this repository must be signed as described on that page. Your signature certifies that you |
114 |
| -wrote the patch or have the right to pass it on as an open-source patch. For more detailed information, |
115 |
| -refer to [CONTRIBUTING.md](CONTRIBUTING_CLA.md). |
| 195 | +The multi-tenant-persistence-for-saas project team welcomes contributions from the |
| 196 | +community. Before you start working with multi-tenant-persistence-for-saas, please |
| 197 | +read our [CONTRIBUTING.md](CONTRIBUTING_CLA.md). All contributions to this repository |
| 198 | +must be signed as described on that page. Your signature certifies that you wrote |
| 199 | +the patch or have the right to pass it on as an open-source patch. For more detailed |
| 200 | +information, refer to [CONTRIBUTING.md](CONTRIBUTING_CLA.md). |
116 | 201 |
|
117 | 202 | ## License
|
118 | 203 |
|
|
0 commit comments