MongoDB Simple Introduction and Installation

Source: Internet
Author: User

The recent period of time for MongoDB has been a simple learning from what is it? Do? How to use it? Advantages and Disadvantages This series of questions can now be used simply. I would like to have a brief summary and overview of it. Then this article will start with the most basic, the main concept and installation to explain.

first, what is it?

Baidu Encyclopedia is defined as:

Mongo db is a non-relational database (NOSQL) that is now popular in the it industry, and its flexible data storage methods are currently IT practitioners.

Mongo DBvery good implementation of object-oriented thinking(OOthought),in theMongo DBinEach record is aDocumentobject. MongoDBThe biggest advantage is that all data persistence operations are not manually written by developersSQLStatement,the direct call method can be easily implementedCRUDoperation.

Of course, get used to the relational database of us, suddenly a non-relational type, will make you feel a hint of a silk awkward. But don't worry. It is also the ability to have a relationship type to better study in the control.

Next, let's take a look at what's going on between them.

Ii. comparison with relational database

Now that we know that there are a lot of similarities between them, then let's go further: look

watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqvbgl1x3l1amllmjaxmwnvbq==/font/5a6l5l2t/fontsize/400/fill/ I0jbqkfcma==/dissolve/70/gravity/center ">

The above figure shows that the general structure of MongoDB is the same, so that we can learn the difference between them in a targeted way. Next talk about the difference:

           1. relational database each record must be guaranteed to have each field mongodb document key can be different

2. relational queries require SQLfor each query,while MongoDB uses the built-in find() function.

-- based on BSON of special queries.

third, when to use?

1. site data:MONGO is ideal for real-time inserts, updates and queries, as well as the replication and high scalability required for site real-time data storage.

2. Cache: Because performance is very high. The MONGO is also suitable as a caching layer for the information infrastructure.

After the system restarts. The persistent cache layer built by MONGO can avoid overloading the underlying data sources.

3. Large size. Low-Value data: it can be expensive to store some data using a traditional relational database, and before that, very often the program ape would choose traditional files for storage.

4. Highly Scalable scenario:TheMONGO is ideal for databases consisting of dozens of or hundreds of servers. Built-in support for the MapReduce engine is already included in the roadmap for MONGO.

5. Storage for objects and JSON data: MONGO's Bson data format is ideal for storing and querying in document formats

Iv. Installation and configuration

The above is a simple description of it, it is now installed and configured

1. Download the installation package: Suppose it is a win system. Note that there are two points.

http://www.mongodb.org/downloads

2. Create a new folder "D:\MongoDB", unzip the downloaded installation package and locate all the. exe under the Bin folder . c8> file, copy to the newly built MongoDB .

3. Create a new "D:\MongoDBDATA" directory to hold the root directory of the data.

4. Configuration:

Open the cmd form. Enter the command as follows:

>d:

>CD D:\MongoDB

>mongod--dbpath D:\MongoDB\data

Note that you can configure MongoDB 's bin to Path, How to appear for example the following shows that the configuration was successful:

in the browser input:http://localhost:27017/, you can see for example the following prompt:

You is trying toaccess MongoDB on the native driver port. For HTTP diagnostic access, add 1000to the port number

So, MongoDB The database service has successfully started.

5. Start the database service

for convenience. We were able to write two bat files, and when we were writing, we could just run them without having to write them manually every time:

mongodb.bat file:mongod--dbpath D:\MongoDBDATA--rest

watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqvbgl1x3l1amllmjaxmwnvbq==/font/5a6l5l2t/fontsize/400/fill/ I0jbqkfcma==/dissolve/70/gravity/center ">

Mongodb27017.bat File: MONGO 127.0.0.1:27017/admin

v. Summary

Through the above introduction we will be able to do simple additions and deletions, and so a series of operations, then start our practice practice it!

MongoDB Simple Introduction and Installation

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.