Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Intro to NoSQL & MongoDB

Intro to NoSQL & MongoDB

An overview of the ins and outs of NoSQL & MongoDB, delivered for students at Fullstack & Grace Hopper Academies in New York.

justin j. moses

August 10, 2016
Tweet

More Decks by justin j. moses

Other Decks in Technology

Transcript

  1. An introduction to NoSQL & MongoDB Prepared by Justin J.

    Moses for Fullstack & Grace Hopper Academy August 2016
  2. Hey there, I’M JUSTIN I’m an engineer at MongoDB, leading

    the web team for our Cloud products. You can find me at: @justinjmoses
  3. What is NoSQL? ✘ Databases without inherent relations ✘ Easier

    to distribute data across nodes (horizontal scaling) without relations ✘ Mostly schema-free ✘ Typically geared towards read performance (i.e. free of joins) ✘ Examples include CouchDB, Cassandra, Couchbase, MarkLogic & of course, MongoDB
  4. A brief history on MongoDB Started in 2007 Back then

    it was just a part of 10gen’s platform as a service they were creating A happy accident The database became more popular than the platform, such that the company eventually rebranded to MongoDB. humongous The name comes from the word “humongous”, implying the built-in tools to help scale up quickly
  5. What’s inside the box? JSON (BSON) Stores data as binary-JSON,

    meaning it’s the using same format as your app’s REST API Schema Free Instead of defining a schema upfront, it is inferred from the state of the documents within the collection Upsertion Follows the FP philosophy of nullable types - that is either insert or update in one fell swoop - databases, collections and even documents. High Availability Introduces the concept of a Replica Set: a primary node replicating data to any number of secondaries. If the primary goes down, a secondary will take its place. Scaling Support Provides load balancing via the creation of sharding. That is, balancing data across various nodes and sending each query to the appropriate node. Aggregation Boasts a powerful aggregation pipeline, to funnel your data through composable transformers..
  6. Learning to speak Mongo SQL Terms/Concepts MongoDB Terms/Concepts database database

    table collection record document column field join embedded document ID Object ID
  7. Pros Without the need for complicated joins, reads are simple

    & fast. Ins & outs of denormalization Cons Updates are more cumbersome (mutate multiple documents) and data may become invalid.
  8. joins you have to do them yourself views persistent queries

    transactions cannot guarantee multiple insertions occur atomically