MongoDB continues to rocket into space with ever-increasing thrust, but you just showed up today at the launch pad. With such an ever-growing universe of features, tools and versions, where to start? Fear not, Friend, for this talk is aimed specifically at you. Remember, we were all once noobs...
3. The Hitchhiker’s Guide to the Galaxy
Douglas Adams
"The Guide is described as resembling 'a
small, thin, flexible lap computer’ encased
in a 'sturdy plastic cover' with the words
'Don't Panic' inscribed on it 'in large,
friendly letters'. It is presumably of robust
construction, making it able to withstand
falling through time/space wormholes and
being thrown into swamps, being rescued,
and still operating.”
5. % whoami
Gorilla gorilla (lowland)
Gorilla beringei (mountain)
Great Ape Conservation Fund
Part Silverback…
6. % whoami
42Gorilla gorilla (lowland)
Gorilla beringei (mountain)
Great Ape Conservation Fund
Part Silverback… Part Hitchhiker
7. Welcome, Fellow Hitchhiker
Is this you?
§ “I’ve been told I need to learn this MongoDB thing…”
§ “I want to learn MongoDB, but I don’t know where to start…”
§ “MongoDB seems to be expanding too fast to keep up with…”
§ “When I ask how to join tables in MongoDB, people snort…”
§ ”But, but, I’ve been using RDBMSs, like, forever !!!”
8. Welcome, Fellow Hitchhiker
Is this you?
§ “I’ve been told I need to learn this MongoDB thing…”
§ “I want to learn MongoDB, but I don’t know where to start…”
§ “MongoDB seems to be expanding too fast to keep up with…”
§ “When I ask how to join tables in MongoDB, people snort…”
§ ”But, but, I’ve been using RDBMSs forever !!!”
YOU
GOT
THIS!
10. Making Sense Of All Things Mongo
Our Rapidly Expanding Universe
§ All since 2007-2008 (really, since c. 2013)
11. Making Sense Of All Things Mongo
Comparison: A Certain Red-ish, 40-year-old RDBMS
§ All since 1977
12. Making Sense Of All Things Mongo
Our Rapidly Expanding Universe
§ All since 2007-2008 (really, since c. 2013)
The MongoDB Community
Open Source. Freely available for use. Thousands of
users, millions of deployments.
Server Community Edition
13. Making Sense Of All Things Mongo
Our Rapidly Expanding Universe
§ All since 2007-2008 (really, since c. 2013)
.
Server Enterprise Edition
MongoDB, Inc.
Support. Best Practices. DBaaS. Enterprise
functionality/features . Innovation.
Atlas MongoDB Service
14. Making Sense Of All Things Mongo
Our Rapidly Expanding Universe
§ All since 2007-2008 (really, since c. 2013)
.
Server Enterprise Edition
MongoDB, Inc.
Support. Best Practices. DBaaS. Enterprise
functionality/features . Innovation.
Atlas MongoDB Service
BI Connector
[connect to BI Tools]
15. Making Sense Of All Things Mongo
Our Rapidly Expanding Universe
§ All since 2007-2008 (really, since c. 2013)
.
Server Enterprise Edition
MongoDB, Inc.
Support. Best Practices. DBaaS. Enterprise
functionality/features . Innovation.
Atlas MongoDB Service
Ops Manager
[on-prem mgmt]
Cloud Manager
[hosted mgmt]
BI Connector
[connect to BI Tools]
16. Making Sense Of All Things Mongo
Our Rapidly Expanding Universe
§ All since 2007-2008 (really, since c. 2013)
.
Server Enterprise Edition
MongoDB, Inc.
Support. Best Practices. DBaaS. Enterprise
functionality/features . Innovation.
Atlas MongoDB Service
Ops Manager
[on-prem mgmt]
Sync + Stitch
[mobile / serverless]
Cloud Manager
[hosted mgmt]
BI Connector
[connect to BI Tools]
17. Making Sense Of All Things Mongo
Our Rapidly Expanding Universe
§ All since 2007-2008 (really, since c. 2013)
.
Server Enterprise Edition
MongoDB, Inc.
Support. Best Practices. DBaaS. Enterprise
functionality/features . Innovation.
Atlas MongoDB Service
Ops Manager
[on-prem mgmt]
Sync + Stitch
[mobile / serverless]
Cloud Manager
[hosted mgmt]
BI Connector
[connect to BI Tools]
Charts
[built-in visualization]
18. Making Sense Of All Things Mongo
Our Rapidly Expanding Universe
§ Too much stuff… panic… rising…
= ?
19. Making Sense Of All Things Mongo
Our Rapidly Expanding Universe
§ Too much stuff… panic… rising…
= ?
YOU
GOT
THIS!
20. Making Sense Of All Things Mongo
Our Rapidly Expanding Universe
Big MongoDB Rule:
It’s OK (and often desirable) to Start Simply
25. Top 5 Takeaways for new MongoDB Hitchhikers
1) MongoDB is proven for uses Big and Small
26. Top 5 Takeaways for new MongoDB Hitchhikers
1) MongoDB is proven for uses Big and Small
2) One needn’t use (or even fully understand) the more complex
pieces of MongoDB to use it well
27. Top 5 Takeaways for new MongoDB Hitchhikers
1) MongoDB is proven for uses Big and Small
2) One needn’t use (or even fully understand) the more complex
pieces of MongoDB to use it well
3) “Schemaless” is both a misnomer and an opportunity
28. Top 5 Takeaways for new MongoDB Hitchhikers
1) MongoDB is proven for uses Big and Small
2) One needn’t use (or even fully understand) the more complex
pieces of MongoDB to use it well
3) “Schemaless” is both a misnomer and an opportunity
4) New Hitchhikers need to check their preconceptions at the
door
29. Top 5 Takeaways for new MongoDB Hitchhikers
1) MongoDB is proven for uses Big and Small
2) One needn’t use (or even fully understand) the more complex
pieces of MongoDB to use it well
3) “Schemaless” is both a misnomer and an opportunity
4) New Hitchhikers need to check their preconceptions at the
door
5) Let your access patterns determine your data structure
30. Making Sense Of All Things Mongo
Start Simply and Locally
• MongoDB Server on your {laptop,desktop}, plus Compass or
MongoDB Shell
• Be Careful: mongos is not the MongoDB Shell!
• Be aware of MongoDB Shell database ‘context’
% mongo localhost:27017
> use myDatabase
switched to db myDatabase
> db.myCollection.insert({field:"this is in myDatabase.myCollection"})
WriteResult({ "nInserted" : 1 })
> use admin
switched to db admin
> db.myCollection.find()
>
32. Making Sense Of All Things Mongo
Start Simply and Locally
• MongoDB Server on your {laptop,desktop}, plus Compass or
MongoDB Shell
33. Making Sense Of All Things Mongo
Start Simply and Locally
• MongoDB Server on your {laptop,desktop}, plus Compass or
MongoDB Shell
• Be Careful: mongos is not the MongoDB Shell
34. Making Sense Of All Things Mongo
Start Simply and Locally
• MongoDB Server on your {laptop,desktop}, plus Compass or
MongoDB Shell
• Be Careful: mongos is not the MongoDB Shell!
• Be aware of MongoDB Shell database ‘context’
% mongo localhost:27017
> use myDatabase
switched to db myDatabase
> db.myCollection.insert({field:"this is in myDatabase.myCollection"})
WriteResult({ "nInserted" : 1 })
> use admin
switched to db admin
> db.myCollection.find()
>
39. Jumping In
Data Design
§ Access patterns drive MongoDB data design
§ Collection definition cannot be done in a vacuum
§ First: “What are the main types of things in your database?”
§ Then: “What are your apps’ most important queries?”
§ Then: “What are your apps’ most important writes?”
40. Jumping In
Data Design
§ Access patterns drive MongoDB data design
§ Collection definition cannot be done in a vacuum
§ First: “What are the main types of things in your database?”
§ Then: “What are your apps’ most important queries?”
§ Then: “What are your apps’ most important writes?”
§ Never, never, never, never, never expect to port an app from an
RDBMS with a 1:1 mapping from tables to collections
41. Jumping In
Data Design
§ Access patterns drive MongoDB data design
§ Collection definition cannot be done in a vacuum
§ First: “What are the main types of things in your database?”
§ Then: “What are your apps’ most important queries?”
§ Then: “What are your apps’ most important writes?”
§ Never, never, never, never, never expect to port an app from an
RDBMS with a 1:1 mapping from tables to collections
§ Know thy working set
42. “If I’d Only Known…”
Tales from the Road Warrior
43. “If I’d Only Known…”
Tales from the Road Warrior
§ MongoDB Shell is a JavaScript interpreter!
> for (i=1; i<=20; i++) { db.testcol.insertOne( { _id : i, a : i } ) }
{ "acknowledged" : true, "insertedId" : 20 }
44. “If I’d Only Known…”
Tales from the Road Warrior
§ MongoDB Shell is a JavaScript interpreter!
§ MongoDB Shell has shortcuts
> for (i=1; i<=20; i++) { db.testcol.insertOne( { _id : i, a : i } ) }
{ "acknowledged" : true, "insertedId" : 20 }
45. “If I’d Only Known…”
Tales from the Road Warrior
§ MongoDB Shell is a JavaScript interpreter!
§ MongoDB Shell has shortcuts
§ Don’t try to be overly clever with Boolean values
§ {$ne: true} is not the same as {$eq: false}
> for (i=1; i<=20; i++) { db.testcol.insertOne( { _id : i, a : i } ) }
{ "acknowledged" : true, "insertedId" : 20 }
46. “If I’d Only Known…”
Tales from the Road Warrior
§ MongoDB Shell is a JavaScript interpreter!
§ MongoDB Shell has shortcuts
§ Don’t try to be overly clever with Boolean values
§ {$ne: true} is not the same as {$eq: false}
§ Copy-and-Paste can introduce “smart quotes”; MongoDB Shell
doesn’t like “smart quotes”
> for (i=1; i<=20; i++) { db.testcol.insertOne( { _id : i, a : i } ) }
{ "acknowledged" : true, "insertedId" : 20 }
50. Tools for Your MongoDB Life
m
§ https://github.com/aheckmann/m
§ Manage multiple versions of
MongoDB, quickly switch between
them
§ Used for: local sandboxes
$ m
4.0.5-ent
ο 4.0.8
4.0.9
$ m 4.0.9
Activating 4.0.9
$ mongod --version
db version v4.0.9
51. Tools for Your MongoDB Life
mtools
§ https://github.com/rueckstiess/mto
ols
§ a) Log analysis and visualization of
any mongod logfile
§ b) mlaunch quick spin-up script;
Stand up local test Standalone,
Replica Set, or Sharded Cluster in
seconds
$ mlaunch init --replicaset --
sharded 3
launching: "mongod" on port 27018
launching: "mongod" on port 27019
:
:
52. Tools for Your MongoDB Life
mgeneratejs
§ https://github.com/rueckstiess/mgeneratejs
§ Generate semi-structured JSON for import w/mongoimport
§ Used for: any instance
$ mgeneratejs '{"name": "$name", "age": "$age", "emails": {"$array":
{"of": "$email", "number": 3}}}' -n 1000000 > collectionData.json
$ mongoimport –d test –c myCollection collectionData.json
2019-04-18T17:31:26.922-0400 connected to: localhost
2019-04-18T17:32:57.893-0400 imported 1000000 documents
53. O, Where to Turn?
Community Resources for MongoDB Novitiate
54. O, Where to Turn?
Community Resources for MongoDB Novitiate
§ The MongoDB Slack Community is the place to meet other users, learn,
and get answers to questions.
55. O, Where to Turn?
Community Resources for MongoDB Novitiate
§ The MongoDB Slack Community is the place to meet other users, learn,
and get answers to questions.
§ MongoDB-User Community Support Forum: A community forum best
suited for open-ended, opinion-based, or general questions about
MongoDB. You can post and view the forum via the Google Groups web
interface or subscribe to updates via email.
56. O, Where to Turn?
Community Resources for MongoDB Novitiate
§ The MongoDB Slack Community is the place to meet other users, learn,
and get answers to questions.
§ MongoDB-User Community Support Forum: A community forum best
suited for open-ended, opinion-based, or general questions about
MongoDB. You can post and view the forum via the Google Groups web
interface or subscribe to updates via email.
§ Stack Overflow: A community Q&A site for specific programming
questions with factual, rather than subjective, answers
57. O, Where to Turn?
Community Resources for MongoDB Novitiate
§ The MongoDB Slack Community is the place to meet other users, learn,
and get answers to questions.
§ MongoDB-User Community Support Forum: A community forum best
suited for open-ended, opinion-based, or general questions about
MongoDB. You can post and view the forum via the Google Groups web
interface or subscribe to updates via email.
§ Stack Overflow: A community Q&A site for specific programming
questions with factual, rather than subjective, answers
§ DBA Stack Exchange: A community Q&A site for database administrators
and other database professionals.
58. O, Where to Turn?
Enterprise Resources for MongoDB Novitiate
59. O, Where to Turn?
Enterprise Resources for MongoDB Novitiate
§ MongoDB Technical Support provides Enterprise Customers with timely
technical support for MongoDB products
60. O, Where to Turn?
Enterprise Resources for MongoDB Novitiate
§ MongoDB Technical Support provides Enterprise Customers with timely
technical support for MongoDB products
§ MongoDB Professional Services gives Customers access to world class
MongoDB Best Practices and expertise on-site
61. O, Where to Turn?
Enterprise Resources for MongoDB Novitiate
§ MongoDB Technical Support provides Enterprise Customers with timely
technical support for MongoDB products
§ MongoDB Professional Services gives Customers access to world class
MongoDB Best Practices and expertise on-site
§ MongoDB University serves up free self-paced or instructor-paced virtual
courses, and offers MongoDB Admin and Developer Certifications
64. Summing Up
§ It’s OK to start simply with MongoDB
§ Be open to the new concepts and paradigms offered by
MongoDB
65. Summing Up
§ It’s OK to start simply with MongoDB
§ Be open to the new concepts and paradigms offered by
MongoDB
§ The ‘Aha!’ moments will come in time – look for them!
66. Summing Up
§ It’s OK to start simply with MongoDB
§ Be open to the new concepts and paradigms offered by
MongoDB
§ The ‘Aha!’ moments will come in time – look for them!
§ Don’t be afraid to ask
67. Summing Up
§ It’s OK to start simply with MongoDB
§ Be open to the new concepts and paradigms offered by
MongoDB
§ The ‘Aha!’ moments will come in time – look for them!
§ Don’t be afraid to ask
§ Don’t Panic You Got This!
YOU
GOT
THIS!