Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

These are examples of getting data over HTTPS from a batch node from within cori; needless to say, the URL prefix is https://pswww-dev.slac.stanford.edu/calib_ws

Two users:

  • mongo --host=psdb-dev --port 9306 -u "dubrovin" -p "...." --authenticationDatabase "admin"
  • mongo --host=psdb-dev --port 9306 -u "calibuser" -p "...." --authenticationDatabase "admin"

Test commands:

  • curl -s "https://pswww-dev.slac.stanford.edu/calib_ws/test_db/test_coll/5b649a9df59ae00bda110168"
  • curl -s "https://pswww-dev.slac.stanford.edu/calib_ws/test_db/test_coll"
  • curl -s "https://pswww-dev.slac.stanford.edu/calib_ws/test_db/test_coll?item=planner&size.uom=cm"
  • curl -s "https://pswww-dev.slac.stanford.edu/calib_ws/test_db/test_coll?query_string=%7B%20%22item%22%3A%20%22planner%22%2C%20%22qty%22%3A%2075%20%7D%0A"

Summary

  • MongoDB structure has limitations in number of levels and document size.
    • server may have many DBs
    • DB is a container for collections
    • collection is a group of documents
    • document is a JSON/BSON object of key:value pairs (dictionary). Each value may be dictionary itself etc, but further structure levels are not supported by DB structure.
      • document size has hardwired limit 16MB (in 2010 increased from 4 to 16MB and devs do not want to change it). CSPAD 2Mpix*8byte(double) = 16MB, but we may expect larger detectors like Jungfrau, Epix, Andor, etc.
      • Larger data size is suggested to save using GridFS; split data for chanks and save chunks in the same DB in different collections.
      • JSON (text) object in MongoDB is presented in unicode...(UTF-8).  Data should be converted to unicode force and back in saving retrieving.
  • schema-less DB looks interesting to certain extents, but in order to find something in DB there should be a schema...
  • GridFS works fine with document size>16GB.

...