1 more mongodb: ch 3- 8, plus a little hadoop csse 533 week 2, spring, 2015

14
1 More MongoDB: Ch 3-8, plus a little Hadoop CSSE 533 Week 2, Spring, 2015

Upload: colleen-summers

Post on 17-Dec-2015

212 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 1 More MongoDB: Ch 3- 8, plus a little Hadoop CSSE 533 Week 2, Spring, 2015

1

More MongoDB: Ch 3-8, plus a little

HadoopCSSE 533

Week 2, Spring, 2015

Page 2: 1 More MongoDB: Ch 3- 8, plus a little Hadoop CSSE 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.

Page 3: 1 More MongoDB: Ch 3- 8, plus a little Hadoop CSSE 533 Week 2, Spring, 2015

3

Ch 3 - Creating, updating and deleting documents

Inserting and saving documentsHow fast?

Removing documents

Updating documentsThe read / change / rewrite cycle

Page 4: 1 More MongoDB: Ch 3- 8, plus a little Hadoop CSSE 533 Week 2, Spring, 2015

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

Page 5: 1 More MongoDB: Ch 3- 8, plus a little Hadoop CSSE 533 Week 2, Spring, 2015

5

Ch 4 – QueryingEverything about “find”

Many criteria

Type-specific queries

Using “$where”

Cursors

Database commands

Page 6: 1 More MongoDB: Ch 3- 8, plus a little Hadoop CSSE 533 Week 2, Spring, 2015

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

Page 7: 1 More MongoDB: Ch 3- 8, plus a little Hadoop CSSE 533 Week 2, Spring, 2015

7

Ch 5 – IndexingAll the variations

Like compound indexes

Query optimization

Issues

Index types

Changing indexes?

Page 8: 1 More MongoDB: Ch 3- 8, plus a little Hadoop CSSE 533 Week 2, Spring, 2015

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

Page 9: 1 More MongoDB: Ch 3- 8, plus a little Hadoop CSSE 533 Week 2, Spring, 2015

9

Ch 6 – Special index and collection types

Capped collectionsTime-to-live indexesFull-text indexesGeospatial indexingStoring files with GridFS

Page 10: 1 More MongoDB: Ch 3- 8, plus a little Hadoop CSSE 533 Week 2, Spring, 2015

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

Page 11: 1 More MongoDB: Ch 3- 8, plus a little Hadoop CSSE 533 Week 2, Spring, 2015

11

Ch 7 – Aggregation and MapReduce

The aggregation frameworkPipeline operationsMapReduceAggregation commands

Page 12: 1 More MongoDB: Ch 3- 8, plus a little Hadoop CSSE 533 Week 2, Spring, 2015

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

Page 13: 1 More MongoDB: Ch 3- 8, plus a little Hadoop CSSE 533 Week 2, Spring, 2015

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 !

Page 14: 1 More MongoDB: Ch 3- 8, plus a little Hadoop CSSE 533 Week 2, Spring, 2015

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