Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Introduction to MongoDB

These are the slides from the Docler Hollywood Code Retreat held on Saturday, April 9. The talk covered Node.js, Swift and MongoDB.

  • Be the first to comment

  • Be the first to like this

Introduction to MongoDB

  1. 1. An introduction to Jean-Luc David
 Head of Technology
 jldavid@gmail.com
 Twitter: @jldavid
  2. 2. Today 09:00-10:00 AM - Arrivals and Light Breakfast 10:00-11:00 AM - Introduction to HTTP & Node.js 11:00-12:00 AM - Introduction to MongoDB 12:00-01:00 PM - Building a Simple API 01:00-02:00 PM - Light Lunch 02:00-03:00 PM - Introduction to Swift 03:00-04:00 PM - Building a Basic Store App 04:00-05:00 PM - Adding Controls, Maps & Networking 05:00-05:30 PM - Q&A and Departure
  3. 3. About Us Docler Media is a well-funded, progressive tech startup in Los Angeles. A part of the massive and massively successful Docler Holding group of international companies, we are centered around the idea of creating unique, exciting and fun products and services.
  4. 4. Taco! Night
  5. 5. Agenda • Learn the history of MongoDB • Install Homebrew • Install MongoDB • MongoDB using a shell • Using mLab
  6. 6. MongoDB vs SQL • Philosophy - NoSQL vs Relational • Data - JSON vs Binary • Hosting - In-Memory vs on disk • Format - Documents vs Records • Strengths - Built for reads, not for writes • Relationships - Joins vs MapReduce • Performance - MongoDB vs SQL • Schema - Strict vs Schemaless • Queries - SQL vs BSON
  7. 7. History of MongoDB • MongoDB (from humongous) is a cross- platform document-oriented database • 2007 - 10gen began developing MongoDB as a component of PaaS. • 2009 - the company shifted to an open source development model, offering commercial support & other services. • 2013 - 10gen changes its name to MongoDB Inc.
  8. 8. MongoDB Facts • Component of the MEAN stack • Database = Databases • Table = Collection • Record = Document • BSON Document has a limit of 16MB
  9. 9. Performance Benchmarks
  10. 10. Thoughts About Security
  11. 11. Companies Using MongoDB
  12. 12. Installing Homebrew xcode-select --install
 
 ruby -e "$(curl -fsSL https:// 
 raw.githubusercontent.com/Homebrew/
 install/master/install)"
 
 brew update
  13. 13. Installing MongoDB 
 brew install mongodb 

  14. 14. Installing MongoDB Manually curl -O https://fastdl.mongodb.org/
 osx/mongodb-osx-x86_64-3.2.4.tgz
 
 tar -zxvf mongodb-osx-x86_64-3.2.4.tgz
 
 mkdir -p mongodb 
 cp -R -n mongodb-osx-x86_64-3.2.4/ 
 mongodb 
 export PATH=<mongodb-install-directory>
 /bin:$PATH
  15. 15. Starting MongoDB Locally # if you get /data/db missing error
 sudo mkdir -p /data/db/ sudo chown `id -u` /data/db # in terminal window, start the daemon mongod # in another terminal window, start mongo mongo
  16. 16. CREATE & READ Documents db use addressbook
 show collections
 
 db.customers.save({"name":"JL",
 "lastname":"David"})
 
 db.customers.find()
 db.getCollectionNames()
 
 show dbs
 db.help()
  17. 17. UPDATE Document db.customers.update({"name":"JL"},{$set: {"name":"Jean-Luc"}})
 db.customers.insert({"name":"Kolos",
 "lastname":"Kaszaly"})
  18. 18. DELETE Document & Collection db.customers.remove({“_id":"57090110d90540e8 0621a262"}) db.customers.drop()
 db.dropDatabase()

  19. 19. Using mLab http://www.mlab.com
  20. 20. Agenda • Learn the history of MongoDB • Install Homebrew • Install MongoDB • MongoDB command line • Using mLab • 10 Min Break

×