Book Image

Mastering RethinkDB

By : Shaikh
Book Image

Mastering RethinkDB

By: Shaikh

Overview of this book

RethinkDB has a lot of cool things to be excited about: ReQL (its readable,highly-functional syntax), cluster management, primitives for 21st century applications, and change-feeds. This book starts with a brief overview of the RethinkDB architecture and data modeling, and coverage of the advanced ReQL queries to work with JSON documents. Then, you will quickly jump to implementing these concepts in real-world scenarios, by building real-time applications on polling, data synchronization, share market, and the geospatial domain using RethinkDB and Node.js. You will also see how to tweak RethinkDB's capabilities to ensure faster data processing by exploring the sharding and replication techniques in depth. Then, we will take you through the more advanced administration tasks as well as show you the various deployment techniques using PaaS, Docker, and Compose. By the time you have finished reading this book, you would have taken your knowledge of RethinkDB to the next level, and will be able to use the concepts in RethinkDB to develop efficient, real-time applications with ease.
Table of Contents (11 chapters)

Performing replication of tables in RethinkDB


We have a fully working cluster with us running two instances of RethinkDB. We can perform replication in our cluster to maintain high availability of data in case of failover. Replication, as the name suggests, means keeping the copy of a table in another instance to mainly handle failover scenarios. However, replication can also help you in scaling your system to improve performance and response time.

RethinkDB provides two ways to perform replication:

  • By using a web console

  • By using ReQL queries

You can use the tableCreate ReQL method and provide values for shards and replicaspershard keys to create your replication; we have covered ReQL queries in detail in Chapter 2RethinkDB Query Language. So, for this chapter, we will be covering replication using a web console, which is indeed a promising feature of RethinkDB (that is, easy administration).

To perform replication of tables, open your administrative screen and go to the tables screen. If...