Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-12100

What are the common document structures used by MongoDB for analytical models

    • Type: Icon: Question Question
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: 2.5.4
    • Component/s: Querying
    • Labels:
      None

      We are looking at 3 common possibilities for modeling star joins in a single collection to mimic OLAP / data mart models for analytics in MongoDB:

      1. Fact grain embedded in the array
      {
      "patient_id" : 123,
      "demog" :

      { "birth_dt" : ISODate(“1977-05-12”), "gender" : "F", "state" : "MI" }

      ,
      "PCP" : "Dr. John Smith",
      "claim_history" : [

      { "claim_id" : 1456, "claim_dt" : ISODate(“2009-11-19”), "Prim_Dx" : "323.9", "DRG" : 127, "net_pay_amt" : 432.12,"LOS" : 1 }

      ,

      { "claim_id" : 2456, "claim_dt" : ISODate(“2009-12-01”), "Prim_Dx" : "326.1", "DRG" : 253, "net_pay_amt" : 112.52, "LOS" : 4}

      ,

      { "claim_id" : 4456, "claim_dt" : ISODate(“2010-01-06”), "Primary_Dx" : "323.9", "DRG" : 322, "net_pay_amt" : 552.75, "LOS" : 1 }

      ]
      }

      2. Simple Array of Values (creates a M:M mapping OLAP problem)
      {
      _id : “joe”,
      age : 23,
      gpa: 3.23,
      classes : [ “BUS252”, “MUS101”, “CS220” ]
      }

      3. Array contains a collection of references to other documents. How often do you feel that we’ll see references like this?

      {
      _id : “B7XF873”
      "username" : “joeUser”,
      "Full Name" : “Joe User”,
      "Age" : 25,
      “Occupation” : “Baker”

      “Following” : [ “LLXF321”, “ADE3F44”, ... ]
      }

      Are these the most common models that you see or is there a recommendation from Mongo in building analytic models in Mongo?

            Assignee:
            Unassigned Unassigned
            Reporter:
            kromerm Mark Kromer
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: