Mongodb and Totsy - E-commerce Case Study

  • 4,375 views
Uploaded on

Deck from MongoChicago, providing a case study on the implementation of the totsy.com website using MongoDB and the Lithium framework. …

Deck from MongoChicago, providing a case study on the implementation of the totsy.com website using MongoDB and the Lithium framework.

There's a video you can watch of the same presentation from the Mongo Boston event which happened one month earlier:

http://www.10gen.com/video/mongoboston2010/totsy

More in: Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
No Downloads

Views

Total Views
4,375
On Slideshare
0
From Embeds
0
Number of Embeds
0

Actions

Shares
Downloads
0
Comments
1
Likes
10

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide
















































































Transcript

  • 1. MongoDB E-Commerce Case Study: Totsy Mitch Pirtle MongoChicago - October 20, 2010 Chicago, IL
  • 2. About this session
  • 3. About the speaker New Yorker Contributor to many FOSS projects (Joomla! founder) Budding author MongoDB for Web Development Extreme Joomla! Performance High-traffic projects (Jetsetter, MTV, Food Networks) Husband, dad, skate punk, metalcore bassist, coach
  • 4. About the team
  • 5. What is MongoDB?
  • 6. What is MongoDB? Document database
  • 7. What is MongoDB? Document database Wicked fast speed
  • 8. What is MongoDB? Document database Wicked fast speed Great for scale
  • 9. What is MongoDB? Document database Wicked fast speed Great for scale Low administration requirements
  • 10. What is MongoDB? Document database Wicked fast speed Great for scale Low administration requirements Encourages simple code, fewer bugs
  • 11. www.totsy.com Private sale website catering to parents with small kids
  • 12. What is Totsy? Launched last year Relies heavily on organic growth Stampede traffic patterns - high peaks, deep valleys Leading player in their market segment
  • 13. The challenge Get out of initial outsourced platform Didn’t scale Didn’t perform Didn’t work Brittle, difficult to manage or enhance Essentially a case study on how not to use RoR, PostgreSQL and Heroku
  • 14. The Original Plan™ Use Joomla! as an application container Use MongoDB for all non-Joomla! data Build custom Joomla! extensions, all using MongoDB
  • 15. “Oh yeah, we’re probably dead in a couple weeks without the new platform.” :-)
  • 16. Hey, wait a minute.
  • 17. How about a framework? One layer lower, with much less overhead, and only using what we wanted and nothing more...
  • 18. The New Plan™
  • 19. The New Plan™ Primary need was speed and scale, of which the previous effort was an #epicfail
  • 20. The New Plan™ Primary need was speed and scale, of which the previous effort was an #epicfail Tap into existing personal network of PHP talent
  • 21. The New Plan™ Primary need was speed and scale, of which the previous effort was an #epicfail Tap into existing personal network of PHP talent Leverage relationship with MongoDB and Lithium projects
  • 22. The New Plan™ Primary need was speed and scale, of which the previous effort was an #epicfail Tap into existing personal network of PHP talent Leverage relationship with MongoDB and Lithium projects Fully showcase MongoDB, and finally have a site with no relational engines needed
  • 23. Yippy skippy.
  • 24. Yes, I really said that.
  • 25. What was expected
  • 26. What was expected Rapid development
  • 27. What was expected Rapid development Fast execution of code
  • 28. What was expected Rapid development Fast execution of code Spartan hosting requirements
  • 29. The Result
  • 30. The Result Extremely rapid development
  • 31. The Result Extremely rapid development Extremely speed
  • 32. The Result Extremely rapid development Extremely speed Extremely minimal hosting requirements
  • 33. The Result Extremely rapid development Extremely speed Extremely minimal hosting requirements K.I.S.S. and all the goodness that entails
  • 34. Development profile
  • 35. Development profile Small team: 1 designer, 1 front end developer, 2 engineers and 1 contract engineer
  • 36. Development profile Small team: 1 designer, 1 front end developer, 2 engineers and 1 contract engineer Three months active development
  • 37. Development profile Small team: 1 designer, 1 front end developer, 2 engineers and 1 contract engineer Three months active development Redmine + Git for project management + version control
  • 38. Development profile Small team: 1 designer, 1 front end developer, 2 engineers and 1 contract engineer Three months active development Redmine + Git for project management + version control Local, Development, Test, Production environments
  • 39. Stack profile
  • 40. Stack profile PHP: fast execution, quick prototyping
  • 41. Stack profile PHP: fast execution, quick prototyping Lithium: PHP 5.3+ RAD framework
  • 42. Stack profile PHP: fast execution, quick prototyping Lithium: PHP 5.3+ RAD framework MongoDB: whack-daddy database from tomorrow
  • 43. Stack profile PHP: fast execution, quick prototyping Lithium: PHP 5.3+ RAD framework MongoDB: whack-daddy database from tomorrow LightTPD: fcgi lightweight webserver
  • 44. Stack profile PHP: fast execution, quick prototyping Lithium: PHP 5.3+ RAD framework MongoDB: whack-daddy database from tomorrow LightTPD: fcgi lightweight webserver Xcache: PHP opcode cache
  • 45. Stack profile PHP: fast execution, quick prototyping Lithium: PHP 5.3+ RAD framework MongoDB: whack-daddy database from tomorrow LightTPD: fcgi lightweight webserver Xcache: PHP opcode cache Linux: defacto standard operating system in datacenters
  • 46. Atomic Operations with MongoDB
  • 47. Your relational data Whoah Nelly! Good reason for a DBA Many foreign keys Need for triggers, stored procedures, cronjobs...
  • 48. With a side of MongoDB K.I.S.S. Simple to manage Simple to access Little or no need for foreign constraints
  • 49. What MongoDB did for me.
  • 50. What MongoDB did for me. Encouraged extremely simple data model, producing tighter, faster, bug-free code.
  • 51. What MongoDB did for me. Eliminated the need for cache. Really. No kidding.
  • 52. What MongoDB did for me. Used GridFS for all file storage. Lithium happily provided a media adapter allowing us to create a GridFS plugin to transparently store files in the database.
  • 53. What MongoDB did for me. Removed worries about a complicated hosting environment
  • 54. What MongoDB did for me. Bought us a ton of time to carefully deliberate next steps, and come out of permanent crisis mode
  • 55. What MongoDB did for me. Allowed us to commit every possible crime required for survival in a frantic, frenetic startup environment
  • 56. Crimes? What crimes?
  • 57. My shameful story
  • 58. My shameful story code code code commit code pray commit code code
  • 59. My shameful story code code code commit code pray commit code code Models had no schema defined
  • 60. My shameful story code code code commit code pray commit code code Models had no schema defined No time for optimization or performance testing
  • 61. My shameful story code code code commit code pray commit code code Models had no schema defined No time for optimization or performance testing Not a single line of code was run through a harness
  • 62. So what is Lithium?
  • 63. Lithium PHP framework http://lithify.me http://rad-dev.org/lithium/wiki Projects demonstrating MongoDB support: http://rad-dev.org/lithium_mongo/source http://rad-dev.org/lithium_blog/source
  • 64. Why Lithium?
  • 65. Why Lithium? Leverages the latest and greatest features and practices found in PHP 5.3+
  • 66. Why Lithium? Leverages the latest and greatest features and practices found in PHP 5.3+ Extremely modular, everything in Lithium is a plugin
  • 67. Why Lithium? Leverages the latest and greatest features and practices found in PHP 5.3+ Extremely modular, everything in Lithium is a plugin Native hooks into MongoDB and other non-relational databases
  • 68. Why Lithium? Leverages the latest and greatest features and practices found in PHP 5.3+ Extremely modular, everything in Lithium is a plugin Native hooks into MongoDB and other non-relational databases Simple hooks for additional customization (GridFS...)
  • 69. Why Lithium?
  • 70. Why Lithium? Promiscuously opinionated framework
  • 71. Why Lithium? Promiscuously opinionated framework Test harness provided
  • 72. Why Lithium? Promiscuously opinionated framework Test harness provided Simplified prototyping
  • 73. Why Lithium? Promiscuously opinionated framework Test harness provided Simplified prototyping li3_docs - Dynamic code documentation
  • 74. Why Lithium? Promiscuously opinionated framework Test harness provided Simplified prototyping li3_docs - Dynamic code documentation Many other helpful plugins available and growing
  • 75. What kind of speed?
  • 76. What kind of speed? One evening right when a bunch of major sales launched, I saw 1,700+ operations per second on the MongoDB master server.
  • 77. What kind of speed? One evening right when a bunch of major sales launched, I saw 1,700+ operations per second on the MongoDB master server. This server had a load of 0.68.
  • 78. What kind of speed? One evening right when a bunch of major sales launched, I saw 1,700+ operations per second on the MongoDB master server. This server had a load of 0.68. This translates to 17% capacity on a four core machine.
  • 79. What kind of scale?
  • 80. What kind of scale? We’re using multiple servers for redundancy only.
  • 81. What kind of scale? We’re using multiple servers for redundancy only. When we need to add servers, the effort will be greatly simplified by having sharding already provided.
  • 82. What kind of scale? We’re using multiple servers for redundancy only. When we need to add servers, the effort will be greatly simplified by having sharding already provided. Probably could have launched on this laptop with identical performance.
  • 83. A quick note on single server durability.
  • 84. </rant>
  • 85. Questions and Excuses
  • 86. Thanks! Email: spacemonkey@mongodb.org Twitter: @mitchitized Web: http://www.mitchitized.com/ Slides: http://www.slideshare.net/ spacemonkeylabs