ShardingSphere 4.x Orchestration-Registry Center

Motivation

  • As config center manage configuration data, registry center hold all ephemeral status data dynamically generated in runtime(such as available proxy instances, disabled data source instances etc).
  • Registry center can disable the access to slave database and the access of application. Orchestration still has many functions(such as flow control) to be developed.

Data Structure in Registry Center

The registry center can create running node of database access object under state in defined name space, to distinguish different database access instances, including instances and datasources nodes.

instances
├──your_instance_ip_a@-@your_instance_pid_x
├──your_instance_ip_b@-@your_instance_pid_y
├──....
datasources
├──ds0
├──ds1
├──....

Sharding-Proxy can support multiple logical data sources, so datasources sub-nodes are named schema_name.data_source_name.

instances
├──your_instance_ip_a@-@your_instance_pid_x
├──your_instance_ip_b@-@your_instance_pid_y
├──....
datasources
├──sharding_db.ds0
├──sharding_db.ds1
├──....

state/instances

It includes running instance information of database access object, with sub-nodes as the identifiers of currently running instance, which consist of IP and PID. Those identifiers are temporary nodes, which are registered when instances are on-line and cleared when instances are off-line. The registry center monitors the change of those nodes to govern the database access of running instances and other things.

state/datasources

It is able to orchestrate read-write split slave database, delete or disable data dynamically.

Operation Guide

Circuit Breaker

Write DISABLED (case insensitive) to @-@PID in IP to disable that instance; delete DISABLED to enable the instance.

Zookeeper command is as follow:

[zk: localhost:2181(CONNECTED) 0] set /your_zk_namespace/your_app_name/state/instances/your_instance_ip_a@-@your_instance_pid_x DISABLED

Disable Slave Database

Under read-write split (or sharding + read-write split) scenarios, users can write DISABLED (case insensitive) to sub-nodes of data source name to disable slave database sources. Delete DISABLED or the node to enable it.

Zookeeper command is as follow:

[zk: localhost:2181(CONNECTED) 0] set /your_zk_namespace/your_app_name/state/datasources/your_slave_datasource_name DISABLED

--

--

--

Transform any DBMS in a distributed database system & enhance it with sharding, elastic scaling features & more. https://linktr.ee/ApacheShardingSphere

Love podcasts or audiobooks? Learn on the go with our new app.

Introduction to NoSQL (with Pros & Cons)

Success via Bugs

BASHED -HTB Writeup

Cloud Hosting With Leanstack

Simple way to secure Kafka & Zookeeper cluster on Kubernetes

Myth: Having A Sprint Goal Is Optional In Scrum

Why You Should Hire Professional Bespoke Business Software Developers

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Apache ShardingSphere

Apache ShardingSphere

Transform any DBMS in a distributed database system & enhance it with sharding, elastic scaling features & more. https://linktr.ee/ApacheShardingSphere

More from Medium

Building a large-scale distributed storage system based on CNFS

Announcing Conductor Community Repository | Orkes Conductor Documentation

Using GitLab Runner with Kubernetes Executor is the simplest way to use kubectl or helm on GitLab…

Debugging Failing Golang Tests