Getting started with the Mongodb for PHP tutorial installation

Source: Internet
Author: User
Tags mongodb server php tutorial

Brief introduction:

MongoDB is a product between a relational database and a non-relational database, and is the most versatile and most like relational database in a non-relational database. The data structure he supports is very loose and is a JSON-like Bjson format, so you can store more complex data types. MONGO's biggest feature is that the query language he supports is very powerful, and its syntax is a bit like an object-oriented query language that almost implements most of the functionality of a relational database single-table query, and also supports indexing of data.

It is characterized by high performance, easy to deploy, easy to use, and easy to store data. The main features are:

· For collection storage, easy to store data for object types.

· Mode of freedom.

· Supports dynamic queries.

· Supports full indexes, including internal objects.

· Support Queries.

· Supports replication and recovery.

· Use efficient binary data storage, including large objects such as video.

· Automatically process fragmentation to support scalability at the cloud level

· Supports multiple languages such as ruby,python,java,c++,php.

· File storage format is Bson (an extension of JSON)

· Accessible over the network

The so-called "set-oriented" (collenction-orented), meaning that data is grouped in a dataset, is called a collection (collenction). Each collection has a unique identifying name in the database and can contain an unlimited number of documents. The concept of a collection is similar to a table in a relational database (RDBMS), unlike it does not need to define any schema (schema).
Mode Freedom (schema-free) means that for files stored in a MongoDB database, we do not need to know any of its structure definitions. If necessary, you can store files of different structures in the same database.
The documents stored in the collection are stored in the form of key-value pairs. The key is used to uniquely identify a document as a string type, whereas a value can be a complex file type in each. We call this storage form Bson (Binary serialized dOcument Format).

The MongoDB server can run on Linux, Windows or OS X platforms, supports 32-bit and 64-bit applications, and the default port is 27017. Recommended to run on 64-bit platforms because MongoDB

The maximum file size supported when running in 32-bit mode is 2GB.

MongoDB stores the data in a file (the default path is:/data/db), which is managed using a memory-mapped file for increased efficiency.

Several popular websites

* Official website: http://www.mongodb.org

* api:http://www.php.net/manual/en/book.mongo.php

* tutorial:http://php.net/manual/en/mongo.tutorial.php

* Download: Http://downloads.mongodb.org/win32/mongodb-win32-i386-1.8.1.zip

* Driver for Php:https://github.com/mongodb/mongo-php-driver/downloads

Installation:

Linux/os x:
1 Setting up the data Catalog
Mkdir-p/data/db
2 Downloading a compressed package
Curl-o http://downloads.mongodb.org/linux/mongodb-linux-i686-latest.tgz
3 Extracting files
Tar zxvf mongodb-linux-i686-1.8.3.tgz
4 Starting the Service

CD mongodb-linux-i686-1.8.3
Bin/mongod Run &
5 Using your own client connection
/bin/mongo
The following result appears: The default port number is 27017 port

Common Startup parameters:
Run to start directly. Example:./mongod Run
--DBPATH specifies that a specific storage directory is started and is created if the directory does not exist. Example:./mongod--dbpath/var/data/mongo
--port the specified port to start. Example:./mongod--port 12345

To stop the MONGO service:
Method 1: Stop the server and use CTRL + C
Method 2: Stop at the client to connect to the client first
./mongo
and use the command
Db.shutdownerver ()
Then quit the client
Exit

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.