O'Reilly logo

Mastering RethinkDB by Shahid Shaikh

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Sharding the table to scale the database

Replication puts the same copy of the table in different RethinkDB instances in the cluster, while sharding splits the data and puts it in a different cluster. As we have studied in Chapter 1RethinkDB Architecture and Data Model, RethinkDB uses the range sharding algorithm to perform the splitting of records.

You can refer to that chapter for more details on the algorithm; in this section, we will be doing sharding in our cluster.

So let's take our cluster again and perform sharding of a table. To do so, again we have two options; either do it via a web console or ReQL. I am going to use a web console for the same.

So, as you can see in the following image, we have about 900 documents in the table with random ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required