Discussion on MongoDB-Introduction and environment construction

Source: Internet
Author: User
Tags install mongodb mongodb

I. INTRODUCTION

With the rise of internet web2.0 website, the traditional relational database in dealing with web2.0 website, especially the super large-scale and high concurrent SNS type web2.0 pure dynamic website already appeared to be powerless, exposed many insurmountable problems, but the relational database is very rapid development because of its own characteristic. MongoDB's extraordinary performance makes it occupy an important place in NoSQL, and of course other NoSQL databases, such as Couchdb,redis,hbase, are also different. This series will lead us to enjoy the charm of MongoDB.

1, MongoDB is what.

MongoDB is a powerful, flexible, scalable way of storing data. It expands the many useful features of relational databases, such as secondary indexes, range queries (range query), and sorting. MongoDB is rich in functionality, such as built-in support for MapReduce aggregation, and support for geo-spatial indexing.

2, why use MongoDB.

2.1, a rich data model. Because MongoDB does not have a pattern, the supported data models are equally rich (basically supporting all data models in real life) and are easy to change.

2.2, easy to expand. MongoDB's document-oriented data model allows it to automatically split data across multiple servers, and it also balances data and load on clusters and automatically rearrange documents. If you need to expand capacity, just add new machines to the cluster.

2.3, the rich function.

2.3.1, index. MongoDB supports a common auxiliary index, enables a variety of quick queries, and also provides unique, composite, and geo-spatial indexing capabilities.
2.3.2, storing JavaScript. Developers can support functions and values that access JavaScript on the server side instead of using stored procedures in relational databases.
2.3.3, aggregation. MongoDB supports MapReduce and other aggregation tools, which provide support for cloud computing.
2.3.4, fixed collection. The collection has a maximum size, which is especially useful for certain types of data, such as logs.
2.3.5, file storage. MongoDB supports the use of Bson (Binary JSON)-formatted protocols to store metadata for large files and files.

2.4, excellent performance. MongoDB uses the MONGODB transport protocol as the primary way to interact with the server, saving a lot of overhead than the Http/rest protocol. The default storage engine uses memory-mapped files to give memory management work to the operating system.

2.5, easy management. MongoDB simplifies the management of the database server by automating the server configuration as much as possible, such as primary/standby switching, integration and configuration of new nodes in the integrated environment.

Second, installation and start-up

1, MongoDB installation is very simple, just according to the operating system version from the official website http://www.mongodb.org/downloads download the corresponding binary compression package, decompression, the implementation of installation can be. You can place the MongoDB bin path in the path variable to facilitate access to MongoDB from the console.

2, create the database file storage directory, the default is C:\data\db. If it is not the default directory, you need to specify the data directory when you start the MongoDB.

3, open the command prompt (Cmd.exe), into the MongoDB extract directory (if you add path can be omitted), and then execute

Bin/mongod.exe
If you are not using the default directory (C:\DATA\DB), you need to specify using the--dbpath parameter:

>mongod--dbpath E:\Study\MongoDB\db
Iii. installing MongoDB as a service

Use the--install parameter to install MongoDB as a service, as follows:

>mongod--dbpath "\" E:\Study\MongoDB\db\ ""--install

After the startup is successful, the server prints the version and System information, and then waits for the connection. By default, MongoDB listens on port 27017. Mongod also launches a very basic HTTP server that listens for ports with a number 1000 higher than the primary port, or 28017 ports. You can access the http://localhost:28017 to obtain management information for the database.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.