An introduction to MongoDB from an experienced MySQL user and developer. There are differences and we go thru the What/Why/Who/Where of MongoDB, the "similarities" to the MySQL world like storage engines, how replication is a little more interesting with built-in sharding and automatic failover, backups, monitoring, DBaaS, going to production and finding out more resources.
My First Moments with
email@example.com | @bytebot | http://bytebot.net/blog/
Community Open House, New York City, New York, USA
30 June 2016
• Work on MariaDB Server at MariaDB Corporation
• Merged with Monty Program Ab, makers of MariaDB
• Formerly MySQL AB (exit: Sun Microsystems)
• Past lives include Fedora Project (FESCO),
• MySQL Community Contributor of the Year Award
• What is MongoDB?
• Why MongoDB?
• Who uses MongoDB?
• Where is MongoDB
• Storage Engines
• 1970 E.F. Codd paper “A Relational Model of Data for Large
Shared Data Banks”
• 2004 Google paper “MapReduce: Simpliﬁed Data Processing on
Large Clusters” -> Hadoop ~2008 “big data movement”
• 2006 Google paper “BigTable: A Distributed Storage System for
Structured Data” -> Cassandra/HBase/LevelDB ~2009
• 2007 Amazon paper “Dynamo: Amazon’s Highly Available Key-
value Store” -> Aerospike/Cassandra/Voldemort/Riak
• 2012 Google paper “Spanner: Google’s Globally-Distributed
Database” -> CockroachDB
What is MongoDB?
• Document oriented database
• data stored in documents, not tables/relations
• Flexible schema
• no downtime for ﬁeld (column) changes or index
• “After three years it has become clear that in
terms of LinkedIn member proﬁles there is only
one trend: the total dominance of MongoDB.” -
Matt Aslett, 451 Group
• Agile development
• No additional caching layer required
• Built in replication with automatic failover +
sharding out of the box
Who uses MongoDB?
• Facebook’s Parse
• Business Insider
Where is MongoDB found?
• All manner of Linux distributions
• MongoDB repositories: http://repo.mongodb.org/
• Works on Little Endian only (SERVER-1625)
• Test databases (mongoimport)
Distributions of MongoDB
• MongoDB Enterprise
• Percona Server for MongoDB
• MongoRocks, audit logging, SASL
• Node: single mongod process
• Replica set: group of nodes. HA via elections. All
members are equal by default + replicate to
each other asynchronously
• Oplog: capped collection, idempotent
• Shard: replica sets are groups. Queries ﬁltered
for data chunk holds
• Conﬁg servers: metadata for sharded clusters
• Conﬁgure mongod.conf!
• Follow through and you’ll be off to a good start
• Understanding aggregation framework
• Sizing and provisioning
• db.collection.stats(), .explain()
• GIS functionality
• Grants? There are roles in MongoDB!
• Percona Toolkit? mlogsummary, mongo-summary