[SERVER-12100] What are the common document structures used by MongoDB for analytical models Created: 15/Dec/13  Updated: 09/Jan/14  Resolved: 09/Jan/14

Status: Closed
Project: Core Server
Component/s: Querying
Affects Version/s: 2.5.4
Fix Version/s: None

Type: Question Priority: Minor - P4
Reporter: Mark Kromer Assignee: Unassigned
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:

 Description   

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?



 Comments   
Comment by Scott Hernandez (Inactive) [ 09/Jan/14 ]

Mark, these types of questions are best asked on the mongodb-user groups (https://groups.google.com/group/mongodb-user) where the community can be involved, and it is possible that it has already been discussed. Primary this SERVER jira project is meant for filing bugs, enhancement requests and deal with code contributions (pull requests).

This sounds a bit like a guidance/consulting question and if you have a contact at mongodb, you might want to contact them directly to setup time/a-call to discuss these types of broad questions.

Generated at Thu Feb 08 03:27:36 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.