Here’s a short tutorial on how to install and use RethinkDB, the popular NoSQL database, on Ubuntu machines.
RethinkDB is an open source, free, distributed, and document based database server. This NoSQL database has been developed by Rethink, and can store JSON files with schemas that are dynamic. More importantly, real-time updates for query results can be pushed for applications to use. Since it is a distributed database, it is highly scalable. It has many automatic functions, making it a highly available database. As it is a popular database today, it is important that we learn how to use it.
Let’s start with how we can install and use it on our Ubuntu machines. First, to add the packages required to install RethinkDB to our updates, we need to run the following command, as shown in Figure 1.
source /etc/lsb-release && echo” deb https://download.rethinkdb.com/repository/ubuntu-$DISTRIB_CODENAME $DISTRIB_CODENAME main” | sudo tee /etc/apt/sources.list.d/rethinkdb.list
The following command adds it to our repositories (Figure 2):
wget -qO- https://download.rethinkdb.com/repository/raw/pubkey.gpg | sudo apt-key add -
After adding new repositories, our package manager has to be updated using the following command, as shown in Figure 3.
sudo apt update
Once this is done, we can install RethinkDB using the following command, as shown in Figure 4.
sudo apt-get install rethinkdb
After installation, we first need to start it by running the following command:
sudo systemctl start rethinkdb
To check if it has started properly, enter the following command, as shown in Figure 5:
sudo systemctl status rethinkdb
We can now start using it. To set it up, enter ‘rethinkdb’ on the terminal, as shown in Figure 6.
To open up the database server, enter the IP address with port number 8080 on the browser, as shown in Figure 7.
RethinkDB can now be used as any NoSQL database. It’s great fun to explore it and use it to its fullest potential!!