MongoDB Installation, Configuration, and Advantages

MongoDB Installation, Configuration, and Advantages

MongoDB is a No SQL database. It is an open-source, cross-platform written in C++. It does not support Structured Query Language (SQL) to manipulate or retrieve stored data. It stores data in a document structure instead of storing data in tables. This is similar to JSON.

Installation

1) Add MongoDB repository.

Change the directory to repos.d directory.

# cd /etc/yum.repos.d

create file for MongoDB

# vi mongodb.repo

Add the following lines to the file mongodb.repo

[mongodb]

name=MongoDB Repository

baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/x86_64/

gpgcheck=0

enabled=1

 

2) Install MongoDB.

# yum repolist

# yum -y install mongodb-org

# service mongod start

 

3) Check MongoDB Service Status.

# service mongod status

 

4) To check installed mongodb version.

# mongod –version

 

5) To check proper working of MongoDB

# mongo

 

To create a MongoDB administrator user

1) Open mongoDB shell

# mongo

 

2) switch to database ‘admin’

> use admin

 

3) Type the below query to create a user:

> db.createUser(

{

user: “admin”,

pwd: “123admin”,

roles: [ { role: “userAdminAnyDatabase”, db: “admin” } ]

}

)

 

4) To view the created user:

  > show users

{

“_id”: “admin.admin”,

“user” : “admin”,

“db” : “admin”,

“roles” : [

{

“role” : “userAdminAnyDatabase”,

“db” : “admin”

}

]

}

>

 

 Advantages

1) Document based data model.

2) Easy to scale.

3) It supports the common authentication mechanisms, such as LDAP, AD, and certificates.

4) MongoDB can be a cost-effective solution by  increasing flexibility and reducing cost on hardware and storage.

5) Deep query-ability.

6) Provides high performance data persistence.

7) Support embedded data models and reduces I/O activity on database system.

 

Where to Use MongoDB?

1) User Data Management: It ensures that the items that users create, such as personal files and documents.

2) Big data: It is a collection of large data sets that cannot be processed using traditional computing techniques.

3) Content Management and Delivery: It is a computer application that supports the creation and modification of digital content.

4) Mobile and Social Infrastructure

5) Data Hub: It is a database which is populated with data from one or more sources and from which data is taken to one or more destinations.

 

If you need any further assistance please contact our support department.

  • 0

Install Wine on Linux Distribution

Install Wine on Linux Distribution In this tutorial, we can check how to Install Wine on Linux...

Install Apache Tomcat on Ubuntu 18.04

Install Apache Tomcat on Ubuntu 18.04 The Apache Tomcat is a free, open-source Java-based web...

How to Install and Setup Angular CLI

How to Install and Setup Angular CLIAngular is an open-source framework for your web...

How to Install Jenkins on CentOS and Ubuntu Server?

How to Install Jenkins on CentOS and Ubuntu Server? Jenkins is a free and open-source automation...

Setup ILIAS LMS on Ubuntu 18.04/16.04 with Nginx

ILIAS is an Open-Source Learning Management System. ILIAS LMS offers to develop and realizing...