My talk from #mongoseattle on how I've used MongoDB for real-time data collection and stats generation. Includes basic usage of increment modifiers as well as map/reduce example.
11. Other Benefits
• New field? No multi-day ALTER statement.
• Auto-sharding in 1.6
• --notablescan
• aka, don’t pull a Twitter
• “On Monday, our users database, where we store
millions of user records, got hung up running a
long-running query” -- 7/21
15. lnkby.me
‣ Problem statement:
1. Aggregate stats on shortened links
2. Top domains based on # clicks
Easy
Slightly more difficult
3. Top users driving traffic to those top
domains for the past seven days
16. Solution
• Gather stats
• Map/Reduce!
• Server-side JavaScript
• Temporary collection to hold output
• Can be written to permanent collection
• temp collection renamed atomically