MongoDB: Difference between revisions
From charlesreid1
No edit summary |
No edit summary |
||
| Line 8: | Line 8: | ||
http://docs.mongodb.org/ecosystem/tutorial/write-a-tumblelog-application-with-flask-mongoengine/ | http://docs.mongodb.org/ecosystem/tutorial/write-a-tumblelog-application-with-flask-mongoengine/ | ||
=MongoDB Design Patterns= | |||
So far, one of the more useful design patterns I've come up with for MongoDB tables is to always implement tables in pairs: one table to hold data, one table to hold metadata. This allows you to optimize for storage by using shorter keys, numerical codes, etc., but also store the "full name" for that information. | |||
So the data table might contain columns named B150020221, B150020222, etc., with unique values for each row; and the metadata table would contain a list of strings, i.e., B150020221 = "mean of variable 1", B150020222 = "variance of variable 1", etc. | |||
Revision as of 18:47, 15 March 2015
Getting Started
Install
Was able to install this ok with Homebrew http://docs.mongodb.org/manual/tutorial/install-mongodb-on-os-x/
First Project with Python and MongoDB
http://docs.mongodb.org/ecosystem/tutorial/write-a-tumblelog-application-with-flask-mongoengine/
MongoDB Design Patterns
So far, one of the more useful design patterns I've come up with for MongoDB tables is to always implement tables in pairs: one table to hold data, one table to hold metadata. This allows you to optimize for storage by using shorter keys, numerical codes, etc., but also store the "full name" for that information.
So the data table might contain columns named B150020221, B150020222, etc., with unique values for each row; and the metadata table would contain a list of strings, i.e., B150020221 = "mean of variable 1", B150020222 = "variance of variable 1", etc.