If you can't read please download the document
Upload
php-user-group-minsk
View
2.015
Download
4
Embed Size (px)
Citation preview
MongoDB & PHP
MongoDB & PHP 1993-2012. EPAM Systems. All Rights Reserved.
Alex Litvinok
Just Intro.
MongoDB is Document-oriented database
Full Index supportQueryingAtomic modifiersReplication & ShardingMap-Reduce & GridFS
MongoDB in SQL termsCollectionTableDocumentRow
IndexIndexEmbeddingJoinShardPartitionDatabaseDatabase
NormalizedSQL CredoDenormalizedTrue MongoDB
Not Only SQL.
Retains some friendly properties of SQL.
AGPL licenseWritten on C++Custom protocol (BSON)
Best of BigTable and Dynamo
Apache licenseWritten on JavaThrift & custom binary (CQL3) protocol
Blazing fast
BSD licenseWritten on C/C++Thrift & custom binary (CQL3) protocol
DB consistency, ease of use
Apache licenseWritten on C/C++HTTP/REST protocol
Graph database - connected data
GPL/AGPL/Commercial licensesWritten on JavaHTTP/REST (or embedding in Java) protocol
Billions of rows X millions of columns
Apache licenseWritten on JavaHTTP/REST (also Thrift) protocol
MongoDB DocumentsCassandraColumn familiesRedisCollectionsCouchDBDocumentsNeo4jGraphsHbaseColumn families
B-TreeMongoDBMemtable / SSTableCassandraIn-Memory with snapshotsRedisAppend-only B-TreeCouchDBOn-disk linked listsNeo4jMemtable / SSTable on HDFSHbase
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 Driver01.
The MongoClient class .The MongoDB classThe MongoCollection class .The MongoCursor class .. The MongoClient class .The MongoDB class . The MongoCollection class .. The MongoCursor class .The MongoClient classThe MongoDB classThe MongoCollection classThe MongoCursor class
01. $m=newMongoClient();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]);
CakePHPDoctrineDrupalKohana FrameworkLithiumYiiZend FrameworkLibraries and Frameworks
ActiveMongoMapReduce APIMongoFilesystemMandangoMongoDB PaginationMongoDB PHP ODMStand-Alone Tools
http://docs.mongodb.org/ecosystem/drivers/php-libraries/
The End.
The End.