This Gist contains links to the tools and templates used during my talk at MongoDB World 2019. If you have any questions about the content or feel I've missed something, please feel free to shoot me a note at [email protected] or leave a comment below.
MongoDB Atlas delivers the world’s leading database for modern applications as a fully automated cloud service engineered and run by the same team that builds the database. Proven operational and security practices are built in, automating time-consuming administration tasks such as infrastructure provisioning, database setup, ensuring availability, global distribution, backups, and more.
The GUI for MongoDB. Visually explore your data. Run ad hoc queries in seconds. Interact with your data with full CRUD functionality. View and optimize your query performance. Available on Linux, Mac, or Windows. Compass empowers you to make smarter decisions about indexing, document validation, and more.
mgeneratejs generates structured, semi-random JSON data according to a template object. Can be used alongside mongoimport to seed a database with content.
The mongoimport tool imports content from an Extended JSON, CSV, or TSV export created by mongoexport, or potentially, another third-party export tool.
Setting up and seeding our database was done as follows:
- Create a New Atlas Cluster
- Get the connection string to be used in the mongo shell
- Import data using our template (
template.json
) as follows:
mgeneratejs template.json -n 1000000 | \
mongoimport --uri "mongodb+srv://<user>:<pass>@<cluster>.mongodb.net/data" -c users
Replace user
, pass
and cluster
with the values found in step #2
This will import 1M documents. Repeat the process as often as you like to generate more content.
Once the logs have been downloaded from Atlas (as a tar.gz
or gz
archive) and extracted, we will use mtools to filter and chart the logs.
As we may have multiple log files we will use mlogfilter to merge the logs together (and strip them of markers). mlogfilter can also be used to limit the logs to a specific date/time range though we will not be filtering by date in the following examples.
Charting by Execution Time
mlogfilter *.log --markers none | mplotqueries --logscale
Although not specified, the default mplotqueries plot type is the scatter plot with a yaxis
set to duration
, which we've used above.
Charting by Documents Scanned vs. Number Returned
mlogfilter *.log --markers none | mplotqueries --type docsExamined/n