how to setup sharding
CUBRID Official Forum » General Discussions » how to setup sharding
|
author
|
message
|
|
|
Post subject: how to setup sharding Post date: 2012.11.09 |
|
registered: 05/13/2012 IP: *.64.199.155 views: 4 |
I read the document but I can't still figure out how to use sharding. Can you please spread some more info about it, a step by step guide, or what happens when I want to add another shard, any sharding configuration strategies, etc. |
| Quote | |
|
|
# Post subject:Re: how to setup sharding Post date: 2012.11.11 |
|
registered: 03/29/2010 IP: *.91.139.67 |
Hi idam, I will give you the information about Sharding soon. |
| Quote | |
|
|
# Post subject:Re: how to setup sharding Post date: 2012.11.11 |
|
registered: 03/29/2010 IP: *.91.139.67 |
Quote I read the document but I can't still figure out how to use sharding. Can you please spread some more info about it, a step by step guide, or what happens when I want to add another shard, any sharding configuration strategies, etc. For a really quick getting started tutorial you can check out "Database Sharding the Right Way: Easy, Reliable, and Open source" presentation we have delivered at HighLoad++ 2012 Conference a few weeks ago. Particularly slides from 23 to 40. All you have to do to get started is:
That's all! Here is a sample Java program which demonstrates how to connect and retrieve data from CUBRID SHARD. In your application you can indicate these Shard SQL Hints to get specific sharding behavior. If you are interested in feeding your own library to generate the sharding strategy, refer to Setting User-Defined Hash Function. Once you get started you may want to monitor the system. In that case, see various CUBRID SHARD Utilities. You may also be interested in CUBRID SHARD Logs. Also check out this forum thread where one of the user has asked a similar question regarding CUBRID Sharding. More information can be found at CUBRID SHARD Documentation. Regarding "what happens when I want to add another shard", at this moment CUBRID 9.0 doesn't provide data auto rebalancing. You can add or remove shards by changing your shard_key.txt and shard_connection.txt files. However, you need to rebalance the data manually, if necessary. We plan to add data auto-rebalancing feature to CUBRID SHARD in the next version. So, for now, you should determine what will your data size be and decide how many shard you want to start. You can also start with one or two shards and create multiple (2+) shard key ranges in shard_key.txt file. Some of the ranges will resolve to the first shard id, while the rest will resolve to the second shard id. Later when these two shards become too large and you want to add one more shard, you can simply change and set some shard key ranges to this newly added shard id. Thus you can add or remove shards. If you have any specific question, feel free to ask. I will be glad to help you! |
| Quote | |