際際滷

際際滷Share a Scribd company logo
MongoDB & PHP
息 1993-2012. EPAM Systems. All Rights Reserved.
Alex Litvinok
Just Intro.
MongoDB is
Document-oriented
database
Full Index support
Querying
Atomic modifiers
Replication & Sharding
Map-Reduce & GridFS
MongoDB in SQL terms
Normalized
SQL Credo
Denormalized
True MongoDB
Not Only SQL.
Retains some friendly properties of
SQL.
AGPL license
Written on C++
Custom protocol (BSON)
Best of BigTable and Dynamo
Apache license
Written on Java
Thrift & custom binary (CQL3) protocol
Blazing fast
BSD license
Written on C/C++
Thrift & custom binary (CQL3) protocol
DB consistency, ease of use
Apache license
Written on C/C++
HTTP/REST protocol
Graph database - connected data
GPL/AGPL/Commercial licenses
Written on Java
HTTP/REST (or embedding in Java) protocol
Billions of rows X millions of
columns
Apache license
Written on Java
HTTP/REST (also Thrift) protocol
MongoDB Documents
Cassandra Column families
Redis Collections
CouchDB Documents
Neo4j Graphs
Hbase Column families
B-Tree MongoDB
Memtable / SSTable Cassandra
In-Memory with snapshots Redis
Append-only B-Tree CouchDB
On-disk linked lists Neo4j
Memtable / SSTable on HDFS Hbase
When? Why?
SAP uses MongoDB as a core
component of SAPs platform-
as-a-service (PaaS) offering.
MongoDB is used for back-end
storage on the SourceForge
front pages, project pages,
and download pages for all
projects.
The New York Times is using
MongoDB in a form-building
application for photo
submissions.
GitHub uses MongoDB for an
internal reporting
application.
Foursquare uses MongoDB to
store venues and user check-
ins into venues, sharding the
data over more than 25
machines on Amazon EC2.
They all use MongoDB
And they too..
About Integration.
Native PHP Driver
01. <?php
02.
03. $m = new MongoClient();
04. $db = $m->selectDB("example");
05.
06. ?>
ent class .
ongoDB class
ection class
.
sor class .
. The Mon
The MongoD
. The
.
. The Mo
The MongoClient class
The MongoDB class
The MongoCollection class
The MongoCursor class
01. $m = new MongoClient();
02. $db = $m->comedy;
03. $coll = $db->cartoons;
04.
05. $call->insert([name=>Alex]);
06.
07. $result = $call->find();
08. $result = $call->find([name => Alex]);
CakePHP
Doctrine
Drupal
Kohana Framework
Lithium
Yii
Zend Framework
Libraries and Frameworks
ActiveMongo
MapReduce API
MongoFilesystem
Mandango
MongoDB Pagination
MongoDB PHP ODM
Stand-Alone Tools
http://docs.mongodb.org/ecosystem/drivers/php-
libraries/
The End.
The End.

More Related Content

MongoDB & PHP