Executing ReQL queries in a cluster

We have our cluster in place running smoothly; let's perform a ReQL query and observe the response. First we will create a new table in the test database. As we have learned in Chapter 2, RethinkDB Query Language, we need to use the tableCreate() method to create a new table.

Let's execute a query from the web administrative screen:

r.db("test").tableCreate('clusterTest2') 

Here is our response object:

Executing ReQL queries in a cluster

As you may have noticed the highlighted section, primary_replica is showing that this table is stored at a machine ending with _y7b, which is my second machine in the cluster. This proves that RethinkDB automatically ...

Get Mastering RethinkDB now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.