RethinkDB installation guide and Overview
Tags: Relational Databases, Rethinkdb, Dba, NoSQL, Dbms

just like another No-SQL database,

there’s RethinkDb

just one big word from my side for RethinkDB -

“BEAUTIFUL”

Before starting the installation process,

Let's first know about RethinkDB.

RethinkDB is an open-source NoSQL database, that can store JSON documents with dynamic schemas. In that sense, it’s very different from Mongo, which stores BSON documents. BSON’s an extension to JSON, to extend data coverage like timestamps, lat-long coordinates, apart from regular JSON’s types — numbers, strings, booleans, arrays, nested objects, and null types.

So, the data that we get after performing the rethink query will be in JSON

and the query that we use to search is no different than a general statement

for ex :

r.table(‘usersData’).filter({‘department’: ‘IT’}).pluck(‘name’, ‘contact’).run()

which means,

query the usersData table, filter the data with department as IT and show only id and email

the data output that we can get is :

[{

“name”: “admin”,

“contact”: “9191919191”

},

{

“name”: “newUser”,

“contact”: “6161616161”

},

{

“name”: “demoUser”,

“contact”: “7171717171”

}]

let us move towards the setting up part :

setting up rethinkDB is not a hard task

Step 1: Install the required packages

(you can get them by installing the software upgrade)

-> sudo apt update

-> sudo apt install apt-transport-https

Step 2: Installing RethinkDB

If you don’t want to manually install the RethinkDB from its .DEB file, then add RethinkDB’s official package repository to make installing and updating it

To add the RethinkDB repository and key, run the commands below. The first line imports the repository’s GPG key. the second adds the RethinkDB repository into a new file named as rethinkdb.list

-> wget -qO- https://download.rethinkdb.com/apt/pubkey.gpg | sudo apt-key add -

-> source /etc/lsb-release && echo “deb http://download.rethinkdb.com/apt $DISTRIB_CODENAME main” | sudo tee /etc/apt/sources.list.d/rethinkdb.list

Once these steps are done,

run the following commands to install it

-> sudo apt update

-> sudo apt install rethinkdb

Step 3: Accessing the Server

After installing the RethinkDB using the commands above,

you can use the service using the following commands

-> sudo systemctl stop rethinkdb

(to stop the service)

-> sudo systemctl start rethinkdb

(to start the service)

-> sudo systemctl enable rethinkdb

(to enable the service and keep it ready to start)

Also, to verify the status of the rethink server,

you can use the following command

-> sudo systemctl status rethinkdb

Once the rethink Server is started successfully,

you will see something like this

Running rethinkdb 2.4.0~0xenial (GCC 5.4.0)…

Running on Linux 4.15.0–123-generic x86_64

Loading data from directory /home/pratiklahudkar/rethinkdb/rethinkdb_data

Listening for intracluster connections on port 29015

Listening for client driver connections on port 28015

Listening for administrative HTTP connections on port 8080

Listening on cluster addresses: 127.0.0.1, ::1

Listening on driver addresses: 127.0.0.1, ::1

Listening on http addresses: 127.0.0.1, ::1

this means, the rethink Server is running at 127.0.0.1:8080

or localhost:8080

there’s Another method to start the rethink server

take your command line pointer to the rethink directory

and type the following

-> rethinkdb

this is another way to start rethinkdb

Step 4: Accessing the RethinkDB data

rethink provide easy management using an interactive web interface

the only thing you need to do is search

127.0.0.1:8080

or

localhost:8080

in your browser and that's it,

the rethinkDB interface is in front of you

do whatever you want.

Congratulations on your successful installation of RethinkDB !!!

Do whatever productive you can.