Upload
colleen-summers
View
212
Download
0
Embed Size (px)
Citation preview
1
More MongoDB: Ch 3-8, plus a little
HadoopCSSE 533
Week 2, Spring, 2015
2
Topics this weekMongoDB – continued:
Ch 3 - Creating, updating and deleting documentsCh 4 – QueryingCh 5 – IndexingCh 6 – Special index and collection typesCh 7 – Aggregation and MapReduceCh 8 – Application design
Intro to Hadoop (from Data Science book)See the reading on Moodle.
3
Ch 3 - Creating, updating and deleting documents
Inserting and saving documentsHow fast?
Removing documents
Updating documentsThe read / change / rewrite cycle
4
Ch 3 – Pages to look at P 31 – bottom : You can time how fast things operate.
Just define a function with time capture before and after what you are doing.
Pp 31 – 40: You can read and replace whole documents, or not.
P 34: Can also modify, like incrementing counters.
P 37: “$inc” is similar to “$set,” but is designed for incrementing (and decrementing) numbers…
There are special conditions and cautions on every one of these features!
P 41: “Array manipulation becomes a little trickier when we have multiple values in an array and want to modify some of them…”
Ditto
Which brings up my idea of your doing some rather loosely defined homework to gain confidence in using all these commands, etc.
P 47: Updating multiple documents
P 50: Setting a write concern
5
Ch 4 – QueryingEverything about “find”
Many criteria
Type-specific queries
Using “$where”
Cursors
Database commands
6
Ch 4 – Pages to look atP 57: Conditional semantics
P 58: Null behavior
P 61: $slice operator
P 65: $where queries
P 66: Security issues
P 67: Cursors
P 73: The warning about “Getting consistent results”!
P 75: Database commands
7
Ch 5 – IndexingAll the variations
Like compound indexes
Query optimization
Issues
Index types
Changing indexes?
8
Ch 5 – Pages to look atFirst chapter in “Designing your application.”
Pp 81-4: Basically, indexes are like in RDBMS’s. Friend to reads, enemies to writes.
P 91: Cautions about efficiency of compound indexes.
P 98: Using explain() and hint()
P 102: The query optimizer
P 102: When not to index
9
Ch 6 – Special index and collection types
Capped collectionsTime-to-live indexesFull-text indexesGeospatial indexingStoring files with GridFS
10
Ch 6 – Pages to look atP 109: Capped collections – like for logs
P 113: Tailable cursors – run on new data!
P 115: Full-text indexes – look dangerous
11
Ch 7 – Aggregation and MapReduce
The aggregation frameworkPipeline operationsMapReduceAggregation commands
12
Ch 7 – Pages to look atP 127: The aggregation framework
P 129: Pipeline operations
P 134: A projection example
P 141: Example 1
P 143: Example 2
P 150: Using a finalizer
13
Ch 8 – Application designNormalization vs denormalization
Optimization for data manipulation
Planning out databases and collections
Managing consistency
Migrating schemas
When not to use MongoDB !
14
Ch 8 – Pages to look atP 153: How much to normalize?
P 157: Cardinality
P 158: Friends, followers, and other inconveniences
P 159: Wil Wheaton!
P 160: Optimizations
P 165: When not to use MongoDB