Storage-viz: Storage Visualizers and Commands for MongoDB

Nov 20 • Posted 1 year ago

Storage-viz is a suite of web-based visualizers and new experimental database commands that may help you understand how MongoDB utilizes storage and organizes btrees. Storage-viz is now available in the MongoDB Nightly builds.

image

When a MongoDB collection is created, an on-disk extent is allocated to store the documents. Each time a newly created or updated document cannot fit into the existing collection’s extents, a new extent is created. Each document occupies a contiguous storage area - a record - in one of the collection’s extents. Storage-viz’ experimental storageDetails command extracts information about how the disk storage is used and the web-based visualizer generates an easy-to-read graphical representation. Storage-viz also showcases which parts of the collection’s extents are currently in RAM [NOTE: the visualizer doesn’t display how much memory is available].

image

MongoDB Indexing is accomplished with Btrees. Storage-viz’ _indexStats_ command and its web-based visualizer collect and display statistics related to the tree layout.

image

Want to try it?

Download the MongoDB Nightly Build (or 2.3.1 as soon as it’s available) from here and head to the Github repository for more information on how to use Storage-viz, submit feature requests or bug reports.

Keep in mind that the new commands are resource intensive and should be considered highly experimental for the time being. We suggest running them on a non-production server on a snapshot of your datafiles.

Storage-viz was designed, coded and tested by Andrea Lattuada, one of 10gen’s Interns. It has been an invaluable and greatly rewarding experience to work closely with 10gen’s Server Engineers and write code that is now available for everyone in the MongoDB community to use.