• About
  • Contact us

MySQL Step-by-Step Blog

MySQL Step-by-Step Blog

Tag Archives: Sharding

What is the default sharding key in MySQL Cluster?

09 Monday Jan 2017

Posted by Moll in High Availability (HA), MySQL, MySQL Cluster, Sharding

≈ 3 Comments

Tags

Abdel-Mawla Gharieb, MySQL, MySQL Cluster, Partitioning, Sharding

MySQL Cluster does an automatic sharding/partitioning to the tables across data nodes, enabling databases to scale horizontally to serve read and write-intensive workloads, but what is the default sharding key used in partitioning the data?
According to the recent update (Oct, 2016) of the MySQL Cluster white paper, primary key is the default sharding key:

By default, sharding is based on hashing of the primary key, which generally leads to a more even distribution of data and queries across the cluster than alternative approaches such as range partitioning.

However, that is not the case in all MySQL Cluster versions so far!
In this post, I’ll do some test cases on MySQL Cluster (of 4 datanodes) to confirm the default sharding key. Continue reading →

Advertisement

Partitions number in MySQL Cluster

16 Friday Dec 2016

Posted by Moll in High Availability (HA), MySQL, MySQL Cluster, Sharding

≈ 6 Comments

Tags

Abdel-Mawla Gharieb, MySQL, MySQL Cluster, Partitioning, Sharding

As stated in the MySQL Cluster documentation:

Partition.  This is a portion of the data stored by the cluster. There are as many cluster partitions as nodes participating in the cluster. Each node is responsible for keeping at least one copy of any partitions assigned to it (that is, at least one replica) available to the cluster.

According to my understanding for the previous paragraph, if we have a cluster of 6 datanodes we should have 6 partitions for each NDB table. I claim that this is not true for all cases – at least, after the introduction of ndbmtd (Multi-Threaded Daemon) in MySQL Cluster 7.2 .
In this post, I’ll do some test cases to show that the number of partitions in the cluster has a relation with the number of LDM threads as well as the number of data nodes. Continue reading →

Spider for MySQL – Implementation

04 Monday May 2015

Posted by Moll in MySQL, Sharding

≈ 5 Comments

Tags

Abdel-Mawla Gharieb, MySQL, Sharding, Spider for MyQL

In a previous post, I wrote an overview about Spider for MySQL with its advantages and disadvantages. Now I’ll go through a simple example demonstrating how to implement Spider for MySQL.

System information:

MySQL instances information (shards):

  • Server: 3 VMs (here in after will be mentioned as mysqla “192.168.56.51”, mysqlb “192.168.56.52” and mysqlc “192.168.56.53”).
  • OS: CentOS 6.4
  • RAM: 512MB
  • MySQL version: 5.5.43 (tar-balls)
  • Download link: http://dev.mysql.com/get/Downloads/MySQL-5.5/mysql-5.5.43-linux2.6-x86_64.tar.gz

Continue reading →

Spider for MySQL – Overview

03 Friday Apr 2015

Posted by Moll in MySQL, Sharding

≈ 3 Comments

Tags

Abdel-Mawla Gharieb, MySQL, Sharding, Spider for MyQL

Having big tables is one of the expected database problems, especially, for the fast growing database systems. In fact, big tables itself is not a problem but with big tables, the following problems are strongly expected:

  1. Retrieving data from big tables is so slow.
  2. It is a very hard job to maintain those tables like adding/removing an index, adding/dropping/modifying a column, … etc.
  3. System resources, especially, the IO system might not be able to handle such huge traffic of writes and reads.
  4. When it comes to the reporting queries, it might be a horrible nightmare!
  5. Always cause disk space problem.

Continue reading →

Subscribe

  • Entries (RSS)
  • Comments (RSS)

Archives

  • August 2019
  • May 2018
  • April 2017
  • January 2017
  • December 2016
  • November 2016
  • April 2016
  • July 2015
  • June 2015
  • May 2015
  • April 2015
  • March 2015

Categories

  • MySQL
    • Backup and Recovery
    • High Availability (HA)
    • MySQL Cluster
    • MySQL Operations
    • MySQL Replication
    • Sharding

Meta

  • Register
  • Log in
Follow MySQL Step-by-Step Blog on WordPress.com

Website Powered by WordPress.com.

Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
To find out more, including how to control cookies, see here: Cookie Policy
  • Follow Following
    • MySQL Step-by-Step Blog
    • Join 25 other followers
    • Already have a WordPress.com account? Log in now.
    • MySQL Step-by-Step Blog
    • Customize
    • Follow Following
    • Sign up
    • Log in
    • Report this content
    • View site in Reader
    • Manage subscriptions
    • Collapse this bar