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
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
13. What is Totsy?
Launched last year
Relies heavily on
organic growth
Stampede traffic
patterns - high peaks,
deep valleys
Leading player in their
market segment
14. 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
15. The Original Plan™
Use Joomla! as an application container
Use MongoDB for all non-Joomla! data
Build custom Joomla! extensions, all using MongoDB
16. “Oh yeah, we’re probably
dead in a couple weeks
without the new
platform.” :-)
20. The New Plan™
Primary need was speed and scale, of which the
previous effort was an #epicfail
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
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
23. 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
40. Development profile
Small team: 1 designer, 1 front end developer, 2
engineers and 1 contract engineer
Three months active development
41. 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
42. 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
54. What MongoDB did for me.
Encouraged extremely simple data model, producing
tighter, faster, bug-free code.
55. What MongoDB did for me.
Eliminated the need for cache.
Really. No kidding.
56. 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.
57. What MongoDB did for me.
Removed worries about a complicated hosting
environment
58. What MongoDB did for me.
Bought us a ton of time to carefully deliberate next
steps, and come out of permanent crisis mode
59. What MongoDB did for me.
Allowed us to commit every possible crime required for
survival in a frantic, frenetic startup environment
63. My shameful story
code code code commit code pray commit code code
Models had no schema defined
64. My shameful story
code code code commit code pray commit code code
Models had no schema defined
No time for optimization or performance testing
65. 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
71. Why Lithium?
Leverages the latest and greatest features and
practices found in PHP 5.3+
Extremely modular, everything in Lithium is a plugin
72. 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
73. 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...)
79. Why Lithium?
Promiscuously opinionated framework
Test harness provided
Simplified prototyping
li3_docs - Dynamic code documentation
Many other helpful plugins available and growing
81. 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.
82. 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.
83. 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.
85. What kind of scale?
We’re using multiple servers for redundancy only.
86. 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.
87. 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.