Skip to content

Instantly share code, notes, and snippets.

@jorpic
Last active January 16, 2016 21:48
Show Gist options
  • Save jorpic/449e0ed58f5cfd730fee to your computer and use it in GitHub Desktop.
Save jorpic/449e0ed58f5cfd730fee to your computer and use it in GitHub Desktop.
M102: MongoDB for DBAs

https://university.mongodb.com/courses/M102/about

1

  • Concepts
    • support for new hardware
      • parallelism
      • clustering
      • scaling
    • easier development
    • complex data (unstructured & polymorphic)

Scaling

  • horizontal (vs vertical)
    • subsystem failures are common
    • complex communication within system
  • scaling vs rich features
    • we need to trade some features for scalability & speed (CAP)
      • distributed joins
      • complex distributed transactions

Documents

  • lack of joins impiles need for different (non-relational) data model
    • documents = "some structure" (vs. key-value sotrage)

BSON

  • Goals
    • fast scanability
    • datatypes
      • Date
      • BinData
      • int/long (32/64 bit)

Compact representation (sometimes) as a bonus.
Types matter when quering data: .find({price:1.25}) vs .find({price:"1.25"})

Dynamic Schema

  • Advantages of dynamic schema
    • polymorphic data (e.g. circles and rectangles in figure collection)
    • agile/iterative development
      • db migrations are sometimes easier

2

https://docs.mongodb.org/manual/reference/operator/query/
https://docs.mongodb.org/manual/reference/operator/update/ update({...}, {..}, {multi: false})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment