Your SlideShare is downloading. ×
0
Webinar: Building Your First MongoDB App
Webinar: Building Your First MongoDB App
Webinar: Building Your First MongoDB App
Webinar: Building Your First MongoDB App
Webinar: Building Your First MongoDB App
Webinar: Building Your First MongoDB App
Webinar: Building Your First MongoDB App
Webinar: Building Your First MongoDB App
Webinar: Building Your First MongoDB App
Webinar: Building Your First MongoDB App
Webinar: Building Your First MongoDB App
Webinar: Building Your First MongoDB App
Webinar: Building Your First MongoDB App
Webinar: Building Your First MongoDB App
Webinar: Building Your First MongoDB App
Webinar: Building Your First MongoDB App
Webinar: Building Your First MongoDB App
Webinar: Building Your First MongoDB App
Webinar: Building Your First MongoDB App
Webinar: Building Your First MongoDB App
Webinar: Building Your First MongoDB App
Webinar: Building Your First MongoDB App
Webinar: Building Your First MongoDB App
Webinar: Building Your First MongoDB App
Webinar: Building Your First MongoDB App
Webinar: Building Your First MongoDB App
Webinar: Building Your First MongoDB App
Webinar: Building Your First MongoDB App
Webinar: Building Your First MongoDB App
Webinar: Building Your First MongoDB App
Webinar: Building Your First MongoDB App
Webinar: Building Your First MongoDB App
Webinar: Building Your First MongoDB App
Webinar: Building Your First MongoDB App
Webinar: Building Your First MongoDB App
Webinar: Building Your First MongoDB App
Webinar: Building Your First MongoDB App
Webinar: Building Your First MongoDB App
Webinar: Building Your First MongoDB App
Webinar: Building Your First MongoDB App
Webinar: Building Your First MongoDB App
Webinar: Building Your First MongoDB App
Webinar: Building Your First MongoDB App
Webinar: Building Your First MongoDB App
Webinar: Building Your First MongoDB App
Webinar: Building Your First MongoDB App
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Webinar: Building Your First MongoDB App

3,350

Published on

This webinar will walk you through building a simple location-based check-in app in MongoDB. We’ll cover the basics of MongoDB’s document model, query language, map reduce framework, and deployment …

This webinar will walk you through building a simple location-based check-in app in MongoDB. We’ll cover the basics of MongoDB’s document model, query language, map reduce framework, and deployment architecture.

In this webinar you will discover:

- Why MongoDB is being adopted in organizations large and small
- How easy it is to start building applications with MongoDB
- Key features for manipulating and accessing data
- High availability and scale-out architecture

Published in: Technology
0 Comments
10 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
3,350
On Slideshare
0
From Embeds
0
Number of Embeds
6
Actions
Shares
0
Downloads
105
Comments
0
Likes
10
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. #MongoDB Building your first app; an introduction to MongoDB Rick Houlihan Solutions Architect, MongoDB
  • 2. What is MongoDB?
  • 3. MongoDB is a ___________ database • Document • Open source • High performance • Horizontally scalable • Full featured
  • 4. Document Database • Not for .PDF & .DOC files • A document is essentially an associative array • Document = JSON object • Document = PHP Array • Document = Python Dict • Document = Ruby Hash • etc
  • 5. Open Source • MongoDB is an open source project • On GitHub • Licensed under the AGPL • Started & sponsored by MongoDB Inc (formerly 10gen) • Commercial licenses available • Contributions welcome
  • 6. High Performance • Written in C++ • Extensive use of memory-mapped files i.e. read-through write-through memory caching. • Runs nearly everywhere • Data serialized as BSON (fast parsing) • Full support for primary & secondary indexes • Document model = less work
  • 7. Database Landscape
  • 8. Full Featured • Ad Hoc queries • Real time aggregation • Rich query capabilities • Strongly consistent • Geospatial features • Support for most programming languages • Flexible schema
  • 9. mongodb.org/downloads
  • 10. Running MongoDB $ tar –z xvf mongodb-osx-x86_64-2.4.x.tgz $ cd mongodb-osx-i386-2.4.4/bin $ mkdir –p /data/db $ ./mongod
  • 11. Mongo Shell MacBook-Air-:~ $ mongo MongoDB shell version: 2.4.4 connecting to: test > db.test.insert({text: 'Welcome to MongoDB'}) > db.test.find().pretty() { "_id" : ObjectId("51c34130fbd5d7261b4cdb55"), "text" : "Welcome to MongoDB" }
  • 12. Document Database
  • 13. Terminology RDBMS MongoDB Table, View ➜ Collection Row ➜ Document Index ➜ Index Join ➜ Embedded Document Foreign Key ➜ Reference Partition ➜ Shard
  • 14. Let’s Build a Blog
  • 15. First step in any application is Determine your entities
  • 16. Entities in our Blogging System • Users (post authors) • Article • Comments • Tags
  • 17. In a relational base app We would start by doing schema design
  • 18. Typical (relational) ERD
  • 19. In a MongoDB based app We start building our app and let the schema evolve
  • 20. MongoDB ERD
  • 21. Working With MongoDB
  • 22. Start with an object (or array, hash, dict, etc) var user = { username: ’erlichson', first_name: ’Andrew', last_name: ’Erlichson', }
  • 23. Switch to Your DB >db test > use blog switching to db blog > db.users.insert( user )
  • 24. Insert the Record > db.users.insert(user) No collection creation necessary
  • 25. Find One Record > db.users.findOne() { "_id" : ObjectId("50804d0bd94ccab2da652599"), "username" : ”erlichson", "first_name" : ”Andrew", "last_name" : ”Erlichson" }
  • 26. Creating a Blog Post > db.article.insert({ title: ‘Hello World’, body: ‘This is my first blog post’, date: new Date(‘2013-06-20’), username: ‘erlichson’, tags: [‘adventure’, ‘mongodb’], comments: [ ] })
  • 27. Finding the Post > db.article.find().pretty() { "_id" : ObjectId("51c3bafafbd5d7261b4cdb5a"), "title" : "Hello World", "body" : "This is my first blog post", "date" : ISODate("2013-06-20T00:00:00Z"), "username" : "erlichson", "tags" : [ "adventure", "mongodb" ], "comments" : [ ] }
  • 28. Querying An Array > db.article.find({tags:'adventure'}).pretty() { "_id" : ObjectId("51c3bcddfbd5d7261b4cdb5b"), "title" : "Hello World", "body" : "This is my first blog post", "date" : ISODate("2013-06-20T00:00:00Z"), "username" : "erlichson", "tags" : [ "adventure", "mongodb" ], "comments" : [ ] }
  • 29. Using Update to Add a Comment > db.article.update({_id: new ObjectId("51c3bcddfbd5d7261b4cdb5b")}, {$push:{comments: {name: 'Steve Blank', comment: 'Awesome Post'}}}) >
  • 30. Post with Comment Attached > db.article.findOne({_id: new ObjectId("51c3bcddfbd5d7261b4cdb5b")}) { "_id" : ObjectId("51c3bcddfbd5d7261b4cdb5b"), "body" : "This is my first blog post", "comments" : [ { "name" : "Steve Blank", "comment" : "Awesome Post" } ], "date" : ISODate("2013-06-20T00:00:00Z"), "tags" : [ "adventure", "mongodb" ], "title" : "Hello World", "username" : "erlichson" }
  • 31. MongoDB Drivers
  • 32. Real applications are not built in the shell
  • 33. MongoDB has native bindings for over 12 languages
  • 34. docs.mongodb.org
  • 35. Online Training at MongoDB University
  • 36. We've introduced a lot of concepts here
  • 37. Schema Design @
  • 38. Replication @
  • 39. Indexing @
  • 40. Sharding @
  • 41. Questions?
  • 42. #MongoDBWorld MongoDB World New York City, June 23-25 See what’s next in MongoDB including • MongoDB 2.6 • Sharding • Replication • Aggregation http://world.mongodb.com Save $200 with discount code THANKYOU
  • 43. #ConferenceHashtag Thank You Rick Houlihan Solutions Architect, MongoDB

×