Distributed File storage database-MongoDB

Source: Internet
Author: User
What is MongoDB?

MongoDB is a distributed file storage-based database. Written in C ++. It is designed to provide scalable, high-performance data storage solutions for Web applications.

MongoDB is a product between relational databases and non-relational databases. It has the most abundant functions and is the most similar to relational databases. The supported data structure is very loose and is similar to the JSON bjson format. Therefore, it can store complicated data types. The biggest feature of Mongo is that it supports a very powerful query language. Its syntax is somewhat similar to an Object-Oriented Query Language. It can almost implement most of the functions similar to single-table queries in relational databases, it also supports data indexing.

Several advantages of MongoDB

MongoDB is a document-oriented database, not a relational database.

1. MongoDB has a wide range of data models. The basic idea is to replace the original "line" concept with a more flexible "document" model. A record can represent a very complex hierarchy.

2. It is very easy to expand. In the face of increasing data volumes, there are usually two solutions: one is to purchase better hardware, and the other is to distribute and expand data. The former has great disadvantages, because the hardware usually has the physical limit, when the limit is reached, the processing capability cannot be expanded. Therefore, we recommend that you use the cluster for expansion. The document-oriented data model adopted by MongoDB enables it to automatically split data between multiple servers. It can also balance the data and load of clusters and automatically rearrange documents.

3. Rich functions. Including indexes, JavaScript storage, aggregation, fixed sets, and file storage.

4. excellent performance.

5. Easy management: in addition to starting the database server, there is almost no necessary management operations. To manage a cluster, you only need to know that there are new nodes, and the new nodes are automatically integrated and configured.

Several Basic concepts of MongoDB

Document

A document is the basic unit of data in MongoDB and is very similar to a row in a relational database management system.

Document is the core concept of MongoDB. Multiple keys and their associated values are put together in an orderly manner.

MongoDB represents a document in JSON-like format, for example:

{"Greeting": "Hello MongoDB! "}

Stored as a key value. values can be of different types, such as strings and integers.

Set

A set of documents. Similar to tables in relational databases.

We can use any UTF-8 string to name the set.

To make the organizational structure better, we can use child sets. A convention for organizing a set is to separate sub-sets by namespace using the "." character.

Database

Multiple documents in MongoDB form a set, and multiple collections form a database. A MongoDB instance can host multiple databases, which can be considered completely independent.

The database name can be any UTF-8 string.

Except for some rules, some database names are reserved and cannot be used as database names, including "admin", "local", and "Config ".

Install 64-bit Ubuntu on a virtual machine in 32-bit win7

If it is 32-bit Ubuntu, the installation is smooth, but there is a problem when it comes to installing 64-bit ubuntu.

The following error is reported:

This kernel requires an x86-64 CPU, but only detected an i686 CPU.
Unable to boot-Please use a kernel appropriate for your CPU.

Solution:

First download a CPU-Z. The download address is

Http://www.xiazaiba.com/html/160.html

Open and check

If the display supports 64-bit, it should be because the BIOS is not set. restart the computer to enter the BIOS.

Find CPU ==> Intel (r) virtualization technology ==> set to Enabled

Note: This will take effect after cold start.

Then, reinstall the system. Everything is normal.

Start MongoDB

First, download and install it. download it to the official MongoDB website. If you lose it at Baidu or Google, the first one is:

Http://www.mongodb.org/downloads

Because the 64-bit Ubuntu is used, 64-bit MongoDB is downloaded and decompressed.

Run./mongod in the decompressed bin directory.

The system prompts that the path does not exist. Create a path, run mkdir-P/data/dB, and grant the permission.

Then execute./mongod again, and start normally.

Enter

Http: // localhost: 28017

You can obtain database management information.

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.