NERSCPowering Scientific Discovery Since 1974

MongoDB

Description and Overview

MongoDB is a cross-platform document-oriented database. Classified as a NoSQL database, MongoDB eschews the traditional table-based relational database structure in favor of JSON-like documents with dynamic schemas, making the integration of data in certain types of applications easier and faster.

NERSC provides a set of MongoDB nodes for users that wish to use MongoDB with their scientific applications.

How to Use MongoDB

The MongoDB command line client is available at NERSC on Cori, and Edison, and can be used to directly connect to mongodb via the command line. There are also language specific client drivers.

Requesting a Mongo Database

Users can request a MongoDB database for their project using this form.

Here are some considerations for when to use MongoDB as your scientific datastore. MongoDB is suitable for use cases where

  • Your data model and schema are evolving rapidly
  • You need a simple query interface to access the data i.e. you would like to interact with JSON objects directly
  • Your data is mostly non-relational - i.e. you data exists in self contained objects with minimal cross linking between objects

The MongoDB setup at NERSC may not be ideal in cases where

  • You need to do high volume transactional data writes. We can handle bulk loads and a small volume of writes at a time, but our current setup is not optimized for heavy write volumes
  • Your data model is heavily relational (lots of JOINs across data tables).

 

      Use the mongodb client

If you wish to directly access MongoDB via the command line, you can use the Mongo JavaScript shell. On a NERSC system, type the following commands to use Mongo:

% module load mongodb
% mongo mongodb01.nersc.gov/yourdb -u dbuser -p
MongoDB shell version: 2.6.4
Enter password:

Replace yourdb and dbuser with the name of the mongodb database and user provided to you by NERSC.
You may need to replace mongodb01 with mongodb03 if you are going to the development host.

Use pymongo

Mongo DB can also be invoked directly from within your code using the language specific client API. Here we show you how to use the pymongo client for Anaconda Python

% module load python

To access MongoDB through your python code

#!/usr/bin/env python

import pymongo

p = pymongo....

 

Documentation

Extensive on-line documentation is available.  For questions about MongoDB at NERSC, please contact consult@nersc.gov.

Availability

PackagePlatformCategoryVersionModuleInstall DateDate Made Default
MongoDB cori applications/ programming 2.6.11 mongodb/2.6.11 2015-09-28 2016-07-08
MongoDB cori applications/ programming 3.2.11 mongodb/3.2.11 2016-11-22 2017-01-19
MongoDB datatran applications/ programming 2.2.4 mongodb/2.2.4 2014-10-13
MongoDB datatran applications/ programming 2.6.4 mongodb/2.6.4 2014-10-13 2014-10-13
mongodb genepool applications/ general 2.4.4 mongodb/2.4.4 2013-06-26 2013-06-26
mongodb genepool applications/ general 3.0.4 mongodb/3.0.4 2015-06-30
mongodb genepool applications/ general 3.2.10 mongodb/3.2.10 2016-10-05
mongodb genepool applications/ general 3.4.6 mongodb/3.4.6 2017-07-18
mongodb genepool_sl6 applications/ general 2.4.4 mongodb/2.4.4 2015-03-19 2015-03-19
mongodb genepool_sl6 applications/ general 3.2.6 mongodb/3.2.6 2016-04-28
mongodb genepool_sl6 applications/ general 3.4.6 mongodb/3.4.6 2017-07-18
mongodb genepool_sl72 applications/ general 3.4.6 mongodb/3.4.6 2017-10-27
MongoDB pdsf_sl6 applications/ programming 3.0.4 mongodb/3.0.4 2016-07-01
mongodb phoebe applications/ general 2.4.4 mongodb/2.4.4 2013-06-26 2013-06-26
MongoDB scigate applications/ programming 2.2.4 mongodb/2.2.4 2014-10-13
MongoDB scigate applications/ programming 2.6.4 mongodb/2.6.4 2014-10-13 2014-10-13