2

I have an expanding MariaDB 3 node cluster and need to expand the available storage. Each node has (to make the maths slightly easier) 120Gb of database storage. As this is replicated, the total DB storage is also therefore 120Gb. If I add a 4th node, I will gain extra resilience and maybe better read speed, but still only have 120Gb storage.

               Server A           Server B          Server C
               +-------+          +-------+         +-------+
               | 120Gb |          | 120Gb |         | 120Gb |  
               +-------+          +-------+         +-------+

Cluster1 -->   +-------+          +-------+         +-------+
 (120Gb)       | 120Gb |          | 120Gb |         | 120Gb |  
               +-------+          +-------+         +-------+
Total storage 120Gb

I am looking at Sharding, using SPIDER tables within MariaDB, to increase the available space but without losing my current x3 replication. With SPIDER you can storage a table across multiple databases, so I am thinking I need to move to a model like this, adding a 4th server D also with 120Gb, but effectively running 4 database clusters across these boxes...

                Server A           Server B          Server C          Server D
                +-------+          +-------+         +-------+         +-------+
                | 120Gb |          | 120Gb |         | 120Gb |         | 120Gb |  
                +-------+          +-------+         +-------+         +-------+

 Spider -->     +-------+          +-------+         +-------+         +-------+                    
  ( ~0Gb)       +-------+          +-------+         +-------+         +-------+                    

 Cluster1 -->   +-------+          +-------+         +-------+          
  ( 40Gb)       |  40Gb |          |  40Gb |         |  40Gb |         
                +-------+          +-------+         +-------+          

 Cluster2 -->                      +-------+         +-------+         +-------+          
  ( 40Gb)                          |  40Gb |         |  40Gb |         |  40Gb |         
                                   +-------+         +-------+         +-------+          

 Cluster3 -->   +-------+                            +-------+         +-------+    
  ( 40Gb)       |  40Gb |                            |  40Gb |         |  40Gb | 
                +-------+                            +-------+         +-------+   

 Cluster4 -->   +-------+          +-------+                           +-------+          
  ( 40Gb)       |  40Gb |          |  40Gb |                           |  40Gb |         
                +-------+          +-------+                           +-------+          

 (total 160Gb)

Each cluster (horizonally) would have 3 box replication and storage 40Gb, while each server (vertically) would store up to 120Gb. Each additional box would therefore add one third of 120Gb...

This makes sense to me, I have been testing and I can get multiple MariaDB instances running per box. It then just a matter of keeping all the plans in order, organising which slices will be on which boxes and keeping track of port numbers (each MariaDB instance has to have a different port number on). I can even run a thin cluster slice with just the logical Spider tables on the same box too.

Is there an easier way? I can find lots of guides for using Spider, but very few for using MaxScale?? Can anyone point me in the right direction please? (I feel like I am having to re-invent too much myself when I'm sure this is not an uncommon situation)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.