Pages

Monday, February 16, 2015

Using MongoDB in Linux


Using MongoDB in Linux
----------------------------------
 MongoDB is free, open-source Database software. MongoDB (from humongous) is a cross-platform document-oriented database. Classified as a NoSQL database, MongoDB eschews the traditional table-based relational database structure in favor of JSON-like documents with dynamic schemas (MongoDB calls the format BSON), making the integration of data in certain types of applications easier and faster.



Use can use MongoDB when.....................

Expect a High Write Load
Need High Availability in an Unreliable Environment (Cloud and Real Life)
Need to Grow Big (and Shard Your Data)
Data is Location Based
Data Set is Going to be Big (starting from 1GB) and Schema is Not Stable
Don't have a DBA

---------------------


## Java is needed for mongodb. Install this by YUM

yum install mongodb
yum install mongodb-server
yum install java

## Start and check This service


 /etc/init.d/mongod start
 /etc/init.d/mongod status

## To login type:
mongo


show dbs

use test

help

### Create Database

If you want to create a database with name <tayabdb>,
then use DATABASE statement would be as follows:

use tayabdb

## To display database you need to insert atleast one document into it.

db.tayabdb.insert({"khan":"tutorials point"})

show dbs






No comments:

Post a Comment