Elastic database Split-Merge tool issue while splitting an existing shard

545 views Asked by At

We recently have moved to Azure Elastic Scale DB. So when we need to create another shard, our DBA splits an existing shard manually. So I have been given the task to automate that process so we can easily split an existing shard or merge multiple shards into one. I am learning and following Elastic database Split-Merge tool tutorial. Another tutorial here says under Requirements and Limitations section the following:

Currently, the shards need to exist and be registered in the shard map before a split-merge operation on these shards can be performed.

So I still have to create another shard manually and register it in shards map, for which i may have to use another tool. Similarly schema for all sharded tables and reference tables need to exist on the target shard prior to any split/merge/move operation.

So this functionality of split/merge is not automated yet or am i looking at wrong place?

I want all these operations to be automated. Can you refer me some complete software or tutorial for that?

2

There are 2 answers

0
Stuart Ozer On BEST ANSWER

Cbattlegear is correct -- the process is not yet integrated into a single tool. Currently the Split/Merge tool only handles the data movement operations. However there is a Powershell example of orchestrating the entire process -- including provisioning the target databases, adding it to the shard map, and invoking the split/merge operations. You can find it described in the testing section of the Split/Merge Tutorial.

Some customer simplify the process even further by maintaining an empty "golden copy" database containing all schema objects necessary for shards. Then when a new shard is needed, they perform a CREATE DATABASE AS COPY command to quickly create a new DB from the reference copy. This step can be scripted as well.

Finally, in addition to Powershell, there is a .Net API available for Split-Merge that allows the tool's operations to be integrated with other steps or APIs inside a C# executable. The API is included in the Split/Merge Nuget package and documented here.

0
cbattlegear On

The shortest answer to this is there isn't an all in one tool yet.

This is mostly because each sharded database is unique in how it is setup and what the schema of the individual shards are. Because of this you must manually create the shard and get it registered so that you can get the data moved to it.