Building a MongoDB App with Perl
Upcoming SlideShare
Loading in...5
×
 

Building a MongoDB App with Perl

on

  • 3,333 views

This presentation covers the very basics of building a simple web application with MongoDB and the Mojolicious::Lite prototyping framework.

This presentation covers the very basics of building a simple web application with MongoDB and the Mojolicious::Lite prototyping framework.

Statistics

Views

Total Views
3,333
Views on SlideShare
3,257
Embed Views
76

Actions

Likes
0
Downloads
27
Comments
0

2 Embeds 76

http://dave.thehorners.com 75
http://www.google.com 1

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Building a MongoDB App with Perl Building a MongoDB App with Perl Presentation Transcript

  • Building Your App: Perl & MongoDB Mike Friedman (friedo) Perl Engineer & Evangelist, 10gen http://friedo.com Perl Oasis 2013Thursday, January 17, 13
  • 10gen, the MongoDB Company http://www.10gen.com http://www.mongodb.orgThursday, January 17, 13
  • What is MongoDB?Thursday, January 17, 13
  • What is MongoDB? ✤ Document Oriented DatabaseThursday, January 17, 13
  • What is MongoDB? ✤ Document Oriented Database ✤ Open SourceThursday, January 17, 13
  • What is MongoDB? ✤ Document Oriented Database ✤ Open Source ✤ High PerformanceThursday, January 17, 13
  • What is MongoDB? ✤ Document Oriented Database ✤ Open Source ✤ High Performance ✤ Horizontally ScalableThursday, January 17, 13
  • What is MongoDB? ✤ Document Oriented Database ✤ Open Source ✤ High Performance ✤ Horizontally Scalable ✤ Full FeaturedThursday, January 17, 13
  • What We Will Build: ✤ “Library” - A demo application ✤ Users ✤ Books ✤ Authors ✤ PublishersThursday, January 17, 13
  • What We Will Need:Thursday, January 17, 13
  • What We Will Need: ✤ MongoDB ✤ http://www.mongodb.org/downloadsThursday, January 17, 13
  • What We Will Need: ✤ MongoDB ✤ http://www.mongodb.org/downloads ✤ CPAN Modules: ✤ https://metacpan.org/module/Mojolicious::Lite ✤ https://metacpan.org/module/MongoDBThursday, January 17, 13
  • Inside the MongoDB CPAN DistributionThursday, January 17, 13
  • Inside the MongoDB CPAN Distribution ✤ MongoDB::MongoClientThursday, January 17, 13
  • Inside the MongoDB CPAN Distribution ✤ MongoDB::MongoClient ✤ new in version 0.502.Thursday, January 17, 13
  • Inside the MongoDB CPAN Distribution ✤ MongoDB::MongoClient ✤ new in version 0.502. ✤ “Safe” (write-acknowledged) by defaultThursday, January 17, 13
  • Inside the MongoDB CPAN Distribution ✤ MongoDB::MongoClient ✤ new in version 0.502. ✤ “Safe” (write-acknowledged) by default ✤ Encapsulates connection and server infoThursday, January 17, 13
  • Inside the MongoDB CPAN DistributionThursday, January 17, 13
  • Inside the MongoDB CPAN Distribution ✤ MongoDB::Database ✤ Represents a database (namespace) on the MongoDB serverThursday, January 17, 13
  • Inside the MongoDB CPAN Distribution ✤ MongoDB::Database ✤ Represents a database (namespace) on the MongoDB server ✤ MongoDB::Collection ✤ Represents a collection (table? kinda) in a databaseThursday, January 17, 13
  • Inside the MongoDB CPAN Distribution ✤ MongoDB::Database ✤ Represents a database (namespace) on the MongoDB server ✤ MongoDB::Collection ✤ Represents a collection (table? kinda) in a database ✤ MongoDB::Cursor ✤ Retrieves documents (rows? kinda) from a collectionThursday, January 17, 13
  • MongoDB DocumentsThursday, January 17, 13
  • MongoDB Documents ✤ Documents live in CollectionsThursday, January 17, 13
  • MongoDB Documents ✤ Documents live in Collections ✤ Documents have no pre-defined schemaThursday, January 17, 13
  • MongoDB Documents ✤ Documents live in Collections ✤ Documents have no pre-defined schema ✤ Documents have key-value pairs, like Perl hashesThursday, January 17, 13
  • MongoDB Documents ✤ Documents live in Collections ✤ Documents have no pre-defined schema ✤ Documents have key-value pairs, like Perl hashes ✤ Documents can have nested structure (arrays and other documents), like Perl hashesThursday, January 17, 13
  • MongoDB Documents ✤ Documents live in Collections ✤ Documents have no pre-defined schema ✤ Documents have key-value pairs, like Perl hashes ✤ Documents can have nested structure (arrays and other documents), like Perl hashes ✤ Documents look something like JSONThursday, January 17, 13
  • MongoDB Documents { title: Fellowship of the Ring, The, author: ObjectId("507ffbb1d94ccab2da652597"), language: English, genre: [fantasy, adventure], publication: { name: George Allen & Unwin, location: London, date: new Date(21 July 1954), } }Thursday, January 17, 13
  • Class Delegation Structure DocumentsThursday, January 17, 13
  • Class Delegation Structure Documents MongoDB::CursorThursday, January 17, 13
  • Class Delegation Structure Documents MongoDB::Cursor has() MongoDB::CollectionThursday, January 17, 13
  • Class Delegation Structure Documents MongoDB::Cursor has() MongoDB::Collection has() MongoDB::DatabaseThursday, January 17, 13
  • Class Delegation Structure Documents MongoDB::Cursor has() MongoDB::Collection has() MongoDB::Database has() MongoDB::MongoClientThursday, January 17, 13
  • Class Delegation Structure Documents MongoDB::Cursor Application has() MongoDB::Collection has() MongoDB::Database has() MongoDB::MongoClientThursday, January 17, 13
  • Let’s Build It!Thursday, January 17, 13
  • Building the LibraryThursday, January 17, 13
  • Building the LibraryThursday, January 17, 13
  • Building the LibraryThursday, January 17, 13
  • Building the LibraryThursday, January 17, 13
  • Building the Library Remember the Genres? { title: Fellowship of the Ring, The, author: ObjectId("507ffbb1d94ccab2da652597"), language: English, genre: [fantasy, adventure], publication: { name: George Allen & Unwin, location: London, date: new Date(21 July 1954), } }Thursday, January 17, 13
  • Building the LibraryThursday, January 17, 13
  • Building the LibraryThursday, January 17, 13
  • Where to go from here? ✤ Learn more about MongoDB: ✤ http://docs.mongodb.org/manual/ ✤ Learn more about the MongoDB Perl API ✤ https://metacpan.org/module/MongoDB::Tutorial ✤ Hack on the Library demo app ✤ https://github.com/friedo/mongo-library ✤ Add/edit authors? ✤ Edit books?Thursday, January 17, 13
  • What’s on CPAN? ✤ ODM’s (Object Document Mappers) ✤ Like ORMs but simplerThursday, January 17, 13
  • What’s on CPAN? ✤ Mongoose: ✤ Based on MongoMapper from Ruby. ✤ MongoDB Docs --> Moose objects.Thursday, January 17, 13
  • What’s on CPAN? ✤ MongoDBI ✤ Very Perlish ✤ Moose-like SyntaxThursday, January 17, 13
  • What’s on CPAN? ✤ MongoDB::Async ✤ Tracks upstream MongoDB Distribution ✤ Uses Coro and libev for asynchronous queries ✤ (Mostly) drop-in replacement for MongoDB driverThursday, January 17, 13
  • Questions https://github.com/friedo/mongo-library http://docs.mongodb.org/manual/ MongoDB::TutorialThursday, January 17, 13