SlideShare a Scribd company logo
MongoDB E-Commerce
Case Study: Totsy
Mitch Pirtle
MongoChicago - October 20, 2010
Chicago, IL
About this session
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
Mongodb and Totsy - E-commerce Case Study
About the team
What is MongoDB?
What is MongoDB?

Document database
What is MongoDB?

Document database
Wicked fast speed
What is MongoDB?

Document database
Wicked fast speed
Great for scale
What is MongoDB?

Document database
Wicked fast speed
Great for scale
Low administration requirements
What is MongoDB?

Document database
Wicked fast speed
Great for scale
Low administration requirements
Encourages simple code, fewer bugs
www.totsy.com
Private sale website catering to parents with
small kids
What is Totsy?
Launched last year
Relies heavily on
organic growth
Stampede traffic
patterns - high peaks,
deep valleys
Leading player in their
market segment
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
The Original Plan™


Use Joomla! as an application container
Use MongoDB for all non-Joomla! data
Build custom Joomla! extensions, all using MongoDB
“Oh yeah, we’re probably
dead in a couple weeks
without the new
platform.” :-)
Hey, wait a minute.
How about a framework?
One layer lower, with much less overhead, and
only using what we wanted and nothing more...
The New Plan™
The New Plan™

Primary need was speed and scale, of which the
previous effort was an #epicfail
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
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
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
Yippy skippy.
Yes, I really said that.
Mongodb and Totsy - E-commerce Case Study
Mongodb and Totsy - E-commerce Case Study
What was expected
What was expected


Rapid development
What was expected


Rapid development
Fast execution of code
What was expected


Rapid development
Fast execution of code
Spartan hosting requirements
The Result
The Result

Extremely rapid development
The Result

Extremely rapid development
Extremely speed
The Result

Extremely rapid development
Extremely speed
Extremely minimal hosting requirements
The Result

Extremely rapid development
Extremely speed
Extremely minimal hosting requirements
K.I.S.S. and all the goodness that entails
Mongodb and Totsy - E-commerce Case Study
Development profile
Development profile

Small team: 1 designer, 1 front end developer, 2
engineers and 1 contract engineer
Development profile

Small team: 1 designer, 1 front end developer, 2
engineers and 1 contract engineer
Three months active development
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
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
Stack profile
Stack profile
 PHP: fast execution, quick prototyping
Stack profile
 PHP: fast execution, quick prototyping
 Lithium: PHP 5.3+ RAD framework
Stack profile
 PHP: fast execution, quick prototyping
 Lithium: PHP 5.3+ RAD framework
 MongoDB: whack-daddy database from tomorrow
Stack profile
 PHP: fast execution, quick prototyping
 Lithium: PHP 5.3+ RAD framework
 MongoDB: whack-daddy database from tomorrow
 LightTPD: fcgi lightweight webserver
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
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
Atomic Operations with
MongoDB
Your relational data

 Whoah Nelly!
 Good reason for a DBA
 Many foreign keys
 Need for triggers,
 stored procedures,
 cronjobs...
With a side of MongoDB

K.I.S.S.
Simple to manage
Simple to access
Little or no need for
foreign constraints
What MongoDB did for me.
What MongoDB did for me.



Encouraged extremely simple data model, producing
tighter, faster, bug-free code.
What MongoDB did for me.


Eliminated the need for cache.
Really. No kidding.
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.
What MongoDB did for me.



Removed worries about a complicated hosting
environment
What MongoDB did for me.



Bought us a ton of time to carefully deliberate next
steps, and come out of permanent crisis mode
What MongoDB did for me.



Allowed us to commit every possible crime required for
survival in a frantic, frenetic startup environment
Crimes? What crimes?
My shameful story
My shameful story

code code code commit code pray commit code code
My shameful story

code code code commit code pray commit code code
Models had no schema defined
My shameful story

code code code commit code pray commit code code
Models had no schema defined
No time for optimization or performance testing
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
Mongodb and Totsy - E-commerce Case Study
So what is Lithium?
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
Why Lithium?
Why Lithium?

Leverages the latest and greatest features and
practices found in PHP 5.3+
Why Lithium?

Leverages the latest and greatest features and
practices found in PHP 5.3+
Extremely modular, everything in Lithium is a plugin
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
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...)
Why Lithium?
Why Lithium?

Promiscuously opinionated framework
Why Lithium?

Promiscuously opinionated framework
Test harness provided
Why Lithium?

Promiscuously opinionated framework
Test harness provided
Simplified prototyping
Why Lithium?

Promiscuously opinionated framework
Test harness provided
Simplified prototyping
li3_docs - Dynamic code documentation
Why Lithium?

Promiscuously opinionated framework
Test harness provided
Simplified prototyping
li3_docs - Dynamic code documentation
Many other helpful plugins available and growing
What kind of speed?
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.
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.
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.
What kind of scale?
What kind of scale?

We’re using multiple servers for redundancy only.
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.
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.
A quick note on single
server durability.
</rant>
Questions and Excuses
Thanks!
Email: spacemonkey@mongodb.org
Twitter: @mitchitized
Web: http://www.mitchitized.com/
Slides: http://www.slideshare.net/
spacemonkeylabs

More Related Content

KEY
MongoDB, E-commerce and Transactions
KEY
MongoDB and Ecommerce : A perfect combination
KEY
Blending MongoDB and RDBMS for ecommerce
KEY
Augmenting RDBMS with MongoDB for ecommerce
PDF
Chris Lea - What does NoSQL Mean for You
KEY
Profiling php applications
KEY
Big data for the rest of us
PDF
Introduction to MongoDB and Ruby
MongoDB, E-commerce and Transactions
MongoDB and Ecommerce : A perfect combination
Blending MongoDB and RDBMS for ecommerce
Augmenting RDBMS with MongoDB for ecommerce
Chris Lea - What does NoSQL Mean for You
Profiling php applications
Big data for the rest of us
Introduction to MongoDB and Ruby

What's hot (20)

KEY
Blazing Data With Redis (and LEGOS!)
PPTX
Go from a PHP Perspective
PPTX
PDF
Tech 802: Data, Databases & XML
PDF
Solr rug
PDF
My Sql And Search At Craigslist
KEY
2011 03-31 Riak Stockholm Meetup
PDF
Nllug 2010-web-services
KEY
NoSQL @ Qbranch -2010-04-15
PPTX
HTML Training Course in Persian
PDF
Code for Startup MVP (Ruby on Rails) Session 1
KEY
Message:Passing - lpw 2012
KEY
Battle of NoSQL stars: Amazon's SDB vs MongoDB vs CouchDB vs RavenDB
PPTX
Day 7 - Make it Fast
PDF
CBOR - The Better JSON
PDF
What Drove Wordnik Non-Relational?
PDF
Introduction to Web Standards
PDF
ruby pentest
PDF
How a Small Team Scales Instagram
PDF
XML and Web Services with Groovy
Blazing Data With Redis (and LEGOS!)
Go from a PHP Perspective
Tech 802: Data, Databases & XML
Solr rug
My Sql And Search At Craigslist
2011 03-31 Riak Stockholm Meetup
Nllug 2010-web-services
NoSQL @ Qbranch -2010-04-15
HTML Training Course in Persian
Code for Startup MVP (Ruby on Rails) Session 1
Message:Passing - lpw 2012
Battle of NoSQL stars: Amazon's SDB vs MongoDB vs CouchDB vs RavenDB
Day 7 - Make it Fast
CBOR - The Better JSON
What Drove Wordnik Non-Relational?
Introduction to Web Standards
ruby pentest
How a Small Team Scales Instagram
XML and Web Services with Groovy
Ad

Viewers also liked (20)

PPTX
Apresentação 67Company
PDF
UNIFIED PRODUCT and SERVICE
PDF
pen plastic promotion
PDF
No vamos a overcom todo el bush
PPTX
Cach hen ho voi phu nu
ODP
2 Timoteut 2 - Pjesemarres dhe spektatore
PDF
tcc logo
PPT
Division
PDF
Hyfass-Letter (4)
PPT
Screening očí
PDF
Considering self employment | business start up coaching 2016
PPTX
Presentation1
PPTX
Polish beer (r)evolution
PPTX
67 Company
PDF
SIG Journal article
PPTX
Farmhouse US Presentation
PDF
Grow your business club - about us
PDF
A-Z of Millennials in the Middle East
PPTX
SYTYCB: Introduction to Guinness
Apresentação 67Company
UNIFIED PRODUCT and SERVICE
pen plastic promotion
No vamos a overcom todo el bush
Cach hen ho voi phu nu
2 Timoteut 2 - Pjesemarres dhe spektatore
tcc logo
Division
Hyfass-Letter (4)
Screening očí
Considering self employment | business start up coaching 2016
Presentation1
Polish beer (r)evolution
67 Company
SIG Journal article
Farmhouse US Presentation
Grow your business club - about us
A-Z of Millennials in the Middle East
SYTYCB: Introduction to Guinness
Ad

Similar to Mongodb and Totsy - E-commerce Case Study (20)

KEY
PHP, Lithium and MongoDB
PPTX
An Evening with MongoDB Detroit 2013
PDF
Lean and mean MongoDB
PDF
Enabling Telco to Build and Run Modern Applications
PDF
Mongodb, Node.js and You: PART I
PDF
MongoDB: Agile Combustion Engine
PDF
ASAS 2015 - Norberto Leite
PPTX
Accelerating a Path to Digital with a Cloud Data Strategy
PPTX
When to Use MongoDB
PPTX
Webinar: When to Use MongoDB
PPTX
La nuova architettura di classe enterprise
PDF
Rails with MongoDB
KEY
Mongo Seattle - The Business of MongoDB
PPTX
Everything You Need to Know About MongoDB Development.pptx
KEY
Mongo NYC PHP Development
PPTX
MongoDB Evenings Minneapolis: MongoDB is Cool But When Should I Use It?
PDF
Silicon Valley Code Camp 2015 - Advanced MongoDB - The Sequel
KEY
Hybrid MongoDB and RDBMS Applications
PDF
Open source Technology
KEY
Austin NoSQL 2011-07-06
PHP, Lithium and MongoDB
An Evening with MongoDB Detroit 2013
Lean and mean MongoDB
Enabling Telco to Build and Run Modern Applications
Mongodb, Node.js and You: PART I
MongoDB: Agile Combustion Engine
ASAS 2015 - Norberto Leite
Accelerating a Path to Digital with a Cloud Data Strategy
When to Use MongoDB
Webinar: When to Use MongoDB
La nuova architettura di classe enterprise
Rails with MongoDB
Mongo Seattle - The Business of MongoDB
Everything You Need to Know About MongoDB Development.pptx
Mongo NYC PHP Development
MongoDB Evenings Minneapolis: MongoDB is Cool But When Should I Use It?
Silicon Valley Code Camp 2015 - Advanced MongoDB - The Sequel
Hybrid MongoDB and RDBMS Applications
Open source Technology
Austin NoSQL 2011-07-06

More from Mitch Pirtle (20)

PDF
Cloudy with a chance of scale
PDF
My life with MongoDB
PDF
PHP Cloud Deployment Toolkits
PDF
MongoDB, Node.js, and You: PART III
PDF
MongoDB, Node.js And You: PART II
PDF
MongoDB, Development and You
PDF
MongoTorino 2013 Opening Keynote
PDF
Data as Documents: Overview and intro to MongoDB
PDF
Cloud conference - mongodb
KEY
Unified Content Model and Joomla!
KEY
Gridfs and MongoDB
KEY
Joomla - an Overview
KEY
Operational MongoDB
KEY
Joomla Extreme Performance
KEY
Joomla and MongoDB
PDF
Mongodb and Totsy: An e-commerce case study
KEY
Content Management Systems and MongoDB
KEY
MongoDB: Built for Speed
KEY
Content Mangement Systems and MongoDB
KEY
Joomla For Entrepreneurs
Cloudy with a chance of scale
My life with MongoDB
PHP Cloud Deployment Toolkits
MongoDB, Node.js, and You: PART III
MongoDB, Node.js And You: PART II
MongoDB, Development and You
MongoTorino 2013 Opening Keynote
Data as Documents: Overview and intro to MongoDB
Cloud conference - mongodb
Unified Content Model and Joomla!
Gridfs and MongoDB
Joomla - an Overview
Operational MongoDB
Joomla Extreme Performance
Joomla and MongoDB
Mongodb and Totsy: An e-commerce case study
Content Management Systems and MongoDB
MongoDB: Built for Speed
Content Mangement Systems and MongoDB
Joomla For Entrepreneurs

Recently uploaded (20)

PDF
Spectral efficient network and resource selection model in 5G networks
PPTX
Cloud computing and distributed systems.
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
Empathic Computing: Creating Shared Understanding
PDF
Unlocking AI with Model Context Protocol (MCP)
PPTX
sap open course for s4hana steps from ECC to s4
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPTX
MYSQL Presentation for SQL database connectivity
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PPTX
Spectroscopy.pptx food analysis technology
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PPT
Teaching material agriculture food technology
Spectral efficient network and resource selection model in 5G networks
Cloud computing and distributed systems.
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Empathic Computing: Creating Shared Understanding
Unlocking AI with Model Context Protocol (MCP)
sap open course for s4hana steps from ECC to s4
The Rise and Fall of 3GPP – Time for a Sabbatical?
Reach Out and Touch Someone: Haptics and Empathic Computing
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
MYSQL Presentation for SQL database connectivity
The AUB Centre for AI in Media Proposal.docx
NewMind AI Weekly Chronicles - August'25 Week I
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Spectroscopy.pptx food analysis technology
Network Security Unit 5.pdf for BCA BBA.
Building Integrated photovoltaic BIPV_UPV.pdf
20250228 LYD VKU AI Blended-Learning.pptx
Review of recent advances in non-invasive hemoglobin estimation
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Teaching material agriculture food technology

Mongodb and Totsy - E-commerce Case Study