140 likes | 575 Views
More MongoDB : Ch 3-8, plus a little Hadoop. CSSE 533 Week 2, Spring, 2015. Topics this week. MongoDB – continued: Ch 3 - Creating, updating and deleting documents Ch 4 – Querying Ch 5 – Indexing Ch 6 – Special index and collection types Ch 7 – Aggregation and MapReduce
E N D
More MongoDB: Ch 3-8, plus a little Hadoop CSSE 533 Week 2, Spring, 2015
Topics this week • MongoDB – continued: • Ch 3 - Creating, updating and deleting documents • Ch 4 – Querying • Ch 5 – Indexing • Ch 6 – Special index and collection types • Ch 7 – Aggregation and MapReduce • Ch 8 – Application design • Intro to Hadoop (from Data Science book) • See the reading on Moodle.
Ch 3 - Creating, updating and deleting documents • Inserting and saving documents • How fast? • Removing documents • Updating documents • The read / change / rewrite cycle
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
Ch 4 – Querying • Everything about “find” • Many criteria • Type-specific queries • Using “$where” • Cursors • Database commands
Ch 4 – Pages to look at • P 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
Ch 5 – Indexing • All the variations • Like compound indexes • Query optimization • Issues • Index types • Changing indexes?
Ch 5 – Pages to look at • First 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
Ch 6 – Special index and collection types • Capped collections • Time-to-live indexes • Full-text indexes • Geospatial indexing • Storing files with GridFS
Ch 6 – Pages to look at • P 109: Capped collections – like for logs • P 113: Tailable cursors – run on new data! • P 115: Full-text indexes – look dangerous
Ch 7 – Aggregation and MapReduce • The aggregation framework • Pipeline operations • MapReduce • Aggregation commands
Ch 7 – Pages to look at • P 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
Ch 8 – Application design • Normalization vsdenormalization • Optimization for data manipulation • Planning out databases and collections • Managing consistency • Migrating schemas • When not to use MongoDB !
Ch 8 – Pages to look at • P 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