ahachete commented on issue #29411:
URL: 
https://github.com/apache/shardingsphere/issues/29411#issuecomment-1861886810

   Thank you @tristaZero for creating this issue and the introduction to the 
topic. Hi ShardingSphere Community!
   
   To give a little bit of initial background: 
[StackGres](https://stackgres.io) is a fully open source and advanced platform 
for running Postgres on Kubernetes. One of StackGres' main goals is to create a 
set of carefully designed 
[CRD](https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/custom-resources/)s
 to expose its functionality, which is fully declarative. Effectively, these 
CRDs (which are often seen by users as YAML files) become StackGres user-facing 
API --though StackGres also has both a REST API as well as a Web Console, where 
all of them can be used in a fully interchangeable way.
   
   Recently StackGres introduced support for sharding, via the 
[SGShardedCluster](https://stackgres.io/doc/latest/reference/crd/sgshardedcluster/)
 CRD. Following StackGres' philosophy, the goal was to make it very easy for 
StackGres users to deploy sharded clusters. Users should not need to understand 
the complexities of wiring up a sharded cluster, with all the components 
required (high availability, connection pooling, backups for all nodes, 
customized configurations, monitoring, etc), neither specific details of the 
sharding techonology. All those would be abstracted by the `SGShardedCluster` 
CRD and the user only offered high level decisions (such as the number of 
shards or whether they are highly available or not) and let StackGres do all 
the heavy lifting behind the scenes.
   
   As of now, StackGres supports sharding with 
[Citus](https://www.citusdata.com/), which is well supported now and with a 
wide set of features (including e.g. distributed backups, non-homogeneusly 
sized shards, etc). But the goal is to expand this CRD to support other 
sharding technologies. And work at StackGres has been started to support 
ShardingSphere as another sharding technology. Getting help and feedback from 
the ShardingSphere Community would be fantastic.
   
   To show an example, this is a (simple) case of the YAML required to create a 
sharded cluster with Citus, with four shards, all of them highly available (one 
replica per shard, so a total of two instances per shard) and two coordinators, 
also for highly available coordinators:
   
   ```yaml
   apiVersion: stackgres.io/v1alpha1
   kind: SGShardedCluster
   metadata:
     name: cluster
   spec:
     type: citus
     database: mydatabase
     postgres:
       version: '15'
     coordinator:
       instances: 2
       pods:
         persistentVolume:
           size: '10Gi'
     shards:
       clusters: 4
       instancesPerCluster: 2
       pods:
         persistentVolume:
           size: '10Gi'
   ```
   
   (example and additional documentation taken from [StackGres 
docs](https://stackgres.io/doc/latest/administration/sharded-cluster/))
   
   The goal would be to introduce changes into this CRD to add support for 
ShardingSphere (and obviously implement them too). The work at StackGres is 
coordinated via the [Support Apache ShardingSphere in StackGres 
](https://gitlab.com/ongresinc/stackgres/-/issues/2592) issue. Our issues are 
public, and anyone may post there, so feel free to jump in anytime! I'm also 
happy tracking this issue here to receive any kind of feedback and ideas.
   
   BTW for those interested, StackGres is also written in Java, as 
ShardingSphere, despite being a Kubernetes Operator ;) Here's the [source 
code](https://gitlab.com/ongresinc/stackgres/).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to