Top 10 mobile apps in new york city presentation-relational international-
Upcoming SlideShare
Loading in...5

Like this? Share it with your network


Top 10 mobile apps in new york city presentation-relational international-



Our pick for the best high tech employer in New York in the under 50 employee category in the month of January 2014. Technology includes Android iOS mobile Redis MongoDB Python Objective-C JAVA ...

Our pick for the best high tech employer in New York in the under 50 employee category in the month of January 2014. Technology includes Android iOS mobile Redis MongoDB Python Objective-C JAVA Javascript AWS High Volume B - C environment. Great approachable management. Creative and VERY fast-paced. Good benefits. Contact Greg Hutchinson (212) 470-8005



Total Views
Views on SlideShare
Embed Views



6 Embeds 1,369 917 444 3 2 2 1


Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
Post Comment
Edit your comment
  • Expanded social features—commenting, liking, reporting, admin tools, more in future <br /> People can buy unlimited cards—card store with in app currency, packs of random cards—have to buy a lot of packs to get cards you <br /> Change in game play— start/sit with so many cards <br />
  • Cards Home: My Cards, Start-Sit Trading Trade Talk Buy Pack <br /> Live game loop <br /> Leaderboards <br /> Card buying <br />
  • MySQL is needed to store data from the feed provider <br /> Heartbeats read that data and store them in MongoDB <br />
  • More detail later <br />
  • Real-time <br /> Done when user makes a call <br /> more later <br />
  • When a player hits a home run, fan needs to get points asap <br /> Human at feed company enters event data <br /> Data gets pushed to the feed and goes to the MySQL db <br />
  • David Ortiz hit a HR in Game 2 of the WS <br />
  • Gets 36 pts for the HR <br /> New box score is XXX <br /> set the box score, increment the season points and game points <br /> One step <br />
  • Redis is an all-RAM key-value data store <br />
  • Since redis stores the user IDs and scores in sorted sets, all the ranking is kept up to date whenever it is updated. <br />
  • When special cards were released into packs, people bought a lot, increasing their cards and creating new profile documents—TIMEOUTS <br /> If this is happening with many users, everything slows down <br />
  • All of this is to support trading <br />

Top 10 mobile apps in new york city presentation-relational international- Presentation Transcript

  • 1. One of the Top 10 Mobile Apps A MongoDB Ready Partner in New York City
  • 2. Digital Collectible Card Platform Three apps that run on the same system so far… MLB NFL Collectible Card Games BPL
  • 3. Yes, Trading Cards!
  • 4. The New Collectible Card sales info Live stats and game info Online trading
  • 5. Brief History of MLB • 2012: Introduced product on MySQL • • • Revenue model fine-tuned Thought of new features and scaling considerations Migrate to MongoDB for MLB 2013 opening day • Learn MongoDB • Re-design the schema • Write & Run migration scripts • Total: 4-5 months, 1-2 people
  • 6. • Product Demo • System Overview • Specific example of why MongoDB • One case where another database technology is used with MongoDB • Scalability issue and resolution
  • 7. Product Demo
  • 8. System Overview
  • 9. Server Technologies • MongoDB • MySQL • Redis • Python • AWS • External data feed
  • 10. MongoDB Basic Structure
  • 11. Simple View of Server Architecture
  • 12. Big Piece 1: Processing Live Data • • • Live data is received and stored into MySQL A heartbeat picks up the event and stores player stats into MongoDB It then pulls from MongoDB and updates leaderboard data in Redis
  • 13. Big Piece 2: Formatting Leaderboards for Users • • API servers combine fan data from MongoDB with points data from Redis The result is a richly-detailed set of leaderboards
  • 14. All other processes • • All other processes are handled by the API servers and MongoDB • Sign in, Trading, Commenting, Content Management, Purchases, Playing Cards Storage is used for fan and player photos as well as other simple files
  • 15. Big Piece 1 Specific reason we chose MongoDB Processing Live Game Data in Realtime
  • 16. Realtime Live Game Updates • Game play requires up-to-the-minute stats from live events for user scoring • These data are stored in JSON format for the app • The JSON data has to be updated frequently with stats and player points • Support multiple live games for multiple apps on the same platform
  • 17. Old Way: Processing Live Game Data with MySQL
  • 18. New Way: With MongoDB, we can simply update the JSON data in the player’s document db.players.update( { _id: ObjectId(“52be0717978ca03fc1984069"), ‘games.g':'2013-e.39141 }, { $set:{ 'games.$.b': "1-for-2: Ground out, Walk, Home run" }, $inc:{ 'points': 36 } } )
  • 19. In general, the system with MongoDB is much simpler, faster, more scalable
  • 20. Where we use Redis with MongoDB Leaderboards
  • 21. Building User Leaderboards • Leaderboards updated in realtime • 96 leaderboards in MLB • Final output is constructed on-demand, no cache • User scores are stored in sorted sets in Redis (ranking is automatic) • Redis is an in-RAM key-value data store
  • 22. Leaderboard Process
  • 23. Scaling issue and resolution
  • 24. Scaling Example: Buying Packs of Cards • In order to support complex trading algorithms, each user profile needs to contain a reference to the owner’s card collection
  • 25. Initial Structure of User Profile with Embedded Card Summary Documents • Profile contains an embedded document of card summaries • When users buy cards, the profile can grow out of its allocated space • MongoDB creates a new, bigger allocation for the user profile
  • 26. Profiles were refactored to include only player IDs • Finite number of players in the system, so size of player IDs list is limited
  • 27. Basic Metrics • On average, 1 pack sold per second • Consistently top 10 grossing sports app • Up to 30,000 requests per minute • Up to 2,000 OPS
  • 28. Conclusions • MongoDB great for apps, especially social • JSON-ready data • Normal NoSQL arguments • For realtime leaderboards, Redis provides simple and fast “automatic sorting” of user scores • Don’t embed documents if you hope for them to grow • Easy to learn
  • 29. Were Hiring! Greg Hutchinson (212) 470-8005 MongoDB+Py, Web, iOS, Android, App Producer, Project Management, QA