SlideShare una empresa de Scribd logo
1 de 82
MongoDB and PHP
My name is
Steve Francia

     @spf13
• 15+ years building the
  internet

• Father, husband,
  skateboarder

• Chief Solutions Architect @
  10gen

• Author of upcoming O’Reilly
  publication “PHP and
  MongoDB”
Introduction to
   MongoDB
Why MongoDB?
MongoDB Goals
• OpenSource
• Designed for today
 • Today’s hardware / environments
 • Today’s challenges
• Easy development
• Reliable
• Scalable
• Company behind MongoDB
 • AGPL license, own copyrights, engineering
    team
  • support, consulting, commercial license
    revenue
• Management
 • Google/DoubleClick, Oracle, Apple, NetApp
 • Funding: Sequoia, Union Square, Flybridge
 • Offices in NYC, Redwood Shores & London
 • 60+ employees
A bit of history
1974
The relational database is created
1979
1979   1982-1996
1979   1982-1996   1995
Computers in 1995

•Pentium 100 mhz
•10base T
•16 MB ram
•200 MB HD
Cell Phones in 2011

•Dual core 1.5 Ghz
•WiFi 802.11n (300+ Mbps)
•1 GB ram
•64GB Solid State
How about a DB
designed for today?
It started with
  DoubleClick
Signs something
       needed
•doubleclick - 400,000 ads/second
•caching is de rigueur
•complex ORM frameworks
•computer architecture increasing in
  complexity
•cloud computing
Requirements
  We need enough functionality to handle
  broad set of use cases


•strong consistency / atomicity
•secondary indexes
•ad hoc queries
Trim unneeded
         features
  Leave out a few things so we can scale


•no choice but to leave out relational
•distributed transactions are hard to
  scale
Needed a scalable
      data model
  Considered....


•key/value
•columnar / tabular
•document oriented (JSON inspired)
MongoDB philosphy
• Keep functionality when we can (key/
  value stores are great, but we need more)
• Non-relational (no joins) makes scaling
  horizontally practical
• Document data models are good
• Database technology should run
  anywhere VMs, cloud or straight metal
MongoDB is:
          Application      Document
                           Oriented
                           { author: “steve”,
    High                     date: new Date(),
                             text: “About MongoDB...”,
Performance                  tags: [“tech”, “database”]}




                             Fully
                           Consistent

   Horizontally Scalable
MongoDB

•JSON Documents
•Querying/Indexing/Updating similar to
  relational databases
•Traditional Consistency
•Auto-Sharding
Under the hood

•Written in C++
•Available on most platforms
•Data serialized to BSON
•Extensive use of memory-mapped files
Database Landscape
This has led
    some to say

“
MongoDB has the best
features of key/ values
stores, document databases
and relational databases in
one.
               John Nunemaker
Use Cases
CMS / Blog
Needs:
• Business needed modern data store for rapid development and
  scale

Solution:
• Use PHP & MongoDB

Results:
• Real time statistics
• All data, images, etc stored together, easy access, easy
  deployment, easy high availability
• No need for complex migrations
• Enabled very rapid development and growth
Photo Meta-Data
Problem:
• Business needed more flexibility than Oracle could deliver

Solution:
• Use MongoDB instead of Oracle

Results:
• Developed application in one sprint cycle
• 500% cost reduction compared to Oracle
• 900% performance improvement compared to Oracle
Customer Analytics
Problem:
• Deal with massive data volume across all customer sites

Solution:
• Use MongoDB to replace Google Analytics / Omniture options

Results:
• Less than one week to build prototype and prove business case
• Rapid deployment of new features
Online Dictionary
Problem:
• MySQL could not scale to handle their 5B+ documents

Solution:
• Switched from MySQL to MongoDB

Results:
• Massive simplification of code base
• Eliminated need for external caching system
• 20x performance improvement over MySQL
E-commerce
Problem:
• Multi-vertical E-commerce impossible to model (efficiently) in
  RDBMS

Solution:
• Switched from MySQL to MongoDB

Results:
•   Massive simplification of code base
•   Rapidly build, halving time to market (and cost)
•   Eliminated need for external caching system
•   50x+ improvement over MySQL
Tons more
Pretty much if you can use a RDMBS or Key/Value
             MongoDB is a great fit
In Good Company
MongoDB in PHP
Relational made normalized
     data look like this
Document databases make
normalized data look like this
Terminology
   RDBMS                    Mongo
Table, View     ➜   Collection
Row             ➜   JSON Document
Index           ➜   Index
Join            ➜   Embedded Document
Partition       ➜   Shard
Partition Key   ➜   Shard Key
Documents to Objects
Documents to Arrays
 Tables to Documents
           {
           PostObject Object(
               [title] => MongoDB
              title: ‘MongoDB’,
               [contributors] => Array(
              contributors: [
                   [0] => PersonObject Object(
                 { name: ‘Eliot Horowitz’,
                       [name] => Eliot Horowitz
                       [email] => eh@10gen.com
                   email: ‘eh@10gen.com’ },
                   )
                 { name: PersonObjectMerriman’,
                   [1] => ‘Dwight      Object(
                   email: ‘dm@10gen.com’ }
                       [name] => Dwight Merriman
                       [email] => dm@10gen.com
              ],
                   )
              model: {
               )
                  relational: false,
               [model] => ModelObject Object(
                  [relational] =>
                  awesome:=>true
                  [awesome]    1
              })
           )
           }
Documents to Objects
    Documents to Arrays
     Tables to Documents
{                                   array(
                                    PostObject Object(
    title: ‘MongoDB’,                 "title" =>=> MongoDB
                                        [title] 'MongoDB',
                                      "contributors" =>=> Array(
                                        [contributors] array(
    contributors: [                      array( => PersonObject Object(
                                            [0]
       { name: ‘Eliot Horowitz’,           'name' => 'Eliot Horowitz',
                                                [name] => Eliot Horowitz
         email: ‘eh@10gen.com’ },          'email' => 'eh@10gen.com'
                                                [email] => eh@10gen.com
                                         ), )
       { name: ‘Dwight Merriman’,        array( => PersonObject Object(
                                            [1]
         email: ‘dm@10gen.com’ }           'name' => 'Dwight Merriman',
                                                [name] => Dwight Merriman
                                           'email' => 'dm@10gen.com'
                                                [email] => dm@10gen.com
    ],
                                         ) )
    model: {                          ),)
        relational: false,            "model" =>=> ModelObject Object(
                                        [model] array(
                                           'relational' => false,
                                           [relational]
        awesome: true                      'awesome' => true
                                           [awesome]    1
    }                                 ) )
}                                   )
Documents to Objects
    Documents to Arrays
     Tables to Documents
{                                   array(
                                    PostObject Object(
    title: ‘MongoDB’,                 "title" =>=> MongoDB
                                        [title] 'MongoDB',
                                      "contributors" =>=> Array(
                                        [contributors] array(
    contributors: [                      array( => PersonObject Object(
                                            [0]
       { name: ‘Eliot Horowitz’,           'name' => 'Eliot Horowitz',
                                                [name] => Eliot Horowitz
         email: ‘eh@10gen.com’ },          'email' => 'eh@10gen.com'
                                                [email] => eh@10gen.com
                                         ), )
       { name: ‘Dwight Merriman’,        array( => PersonObject Object(
                                            [1]
         email: ‘dm@10gen.com’ }           'name' => 'Dwight Merriman',
                                                [name] => Dwight Merriman
                                           'email' => 'dm@10gen.com'
                                                [email] => dm@10gen.com
    ],
                                         ) )
    model: {                          ),)
        relational: false,            "model" =>=> ModelObject Object(
                                        [model] array(
                                           'relational' => false,
                                           [relational]
        awesome: true                      'awesome' => true
                                           [awesome]    1
    }                                 ) )
}                                   )
MongoDB speaks
     PHP
This has led
    some to say


“
The single best interface
(API) of any php
extension.  
       Matthew Weier O'Phinney
PHP Driver
Installing the driver

 $ pecl install mongo




Add to php.ini

 extension = mongo.so
Connecting to the DB

$connection = new Mongo();

$db = $connection->selectDB('blog');

$posts = $db->post;




If the DB or collection doesn’t exist,
mongoDB will create it on connect.
Documents
Blog Post Document

$p1 = array("author"   =>   "roger",
            "date"     =>   new MongoDate(),
            "text"     =>   "about mongoDB...",
            "tags"     =>   array('tech', 'databases')
            );

$posts->save($p1);
Querying
print_r($posts->findOne());
> db.posts.findOne()
Array(
    [_id] => MongoId Object(
>   { _id : ObjectId("4c4ba5c0672c685e5e8aabf3"),
            [$id] => 4e9796764a18173a17000000
    author : "roger",
        )
      date : "Sat Jul 24 2010 19:47:11",
    [author] => roger
      text : "About MongoDB...",
    [date] => MongoDate Object(
      tags : [ "tech", "databases" ] }
            [sec] => 1318557302
            [usec] => 581000
        )
    [text] => about mongoDB...
    [tags] => Array(
 Note: _id is unique, but can be anything
            [0] => tech
            [1] => databases
you’d like
        )
)
Querying
print_r($posts->findOne());
> db.posts.findOne()
Array(
    [_id] => MongoId Object(
>   { _id : ObjectId("4c4ba5c0672c685e5e8aabf3"),
            [$id] => 4e9796764a18173a17000000
    author : "roger",
        )
      date : "Sat Jul 24 2010 19:47:11",
    [author] => roger
      text : "About MongoDB...",
    [date] => MongoDate Object(
      tags : [ "tech", "databases" ] }
            [sec] => 1318557302
            [usec] => 581000
        )
    [text] => about mongoDB...
    [tags] => Array(
 Note: _id is unique, but can be anything
            [0] => tech
            [1] => databases
you’d like
        )
)
Inserting Objects
class PostObj {
    public $comments = array();
    public function __construct($author, $title, $content)
{
        $this->author = $author;
        $this->title = $title;
        $this->content = $content;
    }
}

$posts->insert(new PostObj("Steve",
                           "My first blog post",
                           "Hello, World!"));
MongoId
An autogenerated primary key

$x = array("foo" => 1, "bar" => 2);
$db->baz->save($x);
var_dump($x['_id']);

Result:

object(MongoId)#4 (1) {
  ["$id"]=> string(24) "4e9cc76a4a1817fd21000000"
}
MongoId
An autogenerated primary key


object(MongoId)#4 (1) {
  ["$id"]=> string(24) "4e9cc76a4a1817fd21000000"
}

                4e9cc76a4a1817fd21000000
                |------||----||--||----|
                   ts     mac pid inc
Update Operations
 $set, $unset, $inc, $push, $pushAll,
 $pull, $pullAll, $bit

$change = array('$push' =>
            array('comments' =>
                array(
                    'author' => 'Fred',
                    'created' => new MongoDate(),
                    'comment' => 'Best post ever!.'
                )
            )
        );

$posts->update(array("_id" => $id), $change);
Nested Documents
Array(
    {   _id : ObjectId("4c4ba5c0672c685e5e8aabf3"),
    [_id] => MongoId Object (
            [$id] => 4e9796764a18173a17000000
    )   author : "roger",
    [author] => roger
        date : "Sat Apr 24 2011 19:47:11",
    [comments] => Array(

        text : "About MongoDB...",
        [0] => Array(
             [author] => Fred
        tags : [ "tech", "databases" ],
             [created] => MongoDate Object(
                     [sec] => 1318899392
        comments : [ [usec] => 176000
                 )
	              {
             [comment] => Dumb post.
         )
	   )          	 author : "Fred",
               	
    [date] => MongoDate Object(
	              	 date : "Sat Apr 25 2010 20:51:03 GMT-0700",
               	
        [sec] => 1318557302
        [usec] => 581000
	   )          	 text : "Best Post Ever!"
               	
    [tags] => Array(
	              	
               }
        [0] => tech

    )
         ]
        [1] => databases


}
)
    [text] => about mongoDB...
Nested Documents
Array(
    {   _id : ObjectId("4c4ba5c0672c685e5e8aabf3"),
    [_id] => MongoId Object (
            [$id] => 4e9796764a18173a17000000
    )   author : "roger",
    [author] => roger
        date : "Sat Apr 24 2011 19:47:11",
    [comments] => Array(

        text : "About MongoDB...",
        [0] => Array(
             [author] => Fred
        tags : [ "tech", "databases" ],
             [created] => MongoDate Object(
                     [sec] => 1318899392
        comments : [ [usec] => 176000
                 )
	              {
             [comment] => Dumb post.
         )
	   )          	 author : "Fred",
               	
    [date] => MongoDate Object(
	              	 date : "Sat Apr 25 2010 20:51:03 GMT-0700",
               	
        [sec] => 1318557302
        [usec] => 581000
	   )          	 text : "Best Post Ever!"
               	
    [tags] => Array(
	              	
               }
        [0] => tech

    )
         ]
        [1] => databases


}
)
    [text] => about mongoDB...
Querying

$posts = $blog->find(array(
     "author" => "Roger"));

$commentsByFred = $blog->find(array(
     "comments.author" => "Fred"));

$commentsByFred = $blog->find(array(
     "comments.author" =>
     new MongoRegex("/fred/i")));
It’s all about the $
 $ instead of >, <, =, etc.

 $gt, $gte, $lt, $lte, $eq, $neq, $exists,
 $set, $mod, $where, $in, $nin, $inc
 $push, $pull, $pop, $pushAll, $popAll

$c->find(array("x" => array('$gt' => 4)));

$c->find(array("x" => array(“$gt” => 4)));
It’s all about the $
 $ instead of >, <, =, etc.

 $gt, $gte, $lt, $lte, $eq, $neq, $exists,
 $set, $mod, $where, $in, $nin, $inc
 $push, $pull, $pop, $pushAll, $popAll

$c->find(array("x" => array('$gt' => 4)));

$c->find(array("x" => array(“$gt” => 4)));
Adjust the behavior
           in php.ini or using ini_set()


php.ini
---------------
mongo.cmd = ":"

$c->find(array("x" => array(':gt' => 4)));

     or

ini_set("mongo.cmd", ".");
$c->find(array("x" => array('.gt' => 4)));
Indexing
 including secondary and compound
 indexes

$people->ensureIndex(array("age" => 1));

$people->ensureIndex(array(
    "name" => -1,
    "ts" => -1,
    "comments.author" => 1
));
More Indexing
// Index nested documents
$posts->ensureIndex( array("comments.author" => 1) )
$posts->find( array("comments.author" => "Fred") )

// Index on tags (multi-key index)
$posts->ensureIndex( array("tags" => 1 ) )
$posts->find( array("tags" => "tech") )

// geospatial index
$posts->ensureIndex( array("author.location" => "2d") )
$posts->find( array("author.location" =>
                array( '$near' => array(22,42)));
Cursors

$cursor = $c->find(array("foo" => "bar"))

foreach ($cursor as $id => $value) {
    echo "$id: ";
    var_dump( $value );
}

$a = iterator_to_array($cursor);
Paging

$page_num = 3;
$results_per_page = 10;

$cursor = $results->find()
    ->sort(array("ts" => -1))
    ->skip($page_num * $results_per_page)
    ->limit($results_per_page);
Rich Documents
{   _id : ObjectId("4c4ba5c0672c685e5e8aabf3"),

    line_items : [ { sku: ‘tt-123’,
                     name: ‘Coltrane: Impressions’ },
                   { sku: ‘tt-457’,
                     name: ‘Davis: Kind of Blue’ } ],

    address : { name: ‘Banker’,
                street: ‘111 Main’,
                zip: 10010 },

    payment: { cc: 4567,
               exp: Date(2011, 7, 7) },

    subtotal: 2355
}
Grid FS
Storing Files




Under 16mb
Storing Big Files




>16mb stored in 16mb chunks
Storing Big Files




Works with replicated
and sharded systems
A better network FS
• GridFS files are seamlessly sharded & replicated.
• No OS constraints...
 • No file size limits
 • No naming constraints
 • No folder limits
 • Standard across different OSs
• MongoDB automatically generate the MD5 hash
  of the file
Storing Files
$grid = $db->getGridFS();

// The file's location in the File System
$path = "/tmp/";
$filename = "movie.mp4";

// Note metadata field & filename field
$storedfile = $grid->storeFile($path . $filename,
array("metadata" => array("filename" => $filename),
"filename" => $filename));

// Return newly stored file's Document ID
echo $storedfile;
Storing Data

$grid = $db->getGridFS();
$filename = "zelda.jpg";
$storedfile = $grid->storeBytes("ÿØÿÉ
€ ^@^PJFIF^@^A^A^A,^G^E^E^G,...",
                 array("metadata" => array("filename" =>
$filename),
                 "filename" => $filename));
Streaming Data
$gridFS = $db->getGridFS();

// Find image to stream
$image = $gridFS->findOne("zelda.jpg");

// Stream image to browser
header('Content-type: image/jpeg');
echo $image->getBytes();
PHP Libraries for
   MongoDB
Libraries & Frameworks
• Doctrine MongoDB ODM   • Zend Framework
• Active Mongo           • Lithium
• Mongo Queue            • Symfony2
• Morph                  • Fuel
• Mandango               • Fat Free Framework
Doctrine MongoDB ODM
• Provides full validation
• Seamless integration with Doctrine ORM
   • Useful for hybrid solutions
• Follows same persistence model as Doctrine
• Uses a Document Manager & annotations
• Supports embedded and referenced objects
• Can use mongo’s query interface
• Supports in place updates
     https://github.com/doctrine/mongodb-odm
Mandango
•Very light and fast
•Event support
•Supports embedded and referenced
  objects
•uses the mongo query syntax
•Lacking validation, but events can be
  utilized to validate
    https://github.com/mandango/mandango
Active Mongo
•Uses ActiveRecord (active document)
  interface
•Supports full validation
•Supports in place updating
•Uses native query interface
•Supports referenced documents
      https://github.com/crodas/ActiveMongo
Morph

•Follows the Active Record model
•Has own query object (Morph_Query)
•Doesn’t provide validation
•Doesn’t support embedded or referenced
  objects.

   https://github.com/a-musing-moose/morph
Mongo Queue
  An extensible job/message queueing system that
  uses mongodb as the persistent storage engine.


• Fully Configurable
• Distributed
• Atomic Locking
• Priority Support
• Worker Timeout Support
• Stable
         https://github.com/skiz/mongo_queue
http://spf13.com
                                http://github.com/spf13
                                @spf13




           Questions?
        download at mongodb.org
PS: We’re hiring!! Contact us at jobs@10gen.com
MongoDB and PHP ZendCon 2011

Más contenido relacionado

La actualidad más candente

MongoDB Schema Design: Four Real-World Examples
MongoDB Schema Design: Four Real-World ExamplesMongoDB Schema Design: Four Real-World Examples
MongoDB Schema Design: Four Real-World ExamplesMike Friedman
 
MongoDB and Ruby on Rails
MongoDB and Ruby on RailsMongoDB and Ruby on Rails
MongoDB and Ruby on Railsrfischer20
 
Introduction to Restkit
Introduction to RestkitIntroduction to Restkit
Introduction to Restkitpetertmarks
 
Couchbase Korea User Group 2nd Meetup #2
Couchbase Korea User Group 2nd Meetup #2Couchbase Korea User Group 2nd Meetup #2
Couchbase Korea User Group 2nd Meetup #2won min jang
 
Ext GWT 3.0 Data Widgets
Ext GWT 3.0 Data WidgetsExt GWT 3.0 Data Widgets
Ext GWT 3.0 Data WidgetsSencha
 
Improving RDF Search Performance with Lucene and SIREN
Improving RDF Search Performance with Lucene and SIRENImproving RDF Search Performance with Lucene and SIREN
Improving RDF Search Performance with Lucene and SIRENMike Hugo
 
Paintfree Object-Document Mapping for MongoDB by Philipp Krenn
Paintfree Object-Document Mapping for MongoDB by Philipp KrennPaintfree Object-Document Mapping for MongoDB by Philipp Krenn
Paintfree Object-Document Mapping for MongoDB by Philipp KrennJavaDayUA
 
Dev Jumpstart: Schema Design Best Practices
Dev Jumpstart: Schema Design Best PracticesDev Jumpstart: Schema Design Best Practices
Dev Jumpstart: Schema Design Best PracticesMongoDB
 
Advanced Document Modeling Techniques from a High-Scale Commerce Platform
Advanced Document Modeling Techniques from a High-Scale Commerce PlatformAdvanced Document Modeling Techniques from a High-Scale Commerce Platform
Advanced Document Modeling Techniques from a High-Scale Commerce PlatformMongoDB
 
Schema Design (Mongo Austin)
Schema Design (Mongo Austin)Schema Design (Mongo Austin)
Schema Design (Mongo Austin)MongoDB
 
J query introduction
J query introductionJ query introduction
J query introductionSMS_VietNam
 
Building DSLs with Groovy
Building DSLs with GroovyBuilding DSLs with Groovy
Building DSLs with GroovySten Anderson
 
How to win friends and influence people (with Hadoop)
How to win friends and influence people (with Hadoop)How to win friends and influence people (with Hadoop)
How to win friends and influence people (with Hadoop)Joseph Adler
 
Cordova training : Day 4 - Advanced Javascript
Cordova training : Day 4 - Advanced JavascriptCordova training : Day 4 - Advanced Javascript
Cordova training : Day 4 - Advanced JavascriptBinu Paul
 
MongoDB + Java - Everything you need to know
MongoDB + Java - Everything you need to know MongoDB + Java - Everything you need to know
MongoDB + Java - Everything you need to know Norberto Leite
 
jQuery Rescue Adventure
jQuery Rescue AdventurejQuery Rescue Adventure
jQuery Rescue AdventureAllegient
 

La actualidad más candente (19)

MongoDB Schema Design: Four Real-World Examples
MongoDB Schema Design: Four Real-World ExamplesMongoDB Schema Design: Four Real-World Examples
MongoDB Schema Design: Four Real-World Examples
 
MongoDB and Ruby on Rails
MongoDB and Ruby on RailsMongoDB and Ruby on Rails
MongoDB and Ruby on Rails
 
Introduction to Restkit
Introduction to RestkitIntroduction to Restkit
Introduction to Restkit
 
Couchbase Korea User Group 2nd Meetup #2
Couchbase Korea User Group 2nd Meetup #2Couchbase Korea User Group 2nd Meetup #2
Couchbase Korea User Group 2nd Meetup #2
 
Ext GWT 3.0 Data Widgets
Ext GWT 3.0 Data WidgetsExt GWT 3.0 Data Widgets
Ext GWT 3.0 Data Widgets
 
Data formats
Data formatsData formats
Data formats
 
Improving RDF Search Performance with Lucene and SIREN
Improving RDF Search Performance with Lucene and SIRENImproving RDF Search Performance with Lucene and SIREN
Improving RDF Search Performance with Lucene and SIREN
 
Paintfree Object-Document Mapping for MongoDB by Philipp Krenn
Paintfree Object-Document Mapping for MongoDB by Philipp KrennPaintfree Object-Document Mapping for MongoDB by Philipp Krenn
Paintfree Object-Document Mapping for MongoDB by Philipp Krenn
 
Dev Jumpstart: Schema Design Best Practices
Dev Jumpstart: Schema Design Best PracticesDev Jumpstart: Schema Design Best Practices
Dev Jumpstart: Schema Design Best Practices
 
Advanced Document Modeling Techniques from a High-Scale Commerce Platform
Advanced Document Modeling Techniques from a High-Scale Commerce PlatformAdvanced Document Modeling Techniques from a High-Scale Commerce Platform
Advanced Document Modeling Techniques from a High-Scale Commerce Platform
 
Schema Design (Mongo Austin)
Schema Design (Mongo Austin)Schema Design (Mongo Austin)
Schema Design (Mongo Austin)
 
J query introduction
J query introductionJ query introduction
J query introduction
 
Building DSLs with Groovy
Building DSLs with GroovyBuilding DSLs with Groovy
Building DSLs with Groovy
 
How to win friends and influence people (with Hadoop)
How to win friends and influence people (with Hadoop)How to win friends and influence people (with Hadoop)
How to win friends and influence people (with Hadoop)
 
Learn css3
Learn css3Learn css3
Learn css3
 
Json tutorial, a beguiner guide
Json tutorial, a beguiner guideJson tutorial, a beguiner guide
Json tutorial, a beguiner guide
 
Cordova training : Day 4 - Advanced Javascript
Cordova training : Day 4 - Advanced JavascriptCordova training : Day 4 - Advanced Javascript
Cordova training : Day 4 - Advanced Javascript
 
MongoDB + Java - Everything you need to know
MongoDB + Java - Everything you need to know MongoDB + Java - Everything you need to know
MongoDB + Java - Everything you need to know
 
jQuery Rescue Adventure
jQuery Rescue AdventurejQuery Rescue Adventure
jQuery Rescue Adventure
 

Destacado

Simulation d'un réseau BSS dans la commune d'arrondissement de Douala 5e
Simulation d'un réseau BSS dans la commune d'arrondissement de Douala 5eSimulation d'un réseau BSS dans la commune d'arrondissement de Douala 5e
Simulation d'un réseau BSS dans la commune d'arrondissement de Douala 5eJeff Hermann Ela Aba
 
Programmation orientée objet en PHP 5
Programmation orientée objet en PHP 5Programmation orientée objet en PHP 5
Programmation orientée objet en PHP 5Kristen Le Liboux
 
Un exemple élémentaire d'application MVC en PHP
Un exemple élémentaire d'application MVC en PHPUn exemple élémentaire d'application MVC en PHP
Un exemple élémentaire d'application MVC en PHPKristen Le Liboux
 
Mise en place d’un serveur radius
Mise en place d’un serveur radiusMise en place d’un serveur radius
Mise en place d’un serveur radiusJeff Hermann Ela Aba
 
Symfony2 Presentation
Symfony2 PresentationSymfony2 Presentation
Symfony2 Presentationyllieth
 
Formation PHP avancé - Cake PHP
Formation PHP avancé - Cake PHPFormation PHP avancé - Cake PHP
Formation PHP avancé - Cake PHPkemenaran
 
Free radius
Free radiusFree radius
Free radiusSafae Ad
 
Mini projet individuel php
Mini projet individuel phpMini projet individuel php
Mini projet individuel phpKhadim Mbacké
 

Destacado (13)

Simulation d'un réseau BSS dans la commune d'arrondissement de Douala 5e
Simulation d'un réseau BSS dans la commune d'arrondissement de Douala 5eSimulation d'un réseau BSS dans la commune d'arrondissement de Douala 5e
Simulation d'un réseau BSS dans la commune d'arrondissement de Douala 5e
 
radius
radiusradius
radius
 
Programmation orientée objet en PHP 5
Programmation orientée objet en PHP 5Programmation orientée objet en PHP 5
Programmation orientée objet en PHP 5
 
83839589 radius
83839589 radius83839589 radius
83839589 radius
 
PHP MVC
PHP MVCPHP MVC
PHP MVC
 
Wi fi-radius
Wi fi-radiusWi fi-radius
Wi fi-radius
 
Un exemple élémentaire d'application MVC en PHP
Un exemple élémentaire d'application MVC en PHPUn exemple élémentaire d'application MVC en PHP
Un exemple élémentaire d'application MVC en PHP
 
Mise en place d’un serveur radius
Mise en place d’un serveur radiusMise en place d’un serveur radius
Mise en place d’un serveur radius
 
Symfony2 Presentation
Symfony2 PresentationSymfony2 Presentation
Symfony2 Presentation
 
Formation PHP avancé - Cake PHP
Formation PHP avancé - Cake PHPFormation PHP avancé - Cake PHP
Formation PHP avancé - Cake PHP
 
Free radius
Free radiusFree radius
Free radius
 
Mini projet individuel php
Mini projet individuel phpMini projet individuel php
Mini projet individuel php
 
Rapport sécurité
Rapport sécuritéRapport sécurité
Rapport sécurité
 

Similar a MongoDB and PHP ZendCon 2011

Managing Social Content with MongoDB
Managing Social Content with MongoDBManaging Social Content with MongoDB
Managing Social Content with MongoDBMongoDB
 
Building your first app with MongoDB
Building your first app with MongoDBBuilding your first app with MongoDB
Building your first app with MongoDBNorberto Leite
 
Building Apps with MongoDB
Building Apps with MongoDBBuilding Apps with MongoDB
Building Apps with MongoDBNate Abele
 
Schema Design by Example ~ MongoSF 2012
Schema Design by Example ~ MongoSF 2012Schema Design by Example ~ MongoSF 2012
Schema Design by Example ~ MongoSF 2012hungarianhc
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDBAlex Bilbie
 
Data access 2.0? Please welcome: Spring Data!
Data access 2.0? Please welcome: Spring Data!Data access 2.0? Please welcome: Spring Data!
Data access 2.0? Please welcome: Spring Data!Oliver Gierke
 
Building your first app with mongo db
Building your first app with mongo dbBuilding your first app with mongo db
Building your first app with mongo dbMongoDB
 
Introduction to NOSQL And MongoDB
Introduction to NOSQL And MongoDBIntroduction to NOSQL And MongoDB
Introduction to NOSQL And MongoDBBehrouz Bakhtiari
 
Building a Location-based platform with MongoDB from Zero.
Building a Location-based platform with MongoDB from Zero.Building a Location-based platform with MongoDB from Zero.
Building a Location-based platform with MongoDB from Zero.Ravi Teja
 
Pyconie 2012
Pyconie 2012Pyconie 2012
Pyconie 2012Yaqi Zhao
 
What do you mean, Backwards Compatibility?
What do you mean, Backwards Compatibility?What do you mean, Backwards Compatibility?
What do you mean, Backwards Compatibility?Trisha Gee
 
MongoDB at FrozenRails
MongoDB at FrozenRailsMongoDB at FrozenRails
MongoDB at FrozenRailsMike Dirolf
 
MongoDB Introduction talk at Dr Dobbs Conference, MongoDB Evenings at Bangalo...
MongoDB Introduction talk at Dr Dobbs Conference, MongoDB Evenings at Bangalo...MongoDB Introduction talk at Dr Dobbs Conference, MongoDB Evenings at Bangalo...
MongoDB Introduction talk at Dr Dobbs Conference, MongoDB Evenings at Bangalo...Prasoon Kumar
 
Fast REST APIs Development with MongoDB
Fast REST APIs Development with MongoDBFast REST APIs Development with MongoDB
Fast REST APIs Development with MongoDBMongoDB
 
Python With MongoDB in advanced Python.pptx
Python With MongoDB in advanced Python.pptxPython With MongoDB in advanced Python.pptx
Python With MongoDB in advanced Python.pptxRamakrishna Reddy Bijjam
 
MongoDB for Coder Training (Coding Serbia 2013)
MongoDB for Coder Training (Coding Serbia 2013)MongoDB for Coder Training (Coding Serbia 2013)
MongoDB for Coder Training (Coding Serbia 2013)Uwe Printz
 
Marc s01 e02-crud-database
Marc s01 e02-crud-databaseMarc s01 e02-crud-database
Marc s01 e02-crud-databaseMongoDB
 
Webinarserie: Einführung in MongoDB: “Back to Basics” - Teil 3 - Interaktion ...
Webinarserie: Einführung in MongoDB: “Back to Basics” - Teil 3 - Interaktion ...Webinarserie: Einführung in MongoDB: “Back to Basics” - Teil 3 - Interaktion ...
Webinarserie: Einführung in MongoDB: “Back to Basics” - Teil 3 - Interaktion ...MongoDB
 

Similar a MongoDB and PHP ZendCon 2011 (20)

Managing Social Content with MongoDB
Managing Social Content with MongoDBManaging Social Content with MongoDB
Managing Social Content with MongoDB
 
Building your first app with MongoDB
Building your first app with MongoDBBuilding your first app with MongoDB
Building your first app with MongoDB
 
Building Apps with MongoDB
Building Apps with MongoDBBuilding Apps with MongoDB
Building Apps with MongoDB
 
Schema Design by Example ~ MongoSF 2012
Schema Design by Example ~ MongoSF 2012Schema Design by Example ~ MongoSF 2012
Schema Design by Example ~ MongoSF 2012
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
 
Data access 2.0? Please welcome: Spring Data!
Data access 2.0? Please welcome: Spring Data!Data access 2.0? Please welcome: Spring Data!
Data access 2.0? Please welcome: Spring Data!
 
Building your first app with mongo db
Building your first app with mongo dbBuilding your first app with mongo db
Building your first app with mongo db
 
Introduction to NOSQL And MongoDB
Introduction to NOSQL And MongoDBIntroduction to NOSQL And MongoDB
Introduction to NOSQL And MongoDB
 
ActiveRecord vs Mongoid
ActiveRecord vs MongoidActiveRecord vs Mongoid
ActiveRecord vs Mongoid
 
Building a Location-based platform with MongoDB from Zero.
Building a Location-based platform with MongoDB from Zero.Building a Location-based platform with MongoDB from Zero.
Building a Location-based platform with MongoDB from Zero.
 
Pyconie 2012
Pyconie 2012Pyconie 2012
Pyconie 2012
 
What do you mean, Backwards Compatibility?
What do you mean, Backwards Compatibility?What do you mean, Backwards Compatibility?
What do you mean, Backwards Compatibility?
 
MongoDB at FrozenRails
MongoDB at FrozenRailsMongoDB at FrozenRails
MongoDB at FrozenRails
 
MongoDB Introduction talk at Dr Dobbs Conference, MongoDB Evenings at Bangalo...
MongoDB Introduction talk at Dr Dobbs Conference, MongoDB Evenings at Bangalo...MongoDB Introduction talk at Dr Dobbs Conference, MongoDB Evenings at Bangalo...
MongoDB Introduction talk at Dr Dobbs Conference, MongoDB Evenings at Bangalo...
 
Fast REST APIs Development with MongoDB
Fast REST APIs Development with MongoDBFast REST APIs Development with MongoDB
Fast REST APIs Development with MongoDB
 
Python With MongoDB in advanced Python.pptx
Python With MongoDB in advanced Python.pptxPython With MongoDB in advanced Python.pptx
Python With MongoDB in advanced Python.pptx
 
Python With MongoDB.pptx
Python With MongoDB.pptxPython With MongoDB.pptx
Python With MongoDB.pptx
 
MongoDB for Coder Training (Coding Serbia 2013)
MongoDB for Coder Training (Coding Serbia 2013)MongoDB for Coder Training (Coding Serbia 2013)
MongoDB for Coder Training (Coding Serbia 2013)
 
Marc s01 e02-crud-database
Marc s01 e02-crud-databaseMarc s01 e02-crud-database
Marc s01 e02-crud-database
 
Webinarserie: Einführung in MongoDB: “Back to Basics” - Teil 3 - Interaktion ...
Webinarserie: Einführung in MongoDB: “Back to Basics” - Teil 3 - Interaktion ...Webinarserie: Einführung in MongoDB: “Back to Basics” - Teil 3 - Interaktion ...
Webinarserie: Einführung in MongoDB: “Back to Basics” - Teil 3 - Interaktion ...
 

Más de Steven Francia

State of the Gopher Nation - Golang - August 2017
State of the Gopher Nation - Golang - August 2017State of the Gopher Nation - Golang - August 2017
State of the Gopher Nation - Golang - August 2017Steven Francia
 
Building Awesome CLI apps in Go
Building Awesome CLI apps in GoBuilding Awesome CLI apps in Go
Building Awesome CLI apps in GoSteven Francia
 
The Future of the Operating System - Keynote LinuxCon 2015
The Future of the Operating System -  Keynote LinuxCon 2015The Future of the Operating System -  Keynote LinuxCon 2015
The Future of the Operating System - Keynote LinuxCon 2015Steven Francia
 
7 Common Mistakes in Go (2015)
7 Common Mistakes in Go (2015)7 Common Mistakes in Go (2015)
7 Common Mistakes in Go (2015)Steven Francia
 
What every successful open source project needs
What every successful open source project needsWhat every successful open source project needs
What every successful open source project needsSteven Francia
 
7 Common mistakes in Go and when to avoid them
7 Common mistakes in Go and when to avoid them7 Common mistakes in Go and when to avoid them
7 Common mistakes in Go and when to avoid themSteven Francia
 
Go for Object Oriented Programmers or Object Oriented Programming without Obj...
Go for Object Oriented Programmers or Object Oriented Programming without Obj...Go for Object Oriented Programmers or Object Oriented Programming without Obj...
Go for Object Oriented Programmers or Object Oriented Programming without Obj...Steven Francia
 
Painless Data Storage with MongoDB & Go
Painless Data Storage with MongoDB & Go Painless Data Storage with MongoDB & Go
Painless Data Storage with MongoDB & Go Steven Francia
 
Getting Started with Go
Getting Started with GoGetting Started with Go
Getting Started with GoSteven Francia
 
Build your first MongoDB App in Ruby @ StrangeLoop 2013
Build your first MongoDB App in Ruby @ StrangeLoop 2013Build your first MongoDB App in Ruby @ StrangeLoop 2013
Build your first MongoDB App in Ruby @ StrangeLoop 2013Steven Francia
 
Modern Database Systems (for Genealogy)
Modern Database Systems (for Genealogy)Modern Database Systems (for Genealogy)
Modern Database Systems (for Genealogy)Steven Francia
 
Introduction to MongoDB and Hadoop
Introduction to MongoDB and HadoopIntroduction to MongoDB and Hadoop
Introduction to MongoDB and HadoopSteven Francia
 
MongoDB, Hadoop and humongous data - MongoSV 2012
MongoDB, Hadoop and humongous data - MongoSV 2012MongoDB, Hadoop and humongous data - MongoSV 2012
MongoDB, Hadoop and humongous data - MongoSV 2012Steven Francia
 
Big data for the rest of us
Big data for the rest of usBig data for the rest of us
Big data for the rest of usSteven Francia
 
OSCON 2012 MongoDB Tutorial
OSCON 2012 MongoDB TutorialOSCON 2012 MongoDB Tutorial
OSCON 2012 MongoDB TutorialSteven Francia
 
Replication, Durability, and Disaster Recovery
Replication, Durability, and Disaster RecoveryReplication, Durability, and Disaster Recovery
Replication, Durability, and Disaster RecoverySteven Francia
 
Multi Data Center Strategies
Multi Data Center StrategiesMulti Data Center Strategies
Multi Data Center StrategiesSteven Francia
 
NoSQL databases and managing big data
NoSQL databases and managing big dataNoSQL databases and managing big data
NoSQL databases and managing big dataSteven Francia
 
MongoDB, Hadoop and Humongous Data
MongoDB, Hadoop and Humongous DataMongoDB, Hadoop and Humongous Data
MongoDB, Hadoop and Humongous DataSteven Francia
 

Más de Steven Francia (20)

State of the Gopher Nation - Golang - August 2017
State of the Gopher Nation - Golang - August 2017State of the Gopher Nation - Golang - August 2017
State of the Gopher Nation - Golang - August 2017
 
Building Awesome CLI apps in Go
Building Awesome CLI apps in GoBuilding Awesome CLI apps in Go
Building Awesome CLI apps in Go
 
The Future of the Operating System - Keynote LinuxCon 2015
The Future of the Operating System -  Keynote LinuxCon 2015The Future of the Operating System -  Keynote LinuxCon 2015
The Future of the Operating System - Keynote LinuxCon 2015
 
7 Common Mistakes in Go (2015)
7 Common Mistakes in Go (2015)7 Common Mistakes in Go (2015)
7 Common Mistakes in Go (2015)
 
What every successful open source project needs
What every successful open source project needsWhat every successful open source project needs
What every successful open source project needs
 
7 Common mistakes in Go and when to avoid them
7 Common mistakes in Go and when to avoid them7 Common mistakes in Go and when to avoid them
7 Common mistakes in Go and when to avoid them
 
Go for Object Oriented Programmers or Object Oriented Programming without Obj...
Go for Object Oriented Programmers or Object Oriented Programming without Obj...Go for Object Oriented Programmers or Object Oriented Programming without Obj...
Go for Object Oriented Programmers or Object Oriented Programming without Obj...
 
Painless Data Storage with MongoDB & Go
Painless Data Storage with MongoDB & Go Painless Data Storage with MongoDB & Go
Painless Data Storage with MongoDB & Go
 
Getting Started with Go
Getting Started with GoGetting Started with Go
Getting Started with Go
 
Build your first MongoDB App in Ruby @ StrangeLoop 2013
Build your first MongoDB App in Ruby @ StrangeLoop 2013Build your first MongoDB App in Ruby @ StrangeLoop 2013
Build your first MongoDB App in Ruby @ StrangeLoop 2013
 
Modern Database Systems (for Genealogy)
Modern Database Systems (for Genealogy)Modern Database Systems (for Genealogy)
Modern Database Systems (for Genealogy)
 
Introduction to MongoDB and Hadoop
Introduction to MongoDB and HadoopIntroduction to MongoDB and Hadoop
Introduction to MongoDB and Hadoop
 
Future of data
Future of dataFuture of data
Future of data
 
MongoDB, Hadoop and humongous data - MongoSV 2012
MongoDB, Hadoop and humongous data - MongoSV 2012MongoDB, Hadoop and humongous data - MongoSV 2012
MongoDB, Hadoop and humongous data - MongoSV 2012
 
Big data for the rest of us
Big data for the rest of usBig data for the rest of us
Big data for the rest of us
 
OSCON 2012 MongoDB Tutorial
OSCON 2012 MongoDB TutorialOSCON 2012 MongoDB Tutorial
OSCON 2012 MongoDB Tutorial
 
Replication, Durability, and Disaster Recovery
Replication, Durability, and Disaster RecoveryReplication, Durability, and Disaster Recovery
Replication, Durability, and Disaster Recovery
 
Multi Data Center Strategies
Multi Data Center StrategiesMulti Data Center Strategies
Multi Data Center Strategies
 
NoSQL databases and managing big data
NoSQL databases and managing big dataNoSQL databases and managing big data
NoSQL databases and managing big data
 
MongoDB, Hadoop and Humongous Data
MongoDB, Hadoop and Humongous DataMongoDB, Hadoop and Humongous Data
MongoDB, Hadoop and Humongous Data
 

Último

Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdfChristopherTHyatt
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfhans926745
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 

Último (20)

Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 

MongoDB and PHP ZendCon 2011

  • 2. My name is Steve Francia @spf13
  • 3. • 15+ years building the internet • Father, husband, skateboarder • Chief Solutions Architect @ 10gen • Author of upcoming O’Reilly publication “PHP and MongoDB”
  • 4. Introduction to MongoDB
  • 6. MongoDB Goals • OpenSource • Designed for today • Today’s hardware / environments • Today’s challenges • Easy development • Reliable • Scalable
  • 7. • Company behind MongoDB • AGPL license, own copyrights, engineering team • support, consulting, commercial license revenue • Management • Google/DoubleClick, Oracle, Apple, NetApp • Funding: Sequoia, Union Square, Flybridge • Offices in NYC, Redwood Shores & London • 60+ employees
  • 8. A bit of history
  • 10.
  • 11.
  • 12. 1979
  • 13. 1979 1982-1996
  • 14. 1979 1982-1996 1995
  • 15. Computers in 1995 •Pentium 100 mhz •10base T •16 MB ram •200 MB HD
  • 16. Cell Phones in 2011 •Dual core 1.5 Ghz •WiFi 802.11n (300+ Mbps) •1 GB ram •64GB Solid State
  • 17. How about a DB designed for today?
  • 18. It started with DoubleClick
  • 19. Signs something needed •doubleclick - 400,000 ads/second •caching is de rigueur •complex ORM frameworks •computer architecture increasing in complexity •cloud computing
  • 20. Requirements We need enough functionality to handle broad set of use cases •strong consistency / atomicity •secondary indexes •ad hoc queries
  • 21. Trim unneeded features Leave out a few things so we can scale •no choice but to leave out relational •distributed transactions are hard to scale
  • 22. Needed a scalable data model Considered.... •key/value •columnar / tabular •document oriented (JSON inspired)
  • 23. MongoDB philosphy • Keep functionality when we can (key/ value stores are great, but we need more) • Non-relational (no joins) makes scaling horizontally practical • Document data models are good • Database technology should run anywhere VMs, cloud or straight metal
  • 24. MongoDB is: Application Document Oriented { author: “steve”, High date: new Date(), text: “About MongoDB...”, Performance tags: [“tech”, “database”]} Fully Consistent Horizontally Scalable
  • 25. MongoDB •JSON Documents •Querying/Indexing/Updating similar to relational databases •Traditional Consistency •Auto-Sharding
  • 26. Under the hood •Written in C++ •Available on most platforms •Data serialized to BSON •Extensive use of memory-mapped files
  • 28. This has led some to say “ MongoDB has the best features of key/ values stores, document databases and relational databases in one. John Nunemaker
  • 30. CMS / Blog Needs: • Business needed modern data store for rapid development and scale Solution: • Use PHP & MongoDB Results: • Real time statistics • All data, images, etc stored together, easy access, easy deployment, easy high availability • No need for complex migrations • Enabled very rapid development and growth
  • 31. Photo Meta-Data Problem: • Business needed more flexibility than Oracle could deliver Solution: • Use MongoDB instead of Oracle Results: • Developed application in one sprint cycle • 500% cost reduction compared to Oracle • 900% performance improvement compared to Oracle
  • 32. Customer Analytics Problem: • Deal with massive data volume across all customer sites Solution: • Use MongoDB to replace Google Analytics / Omniture options Results: • Less than one week to build prototype and prove business case • Rapid deployment of new features
  • 33. Online Dictionary Problem: • MySQL could not scale to handle their 5B+ documents Solution: • Switched from MySQL to MongoDB Results: • Massive simplification of code base • Eliminated need for external caching system • 20x performance improvement over MySQL
  • 34. E-commerce Problem: • Multi-vertical E-commerce impossible to model (efficiently) in RDBMS Solution: • Switched from MySQL to MongoDB Results: • Massive simplification of code base • Rapidly build, halving time to market (and cost) • Eliminated need for external caching system • 50x+ improvement over MySQL
  • 35. Tons more Pretty much if you can use a RDMBS or Key/Value MongoDB is a great fit
  • 38. Relational made normalized data look like this
  • 39. Document databases make normalized data look like this
  • 40. Terminology RDBMS Mongo Table, View ➜ Collection Row ➜ JSON Document Index ➜ Index Join ➜ Embedded Document Partition ➜ Shard Partition Key ➜ Shard Key
  • 41. Documents to Objects Documents to Arrays Tables to Documents { PostObject Object( [title] => MongoDB title: ‘MongoDB’, [contributors] => Array( contributors: [ [0] => PersonObject Object( { name: ‘Eliot Horowitz’, [name] => Eliot Horowitz [email] => eh@10gen.com email: ‘eh@10gen.com’ }, ) { name: PersonObjectMerriman’, [1] => ‘Dwight Object( email: ‘dm@10gen.com’ } [name] => Dwight Merriman [email] => dm@10gen.com ], ) model: { ) relational: false, [model] => ModelObject Object( [relational] => awesome:=>true [awesome] 1 }) ) }
  • 42. Documents to Objects Documents to Arrays Tables to Documents { array( PostObject Object( title: ‘MongoDB’, "title" =>=> MongoDB [title] 'MongoDB', "contributors" =>=> Array( [contributors] array( contributors: [ array( => PersonObject Object( [0] { name: ‘Eliot Horowitz’, 'name' => 'Eliot Horowitz', [name] => Eliot Horowitz email: ‘eh@10gen.com’ }, 'email' => 'eh@10gen.com' [email] => eh@10gen.com ), ) { name: ‘Dwight Merriman’, array( => PersonObject Object( [1] email: ‘dm@10gen.com’ } 'name' => 'Dwight Merriman', [name] => Dwight Merriman 'email' => 'dm@10gen.com' [email] => dm@10gen.com ], ) ) model: { ),) relational: false, "model" =>=> ModelObject Object( [model] array( 'relational' => false, [relational] awesome: true 'awesome' => true [awesome] 1 } ) ) } )
  • 43. Documents to Objects Documents to Arrays Tables to Documents { array( PostObject Object( title: ‘MongoDB’, "title" =>=> MongoDB [title] 'MongoDB', "contributors" =>=> Array( [contributors] array( contributors: [ array( => PersonObject Object( [0] { name: ‘Eliot Horowitz’, 'name' => 'Eliot Horowitz', [name] => Eliot Horowitz email: ‘eh@10gen.com’ }, 'email' => 'eh@10gen.com' [email] => eh@10gen.com ), ) { name: ‘Dwight Merriman’, array( => PersonObject Object( [1] email: ‘dm@10gen.com’ } 'name' => 'Dwight Merriman', [name] => Dwight Merriman 'email' => 'dm@10gen.com' [email] => dm@10gen.com ], ) ) model: { ),) relational: false, "model" =>=> ModelObject Object( [model] array( 'relational' => false, [relational] awesome: true 'awesome' => true [awesome] 1 } ) ) } )
  • 45. This has led some to say “ The single best interface (API) of any php extension.   Matthew Weier O'Phinney
  • 46. PHP Driver Installing the driver $ pecl install mongo Add to php.ini extension = mongo.so
  • 47. Connecting to the DB $connection = new Mongo(); $db = $connection->selectDB('blog'); $posts = $db->post; If the DB or collection doesn’t exist, mongoDB will create it on connect.
  • 48. Documents Blog Post Document $p1 = array("author" => "roger", "date" => new MongoDate(), "text" => "about mongoDB...", "tags" => array('tech', 'databases') ); $posts->save($p1);
  • 49. Querying print_r($posts->findOne()); > db.posts.findOne() Array( [_id] => MongoId Object( > { _id : ObjectId("4c4ba5c0672c685e5e8aabf3"), [$id] => 4e9796764a18173a17000000 author : "roger", ) date : "Sat Jul 24 2010 19:47:11", [author] => roger text : "About MongoDB...", [date] => MongoDate Object( tags : [ "tech", "databases" ] } [sec] => 1318557302 [usec] => 581000 ) [text] => about mongoDB... [tags] => Array( Note: _id is unique, but can be anything [0] => tech [1] => databases you’d like ) )
  • 50. Querying print_r($posts->findOne()); > db.posts.findOne() Array( [_id] => MongoId Object( > { _id : ObjectId("4c4ba5c0672c685e5e8aabf3"), [$id] => 4e9796764a18173a17000000 author : "roger", ) date : "Sat Jul 24 2010 19:47:11", [author] => roger text : "About MongoDB...", [date] => MongoDate Object( tags : [ "tech", "databases" ] } [sec] => 1318557302 [usec] => 581000 ) [text] => about mongoDB... [tags] => Array( Note: _id is unique, but can be anything [0] => tech [1] => databases you’d like ) )
  • 51. Inserting Objects class PostObj { public $comments = array(); public function __construct($author, $title, $content) { $this->author = $author; $this->title = $title; $this->content = $content; } } $posts->insert(new PostObj("Steve", "My first blog post", "Hello, World!"));
  • 52. MongoId An autogenerated primary key $x = array("foo" => 1, "bar" => 2); $db->baz->save($x); var_dump($x['_id']); Result: object(MongoId)#4 (1) { ["$id"]=> string(24) "4e9cc76a4a1817fd21000000" }
  • 53. MongoId An autogenerated primary key object(MongoId)#4 (1) { ["$id"]=> string(24) "4e9cc76a4a1817fd21000000" } 4e9cc76a4a1817fd21000000 |------||----||--||----| ts mac pid inc
  • 54. Update Operations $set, $unset, $inc, $push, $pushAll, $pull, $pullAll, $bit $change = array('$push' => array('comments' => array( 'author' => 'Fred', 'created' => new MongoDate(), 'comment' => 'Best post ever!.' ) ) ); $posts->update(array("_id" => $id), $change);
  • 55. Nested Documents Array( { _id : ObjectId("4c4ba5c0672c685e5e8aabf3"), [_id] => MongoId Object ( [$id] => 4e9796764a18173a17000000 ) author : "roger", [author] => roger date : "Sat Apr 24 2011 19:47:11", [comments] => Array( text : "About MongoDB...", [0] => Array( [author] => Fred tags : [ "tech", "databases" ], [created] => MongoDate Object( [sec] => 1318899392 comments : [ [usec] => 176000 ) { [comment] => Dumb post. ) ) author : "Fred", [date] => MongoDate Object( date : "Sat Apr 25 2010 20:51:03 GMT-0700", [sec] => 1318557302 [usec] => 581000 ) text : "Best Post Ever!" [tags] => Array( } [0] => tech ) ] [1] => databases } ) [text] => about mongoDB...
  • 56. Nested Documents Array( { _id : ObjectId("4c4ba5c0672c685e5e8aabf3"), [_id] => MongoId Object ( [$id] => 4e9796764a18173a17000000 ) author : "roger", [author] => roger date : "Sat Apr 24 2011 19:47:11", [comments] => Array( text : "About MongoDB...", [0] => Array( [author] => Fred tags : [ "tech", "databases" ], [created] => MongoDate Object( [sec] => 1318899392 comments : [ [usec] => 176000 ) { [comment] => Dumb post. ) ) author : "Fred", [date] => MongoDate Object( date : "Sat Apr 25 2010 20:51:03 GMT-0700", [sec] => 1318557302 [usec] => 581000 ) text : "Best Post Ever!" [tags] => Array( } [0] => tech ) ] [1] => databases } ) [text] => about mongoDB...
  • 57. Querying $posts = $blog->find(array( "author" => "Roger")); $commentsByFred = $blog->find(array( "comments.author" => "Fred")); $commentsByFred = $blog->find(array( "comments.author" => new MongoRegex("/fred/i")));
  • 58. It’s all about the $ $ instead of >, <, =, etc. $gt, $gte, $lt, $lte, $eq, $neq, $exists, $set, $mod, $where, $in, $nin, $inc $push, $pull, $pop, $pushAll, $popAll $c->find(array("x" => array('$gt' => 4))); $c->find(array("x" => array(“$gt” => 4)));
  • 59. It’s all about the $ $ instead of >, <, =, etc. $gt, $gte, $lt, $lte, $eq, $neq, $exists, $set, $mod, $where, $in, $nin, $inc $push, $pull, $pop, $pushAll, $popAll $c->find(array("x" => array('$gt' => 4))); $c->find(array("x" => array(“$gt” => 4)));
  • 60. Adjust the behavior in php.ini or using ini_set() php.ini --------------- mongo.cmd = ":" $c->find(array("x" => array(':gt' => 4))); or ini_set("mongo.cmd", "."); $c->find(array("x" => array('.gt' => 4)));
  • 61. Indexing including secondary and compound indexes $people->ensureIndex(array("age" => 1)); $people->ensureIndex(array( "name" => -1, "ts" => -1, "comments.author" => 1 ));
  • 62. More Indexing // Index nested documents $posts->ensureIndex( array("comments.author" => 1) ) $posts->find( array("comments.author" => "Fred") ) // Index on tags (multi-key index) $posts->ensureIndex( array("tags" => 1 ) ) $posts->find( array("tags" => "tech") ) // geospatial index $posts->ensureIndex( array("author.location" => "2d") ) $posts->find( array("author.location" => array( '$near' => array(22,42)));
  • 63. Cursors $cursor = $c->find(array("foo" => "bar")) foreach ($cursor as $id => $value) { echo "$id: "; var_dump( $value ); } $a = iterator_to_array($cursor);
  • 64. Paging $page_num = 3; $results_per_page = 10; $cursor = $results->find() ->sort(array("ts" => -1)) ->skip($page_num * $results_per_page) ->limit($results_per_page);
  • 65. Rich Documents { _id : ObjectId("4c4ba5c0672c685e5e8aabf3"), line_items : [ { sku: ‘tt-123’, name: ‘Coltrane: Impressions’ }, { sku: ‘tt-457’, name: ‘Davis: Kind of Blue’ } ], address : { name: ‘Banker’, street: ‘111 Main’, zip: 10010 }, payment: { cc: 4567, exp: Date(2011, 7, 7) }, subtotal: 2355 }
  • 68. Storing Big Files >16mb stored in 16mb chunks
  • 69. Storing Big Files Works with replicated and sharded systems
  • 70. A better network FS • GridFS files are seamlessly sharded & replicated. • No OS constraints... • No file size limits • No naming constraints • No folder limits • Standard across different OSs • MongoDB automatically generate the MD5 hash of the file
  • 71. Storing Files $grid = $db->getGridFS(); // The file's location in the File System $path = "/tmp/"; $filename = "movie.mp4"; // Note metadata field & filename field $storedfile = $grid->storeFile($path . $filename, array("metadata" => array("filename" => $filename), "filename" => $filename)); // Return newly stored file's Document ID echo $storedfile;
  • 72. Storing Data $grid = $db->getGridFS(); $filename = "zelda.jpg"; $storedfile = $grid->storeBytes("√ø√ò√ø√⠀ ^@^PJFIF^@^A^A^A,^G^E^E^G,...", array("metadata" => array("filename" => $filename), "filename" => $filename));
  • 73. Streaming Data $gridFS = $db->getGridFS(); // Find image to stream $image = $gridFS->findOne("zelda.jpg"); // Stream image to browser header('Content-type: image/jpeg'); echo $image->getBytes();
  • 74. PHP Libraries for MongoDB
  • 75. Libraries & Frameworks • Doctrine MongoDB ODM • Zend Framework • Active Mongo • Lithium • Mongo Queue • Symfony2 • Morph • Fuel • Mandango • Fat Free Framework
  • 76. Doctrine MongoDB ODM • Provides full validation • Seamless integration with Doctrine ORM • Useful for hybrid solutions • Follows same persistence model as Doctrine • Uses a Document Manager & annotations • Supports embedded and referenced objects • Can use mongo’s query interface • Supports in place updates https://github.com/doctrine/mongodb-odm
  • 77. Mandango •Very light and fast •Event support •Supports embedded and referenced objects •uses the mongo query syntax •Lacking validation, but events can be utilized to validate https://github.com/mandango/mandango
  • 78. Active Mongo •Uses ActiveRecord (active document) interface •Supports full validation •Supports in place updating •Uses native query interface •Supports referenced documents https://github.com/crodas/ActiveMongo
  • 79. Morph •Follows the Active Record model •Has own query object (Morph_Query) •Doesn’t provide validation •Doesn’t support embedded or referenced objects. https://github.com/a-musing-moose/morph
  • 80. Mongo Queue An extensible job/message queueing system that uses mongodb as the persistent storage engine. • Fully Configurable • Distributed • Atomic Locking • Priority Support • Worker Timeout Support • Stable https://github.com/skiz/mongo_queue
  • 81. http://spf13.com http://github.com/spf13 @spf13 Questions? download at mongodb.org PS: We’re hiring!! Contact us at jobs@10gen.com

Notas del editor

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. Remember in 1995 there were around 10,000 websites. Mosiac, Lynx, Mozilla (pre netscape) and IE 2.0 were the only web browsers. \nApache (Dec &amp;#x2019;95), Java (&amp;#x2019;96), PHP (June &amp;#x2019;95), and .net didn&amp;#x2019;t exist yet. Linux just barely (1.0 in &amp;#x2019;94)\n
  12. Remember in 1995 there were around 10,000 websites. Mosiac, Lynx, Mozilla (pre netscape) and IE 2.0 were the only web browsers. \nApache (Dec &amp;#x2019;95), Java (&amp;#x2019;96), PHP (June &amp;#x2019;95), and .net didn&amp;#x2019;t exist yet. Linux just barely (1.0 in &amp;#x2019;94)\n
  13. Remember in 1995 there were around 10,000 websites. Mosiac, Lynx, Mozilla (pre netscape) and IE 2.0 were the only web browsers. \nApache (Dec &amp;#x2019;95), Java (&amp;#x2019;96), PHP (June &amp;#x2019;95), and .net didn&amp;#x2019;t exist yet. Linux just barely (1.0 in &amp;#x2019;94)\n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n
  21. \n
  22. By reducing transactional semantics the db provides, one can still solve an interesting set of problems where performance is very important, and horizontal scaling then becomes easier.\n\n
  23. \n
  24. \n
  25. \n
  26. \n
  27. \n
  28. \n
  29. \n
  30. \n
  31. \n
  32. \n
  33. \n
  34. \n
  35. \n
  36. \n
  37. \n
  38. \n
  39. \n
  40. \n
  41. \n
  42. \n
  43. \n
  44. \n
  45. \n
  46. \n
  47. \n
  48. \n
  49. \n
  50. \n
  51. \n
  52. \n
  53. \n
  54. \n
  55. \n
  56. \n
  57. \n
  58. \n
  59. \n
  60. \n
  61. \n
  62. \n
  63. \n
  64. \n
  65. \n
  66. \n
  67. \n
  68. \n
  69. \n
  70. \n
  71. \n
  72. \n
  73. \n
  74. \n
  75. \n
  76. \n
  77. \n
  78. \n
  79. \n
  80. \n
  81. \n
  82. \n
  83. \n