Why I Believe MongoDB is The Dog's Bollocks

3,034 views

Published on

Published in: Technology, Art & Photos, Business
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
3,034
On SlideShare
0
From Embeds
0
Number of Embeds
655
Actions
Shares
0
Downloads
6
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Why I Believe MongoDB is The Dog's Bollocks

  1. 1. WHY I BELIEVE MONGODB IS THE DOGSBOLLOCKS Mr. Mongo Mark @m_smalley
  2. 2. PERSPECTIVE
  3. 3. WHERE I CAME FROM( and yes – Im a bit of a star wars fan )
  4. 4. 1992 - Manchester BASIC( information kiosk for imaginary town )
  5. 5. 1997 - Miri FLASH( also started designing )
  6. 6. 2005 – Kuala Lumpur HTML + CSS( started my own web-development company )
  7. 7. 2010 – LaulimaMET MONGO ( fell in love )
  8. 8. 2011 – Silicon Valley RECOGNITION( starting with a mug and ending with a master )
  9. 9. CONFESSION #1
  10. 10. CONFESSION #1IM NO MASTER( but I do know how to make the most of things )
  11. 11. CONFESSION #2
  12. 12. CONFESSION #2ITS REALLY EASY( once youve got it all set up )
  13. 13. FOREXAMPLE
  14. 14. THERE IS NO SPOON !!! ( or need to leave your app )
  15. 15. NO LANGUAGE BARRIERS !!! ( all the logic is in one place )
  16. 16. Why ?mongoDB
  17. 17. EXCELLENT GEOLOCATION SUPPORT ( have you ever heard of Foursquare ...? )
  18. 18. ITS LIGHTENING FAST !!! ( some say 6,000 times faster in fact )
  19. 19. SCHEMA-LESS JSON DATA ( otherwise known as freedom )
  20. 20. REPLICA-SETS & SHARDING( load-balancing and auto back-ups built-in from day one )
  21. 21. LASTBUT NOTLEAST
  22. 22. GRIDFS( media storage and serving )
  23. 23. EXAMPLE PHPCODE
  24. 24. CREATE DB + COLLECTION + INSERT DATA// MongoDB PHP Class$m = new Mongo();// Select Database & Collection (Table)$db = $m->freesquare;$collectiom = $db->places;// Add Document (Add a Record)$obj = array( "title" => "KL MongoDB User-Group", "loc" => array( "lng" => 101.67646, "lat" => 3.127896 ))$results = $collection->insert($obj);
  25. 25. HAVING ADDED SEVERAL PLACES// Assuming collection is defined// We can now add the GeoSpatial Index$collection->ensureIndex(array("loc"=>"2d");// Defining my current location$my_location = array(101.67646, 3.127896);// Find Nearest Locations$nearest_place = $collection->command(array( "geoNear" => "loc", "near" => $my_location, "spherical" => true, "num" => 1))// Ready for AJAX listenersecho json_encode($nearest_place);
  26. 26. KL MongoDB User-Group THE END RESULTS( if connected to something such as gSpot – for example )
  27. 27. LEARN MORE BOLLOCKS( about mongoDB and the products, services and people using it ) Kuala Lumpur MongoDB User Group https://www.facebook.com/groups/klmug/ 1st Wednesday of Every Month Tweet Me - @m_smalley

×