SlideShare a Scribd company logo
1 of 44
Download to read offline
Building an
e-commerce business
with gr8 technologies in Latin America
Groovy & Grails eXchange London
14th December 2012
Domingo Suarez Torres
@domix
lunes, 29 de abril de 13
Agenda
• About the Business
• Version 1
• Version 2
• Lessons learned
lunes, 29 de abril de 13
About me
• Java & Grails developer from México City
• grails.org.mx Mexican G&G community
Founder
• My team won the second place in the
Grails48 hackaton.
• TrollBoard. Kanban Board for GitHub Issues
• http://trollboard.rs.af.cm
lunes, 29 de abril de 13
clickOnero
• Started in 2010 as a Daily Deals website.
• German/Swiss investors
• Late 2011 acquired by Mexican investors
• Today it is a 100% Mexican company with
a pure ecommerce model
lunes, 29 de abril de 13
clickOnero 1.0
Grails, Terracotta, RabbitMQ & mySQL
lunes, 29 de abril de 13
clickOnero 1.0
• CodeName: CoolDeals
• Typical Grails application
• MySql,Tomcat, ehcache (Terracotta),
RabbitMQ
• Built in 2 months by 4 devs from Germany,
UK, Greece and Mexico
lunes, 29 de abril de 13
Caching
• Prevent excessive database access
• ehcache, backed with Terracotta
• Stored in cache
• Domain classes
• HTML pages & fragments
• JSON, XML documents
lunes, 29 de abril de 13
Long running code
• RabbitMQ
• Messaging with AMQP
• Asynchronous processing
• Mainly to use STMP services. Millions
emails sent daily
• Financial reports (long complex queries)
lunes, 29 de abril de 13
CoolDeals Deployment
http://www.springstar.com
lunes, 29 de abril de 13
CoolDeals Deployment
http://www.springstar.com
lunes, 29 de abril de 13
CoolDeals Deployment
http://www.springstar.com
lunes, 29 de abril de 13
Dev Team @ Mexico
• Very hard to find Grails developers
• Java developers -> Grails developers (4)
• It’s easy to do!
• New Grails developers excited about new
possibilities and simplicity of the language
and frameworks
lunes, 29 de abril de 13
Very Bad stuff
• Test cases only for critical pieces
• checkout, user registration, mailing list
subscription
• Very low code coverage.
• No Continuos integration
• Internal backend was a mess, a lot of code in
controllers
• Bad GORM queries
lunes, 29 de abril de 13
Enters JavaMelody
• The goal of JavaMelody is to monitor Java
or Java EE application servers in QA and
production environments.
• It is a tool to measure and calculate
statistics on real operation of an application
depending on the usage of the application
by users.
• ¡Grails Plugin!
lunes, 29 de abril de 13
lunes, 29 de abril de 13
JDBC Queries
lunes, 29 de abril de 13
JavaMelody
• It helps us improve our app!
lunes, 29 de abril de 13
More Plugins
• RabbitMQ
• Spring Security
• Rendering
• Quartz
• Feeds
• Export
• Recaptcha
• AWS
• Joda Time
• Java Melody
lunes, 29 de abril de 13
Hardware
lunes, 29 de abril de 13
Boxes
• 4 WebServers
• DBServer
• Physical Firewall
• LoadBalancer
lunes, 29 de abril de 13
Numbers
• 200k-300k visits daily
• 1.5M > page views daily
• 80K concurrent users
• 20K-50K new users daily
• 1000-3000 purchases daily
• 2.5M registered users
lunes, 29 de abril de 13
Logstalgia-httpd log viz
lunes, 29 de abril de 13
“Ecommerce Company
of the year in Mexico”
lunes, 29 de abril de 13
Lessons learned
• Cache is critical to scale
• The content in our app is ‘static’, few
changes, sometimes no changes.
• If the content is ‘static’, why do we always
execute code to render that content, even
if the content is cached?
lunes, 29 de abril de 13
clickOnero 2.0
Single Page Application (chaplin, backbone)
lunes, 29 de abril de 13
Motivation
• December 2011 clickOnero was acquired
by Mexican investors
• The company started to change.
• The new CEO asked to develop a brand
new store to sell different items like:
clothes, shoes, trips, services (hair cuts,
massages, cinema tickets, etc)
lunes, 29 de abril de 13
New markets
• clickOnero acquired other e-commerce startups
to increase the market
• Miplan.com: was a e-commerce company
specialized in offering national and international
trips. 500k users
• PezUrbano is a daily deals website from Brazil,
merging the two platforms is on the works.
1.5M users
• Very close to 5M users
lunes, 29 de abril de 13
Improvements
• Split the complete system in several
components
• API: Grails app for exchange information
• Admin. Grails application for internal use
• Hipstore.A totally static HTML
application built with Chaplin. Not a
Grails app.The store for the users
lunes, 29 de abril de 13
lunes, 29 de abril de 13
Grails Apps
• API
• Typical Grails application, with no GSPs.
• Speaks only JSON
• Used by partners (remote services) and
HipStore
• Admin
• Typical Grails application
lunes, 29 de abril de 13
Development
enhancements
• Increased test cases in both Grails apps
• Spock
• Jasmine for JavaScript code
• Introduced Jenkins
• Jenkins Jobs to deploy automatically to QA &
Production environments
• Bash shell scripts
lunes, 29 de abril de 13
HipStore
• Static HTML application built with Chaplin
• Chaplin is an architecture for JavaScript
applications using the Backbone.js library
lunes, 29 de abril de 13
HipStore
• Developed in CoffeeScript
• Uses PushState
• RequireJS (AMD Support)
• HandleBars (Template Engine)
• JQuery
• Underscore
• Twitter Bootstrap
• Build and packaged with Jake
lunes, 29 de abril de 13
HipStore
• Single Page Application
• Chaplin consumes JSON from the API to
render the store items.
• Uses PushState to update the URL in the
browser.Very useful for bookmarking and
social media sharing, even for SEO.
lunes, 29 de abril de 13
Sample URLs
• http://{server}/store/
• http://{server}/store/{category}
• http://{server}/store/{category}/{campaign}
• http://{server}/store/{category}/{campaign}/{item}
• Above urls valid for the Chaplin router, but invalid
for the browser, because them doesn’t exist. If
you try to use it, you’ll get a 404
lunes, 29 de abril de 13
HashBang
• http://{server}/store/#!/{category}
• Not very friendly with search engines.
• Google will try something like:
• http://{server}/store?_escaped_fragment_=
• Please read: https://developers.google.com/
webmasters/ajax-crawling/
lunes, 29 de abril de 13
Our approach
• Write to disk all the possible links in
HipStore. Crazy?
• We use ZombieJS to navigate the website
and then write to disk the generated HTML
• Put those static files (HTML) in the
webserver document root
• The best cache ever
lunes, 29 de abril de 13
Why do this?
• When the user visit our website, the
webserver will respond with completely
static HTML, CSS, JavaScript files
• Very fast
• The user never hits the Tomcats, we reduce
the load in the app servers.
• The webserver always responds very fast
lunes, 29 de abril de 13
ZombieJS
lunes, 29 de abril de 13
HTML harvesting
• The Node app receives the JSON message
• Navigates to HipStore with ZombieJS
• Executes the JavaScript (Chaplin app)
• Extracts the generated HTML with jQuery
• Saves to disk in the web server document
root
lunes, 29 de abril de 13
Things to consider
• When an item in the Store is modified, we need to
regenerate the appropriate HTML file only once.
• Then all the users will receive the same file
• The user only hits the Tomcat when really need it
(CheckOut, Registration)
• When the user click in some action in the app, the
interaction is handled by Chaplin controller if the
browser supports JavaScript
• Remember in our website the content is almost static?
lunes, 29 de abril de 13
Results
• The load in our Web Servers was reduce a
lot.
• The load in the database reduced a lot.
• The users can share the links.
• Store becomes very search engine friendly
lunes, 29 de abril de 13
Some stats
lunes, 29 de abril de 13
Thanks!
• Q&A
lunes, 29 de abril de 13

More Related Content

What's hot

Mobile ECM with JavaScript - JSE 2011
Mobile ECM with JavaScript - JSE 2011Mobile ECM with JavaScript - JSE 2011
Mobile ECM with JavaScript - JSE 2011
Nuxeo
 

What's hot (20)

BPM-4 Migration from jBPM to Activiti
BPM-4 Migration from jBPM to ActivitiBPM-4 Migration from jBPM to Activiti
BPM-4 Migration from jBPM to Activiti
 
SGCE 2015 REST APIs
SGCE 2015 REST APIsSGCE 2015 REST APIs
SGCE 2015 REST APIs
 
Whitepages Practical Experience Converting from Ruby to Reactive
Whitepages Practical Experience Converting from Ruby to ReactiveWhitepages Practical Experience Converting from Ruby to Reactive
Whitepages Practical Experience Converting from Ruby to Reactive
 
Projects In Laravel : Learn Laravel Building 10 Projects
Projects In Laravel : Learn Laravel Building 10 ProjectsProjects In Laravel : Learn Laravel Building 10 Projects
Projects In Laravel : Learn Laravel Building 10 Projects
 
Alfresco Demo Data
Alfresco Demo DataAlfresco Demo Data
Alfresco Demo Data
 
Mule soft meetup warsaw november 13th, 2019
Mule soft meetup   warsaw november 13th, 2019Mule soft meetup   warsaw november 13th, 2019
Mule soft meetup warsaw november 13th, 2019
 
Next Generation Web Development Techniques with Cloud Foundry
Next Generation Web Development Techniques with Cloud FoundryNext Generation Web Development Techniques with Cloud Foundry
Next Generation Web Development Techniques with Cloud Foundry
 
MuleSoft JWT Demystified
MuleSoft JWT DemystifiedMuleSoft JWT Demystified
MuleSoft JWT Demystified
 
Mobile ECM with JavaScript - JSE 2011
Mobile ECM with JavaScript - JSE 2011Mobile ECM with JavaScript - JSE 2011
Mobile ECM with JavaScript - JSE 2011
 
Lessons Learned from Building Windows 8 Store Apps with MVVM and XAML
Lessons Learned from Building Windows 8 Store Apps with MVVM and XAMLLessons Learned from Building Windows 8 Store Apps with MVVM and XAML
Lessons Learned from Building Windows 8 Store Apps with MVVM and XAML
 
William B. Hauck Resume PDF
William B. Hauck Resume PDFWilliam B. Hauck Resume PDF
William B. Hauck Resume PDF
 
Extending WordPress as a pro
Extending WordPress as a proExtending WordPress as a pro
Extending WordPress as a pro
 
angular-wakanda ngParis meetup 15 at 42
angular-wakanda ngParis meetup 15 at 42angular-wakanda ngParis meetup 15 at 42
angular-wakanda ngParis meetup 15 at 42
 
Keeping up with PHP
Keeping up with PHPKeeping up with PHP
Keeping up with PHP
 
Using RAML 1.0 Like a Pro
Using RAML 1.0 Like a ProUsing RAML 1.0 Like a Pro
Using RAML 1.0 Like a Pro
 
Conquer Architectural Challenges with End-to-End JavaScript - enterJS 2014
Conquer Architectural Challenges with End-to-End JavaScript - enterJS 2014Conquer Architectural Challenges with End-to-End JavaScript - enterJS 2014
Conquer Architectural Challenges with End-to-End JavaScript - enterJS 2014
 
Creating a Documentation Portal
Creating a Documentation PortalCreating a Documentation Portal
Creating a Documentation Portal
 
William B. Hauck Resume Word
William B. Hauck Resume WordWilliam B. Hauck Resume Word
William B. Hauck Resume Word
 
Mihai tataran developing modern web applications
Mihai tataran   developing modern web applicationsMihai tataran   developing modern web applications
Mihai tataran developing modern web applications
 
Alfresco Day Vienna 2016: Support Tools für die Admin-Konsole
Alfresco Day Vienna 2016: Support Tools für die Admin-KonsoleAlfresco Day Vienna 2016: Support Tools für die Admin-Konsole
Alfresco Day Vienna 2016: Support Tools für die Admin-Konsole
 

Viewers also liked

Título de experto en programación con tecnologías web
Título de experto en programación con tecnologías webTítulo de experto en programación con tecnologías web
Título de experto en programación con tecnologías web
AlicantePHP
 
OSCON 2013 - The Hitchiker’s Guide to Open Source Cloud Computing
OSCON 2013 - The Hitchiker’s Guide to Open Source Cloud ComputingOSCON 2013 - The Hitchiker’s Guide to Open Source Cloud Computing
OSCON 2013 - The Hitchiker’s Guide to Open Source Cloud Computing
Mark Hinkle
 
Rapid Product Design in the Wild - Agile Iceland
Rapid Product Design in the Wild - Agile IcelandRapid Product Design in the Wild - Agile Iceland
Rapid Product Design in the Wild - Agile Iceland
Michele Ide-Smith
 
Taxonomy of Scala
Taxonomy of ScalaTaxonomy of Scala
Taxonomy of Scala
shinolajla
 
Big Data, Big Changes: Data-Driven Product Development at Etsy
Big Data, Big Changes: Data-Driven Product Development at EtsyBig Data, Big Changes: Data-Driven Product Development at Etsy
Big Data, Big Changes: Data-Driven Product Development at Etsy
Jason Davis
 

Viewers also liked (20)

Alternative Design Workflows in a "PostPSD" Era
Alternative Design Workflows in a "PostPSD" EraAlternative Design Workflows in a "PostPSD" Era
Alternative Design Workflows in a "PostPSD" Era
 
SST 2014; The Reluctant SME
SST 2014; The Reluctant SMESST 2014; The Reluctant SME
SST 2014; The Reluctant SME
 
OpenID and decentralised social networks
OpenID and decentralised social networksOpenID and decentralised social networks
OpenID and decentralised social networks
 
Título de experto en programación con tecnologías web
Título de experto en programación con tecnologías webTítulo de experto en programación con tecnologías web
Título de experto en programación con tecnologías web
 
Datatium - radiation free responsive experiences
Datatium - radiation free responsive experiencesDatatium - radiation free responsive experiences
Datatium - radiation free responsive experiences
 
About VisualDNA Architecture @ Rubyslava 2014
About VisualDNA Architecture @ Rubyslava 2014About VisualDNA Architecture @ Rubyslava 2014
About VisualDNA Architecture @ Rubyslava 2014
 
Business of Front-end Web Development
Business of Front-end Web DevelopmentBusiness of Front-end Web Development
Business of Front-end Web Development
 
UXD v. Analytics - WIAD13 Ann Arbor
UXD v. Analytics - WIAD13 Ann ArborUXD v. Analytics - WIAD13 Ann Arbor
UXD v. Analytics - WIAD13 Ann Arbor
 
Microdata, Authorship, Google+ and Joomla! - Ruth Cheesley - Joomla! World Co...
Microdata, Authorship, Google+ and Joomla! - Ruth Cheesley - Joomla! World Co...Microdata, Authorship, Google+ and Joomla! - Ruth Cheesley - Joomla! World Co...
Microdata, Authorship, Google+ and Joomla! - Ruth Cheesley - Joomla! World Co...
 
OSCON 2013 - The Hitchiker’s Guide to Open Source Cloud Computing
OSCON 2013 - The Hitchiker’s Guide to Open Source Cloud ComputingOSCON 2013 - The Hitchiker’s Guide to Open Source Cloud Computing
OSCON 2013 - The Hitchiker’s Guide to Open Source Cloud Computing
 
Something from Nothing: Simple Ways to Look Sharp When Time is Short
Something from Nothing: Simple Ways to Look Sharp When Time is ShortSomething from Nothing: Simple Ways to Look Sharp When Time is Short
Something from Nothing: Simple Ways to Look Sharp When Time is Short
 
Rapid Product Design in the Wild - Agile Iceland
Rapid Product Design in the Wild - Agile IcelandRapid Product Design in the Wild - Agile Iceland
Rapid Product Design in the Wild - Agile Iceland
 
Web accessibiilty and Drupal
Web accessibiilty and DrupalWeb accessibiilty and Drupal
Web accessibiilty and Drupal
 
Rails traps
Rails trapsRails traps
Rails traps
 
Using Cascalog to build an app with City of Palo Alto Open Data
Using Cascalog to build an app with City of Palo Alto Open DataUsing Cascalog to build an app with City of Palo Alto Open Data
Using Cascalog to build an app with City of Palo Alto Open Data
 
ReactJS maakt het web eenvoudig
ReactJS maakt het web eenvoudigReactJS maakt het web eenvoudig
ReactJS maakt het web eenvoudig
 
FSharp for Trading - CodeMesh 2013
FSharp for Trading - CodeMesh 2013FSharp for Trading - CodeMesh 2013
FSharp for Trading - CodeMesh 2013
 
Taxonomy of Scala
Taxonomy of ScalaTaxonomy of Scala
Taxonomy of Scala
 
Big Data, Big Changes: Data-Driven Product Development at Etsy
Big Data, Big Changes: Data-Driven Product Development at EtsyBig Data, Big Changes: Data-Driven Product Development at Etsy
Big Data, Big Changes: Data-Driven Product Development at Etsy
 
SCALE12X Build a Cloud Day: Chef: The Swiss Army Knife of Cloud Infrastructure
SCALE12X Build a Cloud Day: Chef: The Swiss Army Knife of Cloud InfrastructureSCALE12X Build a Cloud Day: Chef: The Swiss Army Knife of Cloud Infrastructure
SCALE12X Build a Cloud Day: Chef: The Swiss Army Knife of Cloud Infrastructure
 

Similar to Groovy & Grails eXchange 2012 - Building an e-commerce business with gr8 technologies in Latin America

Appcelerator Titanium Intro
Appcelerator Titanium IntroAppcelerator Titanium Intro
Appcelerator Titanium Intro
Nicholas Jansma
 

Similar to Groovy & Grails eXchange 2012 - Building an e-commerce business with gr8 technologies in Latin America (20)

Prototyping like it is 2022
Prototyping like it is 2022 Prototyping like it is 2022
Prototyping like it is 2022
 
Building Large Mobile Apps
Building Large Mobile AppsBuilding Large Mobile Apps
Building Large Mobile Apps
 
From marketplace to WordPress - WordCamp Belfast
From marketplace to WordPress - WordCamp BelfastFrom marketplace to WordPress - WordCamp Belfast
From marketplace to WordPress - WordCamp Belfast
 
The world is not black and white – Impact of decisions over the lifetime of a...
The world is not black and white – Impact of decisions over the lifetime of a...The world is not black and white – Impact of decisions over the lifetime of a...
The world is not black and white – Impact of decisions over the lifetime of a...
 
Global Open Source Development 2011-2014 Review and 2015 Forecast
Global Open Source Development 2011-2014 Review and 2015 ForecastGlobal Open Source Development 2011-2014 Review and 2015 Forecast
Global Open Source Development 2011-2014 Review and 2015 Forecast
 
Building high performance and scalable share point applications
Building high performance and scalable share point applicationsBuilding high performance and scalable share point applications
Building high performance and scalable share point applications
 
Platform Selection
Platform SelectionPlatform Selection
Platform Selection
 
Everything XControls
Everything XControlsEverything XControls
Everything XControls
 
USG Rock Eagle 2017 - PWP at 1000 Days
USG Rock Eagle 2017 - PWP at 1000 DaysUSG Rock Eagle 2017 - PWP at 1000 Days
USG Rock Eagle 2017 - PWP at 1000 Days
 
jQuery Comes to XPages
jQuery Comes to XPagesjQuery Comes to XPages
jQuery Comes to XPages
 
Case study
Case studyCase study
Case study
 
Optimus XPages: An Explosion of Techniques and Best Practices
Optimus XPages: An Explosion of Techniques and Best PracticesOptimus XPages: An Explosion of Techniques and Best Practices
Optimus XPages: An Explosion of Techniques and Best Practices
 
Dibi Conference 2012
Dibi Conference 2012Dibi Conference 2012
Dibi Conference 2012
 
jQuery Mobile Jump Start
jQuery Mobile Jump StartjQuery Mobile Jump Start
jQuery Mobile Jump Start
 
Minimum Viable Architecture - Good Enough is Good Enough
Minimum Viable Architecture - Good Enough is Good EnoughMinimum Viable Architecture - Good Enough is Good Enough
Minimum Viable Architecture - Good Enough is Good Enough
 
Appcelerator Titanium Intro
Appcelerator Titanium IntroAppcelerator Titanium Intro
Appcelerator Titanium Intro
 
XPages Blast - Ideas, Tips and More
XPages Blast - Ideas, Tips and MoreXPages Blast - Ideas, Tips and More
XPages Blast - Ideas, Tips and More
 
jQuery: The World's Most Popular JavaScript Library Comes to XPages
jQuery: The World's Most Popular JavaScript Library Comes to XPagesjQuery: The World's Most Popular JavaScript Library Comes to XPages
jQuery: The World's Most Popular JavaScript Library Comes to XPages
 
Top 7 mistakes
Top 7 mistakesTop 7 mistakes
Top 7 mistakes
 
HTML 5 & The Modern Web
HTML 5 & The Modern WebHTML 5 & The Modern Web
HTML 5 & The Modern Web
 

More from Domingo Suarez Torres

More from Domingo Suarez Torres (20)

Cloud Native MX Meetup - Asegurando tu Cluster de Kubernetes
Cloud Native MX Meetup - Asegurando tu Cluster de KubernetesCloud Native MX Meetup - Asegurando tu Cluster de Kubernetes
Cloud Native MX Meetup - Asegurando tu Cluster de Kubernetes
 
Java Dev Day 2019 No kuberneteen por convivir
Java Dev Day 2019  No kuberneteen por convivirJava Dev Day 2019  No kuberneteen por convivir
Java Dev Day 2019 No kuberneteen por convivir
 
Contenedores 101 Digital Ocean CDMX
Contenedores 101 Digital Ocean CDMXContenedores 101 Digital Ocean CDMX
Contenedores 101 Digital Ocean CDMX
 
Retos en la arquitectura de Microservicios
Retos en la arquitectura de MicroserviciosRetos en la arquitectura de Microservicios
Retos en la arquitectura de Microservicios
 
Java Cloud Native Hack Nights GDL
Java Cloud Native Hack Nights GDLJava Cloud Native Hack Nights GDL
Java Cloud Native Hack Nights GDL
 
meetup digital ocean kubernetes
meetup digital ocean kubernetesmeetup digital ocean kubernetes
meetup digital ocean kubernetes
 
Peru JUG Micronaut & GraalVM
Peru JUG Micronaut & GraalVMPeru JUG Micronaut & GraalVM
Peru JUG Micronaut & GraalVM
 
DevFest Lima Corriendo cargas e trabajo seguras en GKE con Istio
DevFest Lima Corriendo cargas e trabajo seguras en GKE con IstioDevFest Lima Corriendo cargas e trabajo seguras en GKE con Istio
DevFest Lima Corriendo cargas e trabajo seguras en GKE con Istio
 
Cloud Native Development in the JVM
Cloud Native Development in the JVMCloud Native Development in the JVM
Cloud Native Development in the JVM
 
Cloud Native Mexico - Introducción a Kubernetes
Cloud Native Mexico - Introducción a KubernetesCloud Native Mexico - Introducción a Kubernetes
Cloud Native Mexico - Introducción a Kubernetes
 
Meetup DigitalOcean Cloud Native architecture
Meetup DigitalOcean Cloud Native architectureMeetup DigitalOcean Cloud Native architecture
Meetup DigitalOcean Cloud Native architecture
 
Cloud Native Mexico Meetup de Marzo 2018 Service Mesh con Istio y Envoy
Cloud Native Mexico Meetup de Marzo 2018 Service Mesh con Istio y EnvoyCloud Native Mexico Meetup de Marzo 2018 Service Mesh con Istio y Envoy
Cloud Native Mexico Meetup de Marzo 2018 Service Mesh con Istio y Envoy
 
Cloud Native Mexico Meetup enero 2018 Observability
Cloud Native Mexico Meetup enero 2018 ObservabilityCloud Native Mexico Meetup enero 2018 Observability
Cloud Native Mexico Meetup enero 2018 Observability
 
Cloud Native Mexico Presentacion
Cloud Native Mexico PresentacionCloud Native Mexico Presentacion
Cloud Native Mexico Presentacion
 
gRPC: Beyond REST
gRPC: Beyond RESTgRPC: Beyond REST
gRPC: Beyond REST
 
Devops Landscape
Devops LandscapeDevops Landscape
Devops Landscape
 
Orquestación de contenedores con Kubernetes SGNext
Orquestación de contenedores con Kubernetes SGNextOrquestación de contenedores con Kubernetes SGNext
Orquestación de contenedores con Kubernetes SGNext
 
JVM Reactive Programming
JVM Reactive ProgrammingJVM Reactive Programming
JVM Reactive Programming
 
SGNext Elasticsearch
SGNext ElasticsearchSGNext Elasticsearch
SGNext Elasticsearch
 
Webinar Arquitectura de Microservicios
Webinar Arquitectura de MicroserviciosWebinar Arquitectura de Microservicios
Webinar Arquitectura de Microservicios
 

Recently uploaded

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Recently uploaded (20)

Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 

Groovy & Grails eXchange 2012 - Building an e-commerce business with gr8 technologies in Latin America

  • 1. Building an e-commerce business with gr8 technologies in Latin America Groovy & Grails eXchange London 14th December 2012 Domingo Suarez Torres @domix lunes, 29 de abril de 13
  • 2. Agenda • About the Business • Version 1 • Version 2 • Lessons learned lunes, 29 de abril de 13
  • 3. About me • Java & Grails developer from México City • grails.org.mx Mexican G&G community Founder • My team won the second place in the Grails48 hackaton. • TrollBoard. Kanban Board for GitHub Issues • http://trollboard.rs.af.cm lunes, 29 de abril de 13
  • 4. clickOnero • Started in 2010 as a Daily Deals website. • German/Swiss investors • Late 2011 acquired by Mexican investors • Today it is a 100% Mexican company with a pure ecommerce model lunes, 29 de abril de 13
  • 5. clickOnero 1.0 Grails, Terracotta, RabbitMQ & mySQL lunes, 29 de abril de 13
  • 6. clickOnero 1.0 • CodeName: CoolDeals • Typical Grails application • MySql,Tomcat, ehcache (Terracotta), RabbitMQ • Built in 2 months by 4 devs from Germany, UK, Greece and Mexico lunes, 29 de abril de 13
  • 7. Caching • Prevent excessive database access • ehcache, backed with Terracotta • Stored in cache • Domain classes • HTML pages & fragments • JSON, XML documents lunes, 29 de abril de 13
  • 8. Long running code • RabbitMQ • Messaging with AMQP • Asynchronous processing • Mainly to use STMP services. Millions emails sent daily • Financial reports (long complex queries) lunes, 29 de abril de 13
  • 12. Dev Team @ Mexico • Very hard to find Grails developers • Java developers -> Grails developers (4) • It’s easy to do! • New Grails developers excited about new possibilities and simplicity of the language and frameworks lunes, 29 de abril de 13
  • 13. Very Bad stuff • Test cases only for critical pieces • checkout, user registration, mailing list subscription • Very low code coverage. • No Continuos integration • Internal backend was a mess, a lot of code in controllers • Bad GORM queries lunes, 29 de abril de 13
  • 14. Enters JavaMelody • The goal of JavaMelody is to monitor Java or Java EE application servers in QA and production environments. • It is a tool to measure and calculate statistics on real operation of an application depending on the usage of the application by users. • ¡Grails Plugin! lunes, 29 de abril de 13
  • 15. lunes, 29 de abril de 13
  • 16. JDBC Queries lunes, 29 de abril de 13
  • 17. JavaMelody • It helps us improve our app! lunes, 29 de abril de 13
  • 18. More Plugins • RabbitMQ • Spring Security • Rendering • Quartz • Feeds • Export • Recaptcha • AWS • Joda Time • Java Melody lunes, 29 de abril de 13
  • 19. Hardware lunes, 29 de abril de 13
  • 20. Boxes • 4 WebServers • DBServer • Physical Firewall • LoadBalancer lunes, 29 de abril de 13
  • 21. Numbers • 200k-300k visits daily • 1.5M > page views daily • 80K concurrent users • 20K-50K new users daily • 1000-3000 purchases daily • 2.5M registered users lunes, 29 de abril de 13
  • 22. Logstalgia-httpd log viz lunes, 29 de abril de 13
  • 23. “Ecommerce Company of the year in Mexico” lunes, 29 de abril de 13
  • 24. Lessons learned • Cache is critical to scale • The content in our app is ‘static’, few changes, sometimes no changes. • If the content is ‘static’, why do we always execute code to render that content, even if the content is cached? lunes, 29 de abril de 13
  • 25. clickOnero 2.0 Single Page Application (chaplin, backbone) lunes, 29 de abril de 13
  • 26. Motivation • December 2011 clickOnero was acquired by Mexican investors • The company started to change. • The new CEO asked to develop a brand new store to sell different items like: clothes, shoes, trips, services (hair cuts, massages, cinema tickets, etc) lunes, 29 de abril de 13
  • 27. New markets • clickOnero acquired other e-commerce startups to increase the market • Miplan.com: was a e-commerce company specialized in offering national and international trips. 500k users • PezUrbano is a daily deals website from Brazil, merging the two platforms is on the works. 1.5M users • Very close to 5M users lunes, 29 de abril de 13
  • 28. Improvements • Split the complete system in several components • API: Grails app for exchange information • Admin. Grails application for internal use • Hipstore.A totally static HTML application built with Chaplin. Not a Grails app.The store for the users lunes, 29 de abril de 13
  • 29. lunes, 29 de abril de 13
  • 30. Grails Apps • API • Typical Grails application, with no GSPs. • Speaks only JSON • Used by partners (remote services) and HipStore • Admin • Typical Grails application lunes, 29 de abril de 13
  • 31. Development enhancements • Increased test cases in both Grails apps • Spock • Jasmine for JavaScript code • Introduced Jenkins • Jenkins Jobs to deploy automatically to QA & Production environments • Bash shell scripts lunes, 29 de abril de 13
  • 32. HipStore • Static HTML application built with Chaplin • Chaplin is an architecture for JavaScript applications using the Backbone.js library lunes, 29 de abril de 13
  • 33. HipStore • Developed in CoffeeScript • Uses PushState • RequireJS (AMD Support) • HandleBars (Template Engine) • JQuery • Underscore • Twitter Bootstrap • Build and packaged with Jake lunes, 29 de abril de 13
  • 34. HipStore • Single Page Application • Chaplin consumes JSON from the API to render the store items. • Uses PushState to update the URL in the browser.Very useful for bookmarking and social media sharing, even for SEO. lunes, 29 de abril de 13
  • 35. Sample URLs • http://{server}/store/ • http://{server}/store/{category} • http://{server}/store/{category}/{campaign} • http://{server}/store/{category}/{campaign}/{item} • Above urls valid for the Chaplin router, but invalid for the browser, because them doesn’t exist. If you try to use it, you’ll get a 404 lunes, 29 de abril de 13
  • 36. HashBang • http://{server}/store/#!/{category} • Not very friendly with search engines. • Google will try something like: • http://{server}/store?_escaped_fragment_= • Please read: https://developers.google.com/ webmasters/ajax-crawling/ lunes, 29 de abril de 13
  • 37. Our approach • Write to disk all the possible links in HipStore. Crazy? • We use ZombieJS to navigate the website and then write to disk the generated HTML • Put those static files (HTML) in the webserver document root • The best cache ever lunes, 29 de abril de 13
  • 38. Why do this? • When the user visit our website, the webserver will respond with completely static HTML, CSS, JavaScript files • Very fast • The user never hits the Tomcats, we reduce the load in the app servers. • The webserver always responds very fast lunes, 29 de abril de 13
  • 39. ZombieJS lunes, 29 de abril de 13
  • 40. HTML harvesting • The Node app receives the JSON message • Navigates to HipStore with ZombieJS • Executes the JavaScript (Chaplin app) • Extracts the generated HTML with jQuery • Saves to disk in the web server document root lunes, 29 de abril de 13
  • 41. Things to consider • When an item in the Store is modified, we need to regenerate the appropriate HTML file only once. • Then all the users will receive the same file • The user only hits the Tomcat when really need it (CheckOut, Registration) • When the user click in some action in the app, the interaction is handled by Chaplin controller if the browser supports JavaScript • Remember in our website the content is almost static? lunes, 29 de abril de 13
  • 42. Results • The load in our Web Servers was reduce a lot. • The load in the database reduced a lot. • The users can share the links. • Store becomes very search engine friendly lunes, 29 de abril de 13
  • 43. Some stats lunes, 29 de abril de 13
  • 44. Thanks! • Q&A lunes, 29 de abril de 13

Editor's Notes

  1. Hi my name is Domingo Suarez, I'm from Mexico City, and this afternoon I'm going to talk about my experience building the largest e-commerce website in Mexico with grails. I will talk about what worked well, what didn't, some lessons learned and so on. I only want to share my experience in my context
  2. Before I start, let me tell you a little about my background. I've been using Grails since late 2007, my first website built with grails went live in 2008. For all my professional career I've been a java developer, mostly on the server side. In Mexico I founded the Groovy/Grails user group. In the Grails48 hackaton my team won the second place for developing a kanban board for github issues. Let’s get started...
  3. For the last two years I've been working at clickOnero, an ecommerce company with a national presence in Mexico. Here is the story, In 2010 a friend of mine asked me if I knew an available Grails developer for hire. In Mexico is very hard to find Grails developers, very hard... At the end I accepted the job and joined clickOnero, a company with Swiss investors. The clickOnero investors made more investments around the world with the same business model.
  4. In he beginning, The clickOnero's business model was to sell coupons for daily deals. The CEO asked us to develop an in-house solution for this.
  5. We built the solution in 2 months, with a team from all over the world, 4 developers from: Germany, UK, Greece and Mexico. I went to Germany to work together with them and then came back to Mexico to deploy and launch the company. The first version was built using the common Grails artifacts, controllers, gsps, taglibs, domain classes and services. This was deployed to tomcat with MySQL as database. When we started to build cooldeals, we made some crucial technical decisions.
  6. For example, to cache heavily with ehcache, backed with terracotta in production.
  7. From the very beginning we had some requirements related to massive emails campaigns and chose RabbitMQ for long running operations like sending emails.
  8. We went live in Mexico the first week of September 2010, one week later we launched the website in Argentina, both websites with the same branding and the same platform. Two weeks later, the Dubai version went live with a different branding but same platform. The platform was built with multi currency and multilingual support, for 2 different continents and 6 different countries (the Dubai version runs in 4 different countries in the Middle East)a
  9. Meanwhile in Mexico, I help put together the dev team. I hired 4 local Java developers and converted them to Groovy/Grails developers, it was really easy to do. The developers were very excited about the new possibilities and simplicity of the language and frameworks.
  10. But, we made bad things. In the same application, we built the website for the customers and the administration backend. We wrote only test cases for the critical pieces (checkout, user registration). The internal backend was really a mess!
  11. We started to have issues. Slow response times. We didn’t know where the problem was We used JavaMelody to detect bottlenecks and long running code. It was really helpful to fixed the issues we had.
  12. JavaMelody generates this graphs, where you can see problem in your app. Memory problems, jdbc problem, threads
  13. This is an example of jdbc queries. You can see the hit count, mean time response, max, min Of course you can use this data to identify bad code in your app
  14. As an IT department, we were responsible for the hardware infrastructure as well. No sysadmin and no dba in the company, only 5 developers. The hardware we had was 4 app servers(tomcat) and one database(MySQL) server. Here is a bit more technical detail on these servers: With this infrastructure we were able to support the company's growth. By late 2011 we had 2 million users, with 50k concurrent users. Show logstalgia visualization
  15. As an IT department, we were responsible for the hardware infrastructure as well. No sysadmin and no dba in the company, only 5 developers. The hardware we had was 4 app servers(tomcat) and one database(MySQL) server. Here is a bit more technical detail on these servers: With this infrastructure we were able to support the company's growth. By late 2011 we had 2 million users, with 50k concurrent users. Show logstalgia visualization
  16. The company worked very well for several months, in fact the last year we won the prize for the best Internet company in Mexico, a prize granted for the Mexican Internet Association (AMIPCI)
  17. At December 2011, the company was acquired by Mexican investors and the company started to change to improve the business performance.
  18. At this time the investors acquired other e-commerce startups to increase the clickOnero market:-MiPlan.com was a ecommerce company specialized in offering national and international trips. When this company was acquired, the clickOnero user base increased to 3 Million users-PezUrbano is a daily deals website from Brazil, merging the two platforms is on the works. The clickOnero's user base will increase by 1.5 million users
  19. We divided all the system in several components:-API, Grails application only for data exchange. This app exposes http services for getting data with basic auth http. In this app, we built the checkout, stock, user registration, mailing list subscription services.-Hipstore. A totally static HTML application built with Chaplin, an abstraction over backbone, with a templating engine. This app is served from the web server, with gzip and cached in the client with etag if available. This app consumes the API services-Admin. Grails application for internal use, the production team uses this app to create items campaigns, the customer service department uses this app for customer support. The sales team uses this app for tracking sales
  20. The admin apps users made some changes in the database items, when the change is committed to the database, the admin app sends a JSON message to a RabbitMQ A node app listen that message and with ZombieJS navigate the
  21. We saw the users spend more time in the store, we reduced the bounce rate and guess what, We went down from 4  to 2 app servers. The users didn't notice the reduction in hardware. (show the google analytics image)