From 8e4bfa08b2500c7fe8bf6104e3a365a20af91d6b Mon Sep 17 00:00:00 2001 From: mlycore Date: Thu, 14 Dec 2023 14:27:03 +0800 Subject: [PATCH 1/3] docs: add background and table for solution Signed-off-by: mlycore --- solutions/stackgres/README.md | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/solutions/stackgres/README.md b/solutions/stackgres/README.md index c875550c..e33e9856 100644 --- a/solutions/stackgres/README.md +++ b/solutions/stackgres/README.md @@ -1,5 +1,23 @@ # Solutions for StackGres -Here is a demo for building a sharded PostgreSQL cluster with Apache ShardingSphere and StackGres. The basic architecture could be described as : + +## Background + +StackGres is a Kubernetes operator for PostgreSQL. Apache ShardingSphere is a distributed SQL transaction & query engine for data sharding, scaling, encryption, and most importnantly could be built on any databases. This means there could be a intergation solution which will build a distributed PostgreSQL cluster exploit StackGres and Apache ShardingSphere. + +From StackGres's perspective, there are two kinds of solution as below: + +| | Basic | Advanced | +|:-:|:-----:|:--------:| +| Features | * Half-Managed | * Fully-Managed | +| | * Dual-Operators | * Only StackGres Operator | +| | * Exploit existed ShardingSphere Operator's functionalities | * Every required functionalities are implemented in StackGres Operator | +| User Experience | * Users could perceive two operators | * Users experience intergrity | +| Developer Experience | * Decoupled development, and seperated maintainence. Built with Go & Java | * Coupled development, Java stack | +| Potential tasks | * Helm Charts of StackGres add an option which decicde the installation of ShardingSphere Operator, and dependency of ShardingSphere Charts | * SGShardedCluster's property `type` add another available value `ShardingSphere`, and a new property `ShardingSphereProfile` refering the name of new CR ShardingSphereProfile. | +| | * SGShardedCluster's property `type` add another available value `ShardingSphere` and other properties that could be rendered into a ComputeNode CR | * A new CRD called ShardingSphereProfile which defines the required workload definitions for ShardingSphere Proxy such as Deployment, Service and ConfigMap. | +| | | * A new CRD called ShardingSphereDistSQLJob which defines serveral kinds of DistSQL job like `CREATE DATABASE`, `REGISTER STORAGE UNIT` and `CREATE SHARDING TABLE RULE`. | + +Here is a architecture illustration for this sharded PostgreSQL cluster with Apache ShardingSphere and StackGres: ```shell @@ -240,6 +258,7 @@ SELECT * FROM t_order_1; ![](./static/select-data-from-cluster-2.png) ## References + * [https://stackgres.io/doc/latest/quickstart/](https://stackgres.io/doc/latest/quickstart/) * [https://stackgres.io/doc/latest/install/helm/](https://stackgres.io/doc/latest/install/helm/) * [https://stackgres.io/doc/latest/administration/cluster/connection/passwords/](https://stackgres.io/doc/latest/administration/cluster/connection/passwords/) From 90842813d529e4cd963cf322ef3e3ea18493f548 Mon Sep 17 00:00:00 2001 From: mlycore Date: Thu, 14 Dec 2023 14:59:17 +0800 Subject: [PATCH 2/3] docs: using raw htlm to render table Signed-off-by: mlycore --- solutions/stackgres/README.md | 54 ++++++++++++++++++++++++++++------- 1 file changed, 44 insertions(+), 10 deletions(-) diff --git a/solutions/stackgres/README.md b/solutions/stackgres/README.md index e33e9856..13d13c5f 100644 --- a/solutions/stackgres/README.md +++ b/solutions/stackgres/README.md @@ -6,16 +6,50 @@ StackGres is a Kubernetes operator for PostgreSQL. Apache ShardingSphere is a di From StackGres's perspective, there are two kinds of solution as below: -| | Basic | Advanced | -|:-:|:-----:|:--------:| -| Features | * Half-Managed | * Fully-Managed | -| | * Dual-Operators | * Only StackGres Operator | -| | * Exploit existed ShardingSphere Operator's functionalities | * Every required functionalities are implemented in StackGres Operator | -| User Experience | * Users could perceive two operators | * Users experience intergrity | -| Developer Experience | * Decoupled development, and seperated maintainence. Built with Go & Java | * Coupled development, Java stack | -| Potential tasks | * Helm Charts of StackGres add an option which decicde the installation of ShardingSphere Operator, and dependency of ShardingSphere Charts | * SGShardedCluster's property `type` add another available value `ShardingSphere`, and a new property `ShardingSphereProfile` refering the name of new CR ShardingSphereProfile. | -| | * SGShardedCluster's property `type` add another available value `ShardingSphere` and other properties that could be rendered into a ComputeNode CR | * A new CRD called ShardingSphereProfile which defines the required workload definitions for ShardingSphere Proxy such as Deployment, Service and ConfigMap. | -| | | * A new CRD called ShardingSphereDistSQLJob which defines serveral kinds of DistSQL job like `CREATE DATABASE`, `REGISTER STORAGE UNIT` and `CREATE SHARDING TABLE RULE`. | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Basic Advanced
Features * Half-Managed * Fully-Managed
* Dual-Operators * Only StackGres Operator
* Exploit existed ShardingSphere Operator's functionalities * Every required functionalities are implemented in StackGres Operator
User Experience * Users could perceive two operators * Users experience intergrity
Developer Experience * Decoupled development, and seperated maintainence. Built with Go & Java * Coupled development, Java stack
Potential tasks * Helm Charts of StackGres add an option which decicde the installation of ShardingSphere Operator, and dependency of ShardingSphere Charts * SGShardedCluster's property `type` add another available value `ShardingSphere`, and a new property `ShardingSphereProfile` refering the name of new CR ShardingSphereProfile.
* SGShardedCluster's property `type` add another available value `ShardingSphere` and other properties that could be rendered into a ComputeNode CR * A new CRD called ShardingSphereProfile which defines the required workload definitions for ShardingSphere Proxy such as Deployment, Service and ConfigMap.
* A new CRD called ShardingSphereDistSQLJob which defines serveral kinds of DistSQL job like `CREATE DATABASE`, `REGISTER STORAGE UNIT` and `CREATE SHARDING TABLE RULE`.
+ Here is a architecture illustration for this sharded PostgreSQL cluster with Apache ShardingSphere and StackGres: From 44c67537b31b8757ef6f30d9c67cdbd1418c689f Mon Sep 17 00:00:00 2001 From: mlycore Date: Thu, 14 Dec 2023 15:01:45 +0800 Subject: [PATCH 3/3] fix: fix table Signed-off-by: mlycore --- solutions/stackgres/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/solutions/stackgres/README.md b/solutions/stackgres/README.md index 13d13c5f..9ab24347 100644 --- a/solutions/stackgres/README.md +++ b/solutions/stackgres/README.md @@ -13,7 +13,7 @@ From StackGres's perspective, there are two kinds of solution as below: Advanced - Features + Features * Half-Managed * Fully-Managed