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

MongoDB Introduction

MongoDB Introduction

Presented at the SF MongoDB/F# meetup

Sridhar Nanjundeswaran

September 04, 2013
Tweet

More Decks by Sridhar Nanjundeswaran

Other Decks in Programming

Transcript

  1. 2 10Gen is now MongoDB 280+ employees 500+ customers Over

    $81 million in funding Offices in New York, Palo Alto, Washington DC, London, Dublin, Barcelona and Sydney
  2. 3 Relational Database Challenges Data Types • Unstructured data •

    Semi-structured data • Polymorphic data Volume of Data • Petabytes of data • Trillions of records • Tens of millions of queries per second Agile Development • Iterative • Short development cycles • New workloads New Architectures • Horizontal scaling • Commodity servers • Cloud computing
  3. 5 MongoDB is a ___________ database • Document-oriented • Open-source

    • High performance and horizontally scalable • Full featured
  4. 6 Document-Oriented Database • Not .PDF & .DOC files •

    A document is essentially an associative array – JSON object, PHP Array, Python Dictionary, etc. • BSON – www.bsonspec.org
  5. 7 Open-Source • MongoDB is an open-source project • On

    GitHub • Database licensed under the AGPL • Drivers licensed under Apache
  6. 8 High Performance and Horizontally Scalable • High performance –

    Written in C++ – Data serialized as BSON (fast parsing) – Full support for primary & secondary indexes • Horizontally scalable – Auto-sharding – Scale across • Commodity hardware • Cloud compute • Hybrid
  7. 9 Full Featured • Rich Ad Hoc queries • Real

    time aggregation • Geospatial features • Native bindings for most programming languages
  8. 10 MongoDB is a Single-Master System • All writes are

    to a primary (master) • Failure of the primary is detected, and a new one is elected • Application writes get an error if there is no quorum to elect a new master – Reads can continue
  9. 11 MongoDB Storage Management • Data is kept in memory-mapped

    files • Files are allocated as needed • Indexes (B*-trees) point to documents using geographical addresses
  10. 16 > db.users.findOne() { "_id" : ObjectId("50804d0bd94ccab2da652599"), …, ”tag_count” :

    2, ”tags” : ["superuser", ”dbadmin"], "address" : {"street" : "555 University Avenue", "city": "Palo Alto”} } User document
  11. 17 Terminology RDBMS Mongo Table, View Collection Row(s) Document Index

    Index Join Embedded Document Partition Shard Partition Key Shard Key
  12. 19 MongoDB drivers • Official Support for 13 languages •

    Community drivers for tons more – R, lua etc. • Drivers connect to mongo servers • Drivers translate BSON into native types • mongo shell is not a driver, but works like one in some ways • Installed using typical means (npm, pecl, gem, pip)