SlideShare uma empresa Scribd logo
1 de 108
Baixar para ler offline
From big
    GORM-centered
    into a cloud of
    fast nodes
                                    Jorge Uriarte Aretxaga
                                            @jorgeuriarte

http://www.slideshare.com/gailen/
About me
@jorgeuriarte
jorge.uriarte@gailen.es




                          About me
Origins
In the beginning...
In the beginning...
Well-known territory
Well-known territory

JVM based!
Well-known territory

JVM based!

Old good SQL
  & RDBMs
Well-known territory

JVM based!

Old good SQL
  & RDBMs

GORM magic!
Productive development environment
Productive development environment
     Affordable learning curve
Productive development environment
     Affordable learning curve
    Good-enough performance
Evolution
“Mmmhhh... I wouldn’t
  build it that way
    nowadays...”
           Enrique Amodeo
“Mmmhhh... I wouldn’t
  build it that way
    nowadays...”
          Enrique Amodeo
“Mmmhhh... I wouldn’t
  build it that way
    nowadays...”
          Enrique Amodeo




               “Mmmhhh...
                nowadays...
             neither would I!”
                           Me
New brands
& countries
Reality Check
Reality bites
Reality bites
crementalMode
                                                                                      -XX: +UseTLAB -XX:+CMSIn
                                                                   seConcMarkSweepGC                          ingThreshold=0
                                          -XX: +UseParNewGC -XX:+U                   tyCy cle=10 -XX:MaxTenur
                      X:MaxPermSize=128m                          X:CMSIncrementalDu
-s erver -Xmx1024m -X                    ment alDutyCycleMin=0 -X                  itGC
                      acing -XX:CMSIncre                        -XX:+DisableExplic
-X X:+CMSIncrementalP                    gOcc upancyFraction=60
                      6 -XX:CMSInitiatin
-X X:SurvivorRatio=25
C
                                                                                         P arNewG e
                                                                           -X  X:+Use ntalMod
                                                                  e =128m SIncreme
                                                 MaxP   ermSiz -XX:+CM                              0
                                                                                          l-XX:in= crementalMode
                                                                                            eM +CMSIn
                                           -X se: rNewGC -XX:+U AB rkSwee alDut e=10 c MaxTen 0
                                                                                      y
                                       4g X:+UX PaX:+UseTLseConcMammentpGC tyCyclyC -XX:old=uringThreshold=0
                                     x -X
                                                                              -XX:+UseTLAB
                          3g X:-Xm 8m mentC DutyCycleMin=0M-XX:ncrere entalDu GCgThresh
-server -Xmx r -Xms -X CMSIncre pG al -
             1024m -XX:MaxPermS
                                ize=12          X               CMSInc
                                                            SI +Disableenurit n                      60
  X:+CserveentalP
       MSIncrem      acing      kSweegOccupng FractionC 0 -XX: MaxT Explic i
                        cMar atin            ancy -XX: =6                                a ction=
                                                                               ancyFr
-X -
   X:SurvivorRatio=25on
                s eC 6 -XX:CMSInitialPaci                  - XX:             p
     -XX:+U SIncrement utyCycle=10 tiatingOccu
-X
                                                            i
      - XX:+CM ncrementalD 6 -XX:CMSIn
                   I                    5
      - XX:CMS ivorRatio=2 GC
       -X  X:Surv bleExplicit
                    sa
        - XX:+Di
Productivity slows down...
Fragility...
Evolution stopped...
Slow development
Slow development
Fragile system... prone to errors
Slow development
Fragile system... prone to errors
   Tuning hell with JVM heap
Slow development
Fragile system... prone to errors
   Tuning hell with JVM heap
    Terracota cluster issues
Slow development
Fragile system... prone to errors
   Tuning hell with JVM heap
    Terracota cluster issues
 Overall excessive complexity
Change?
  Surgery?
 Refactor?
keep tuning?
Meanwhile... in another
   mental thread...
A solution looking for a problem?
But get back to the previous point...
But get back to the previous point...
     Will you dare jump off it?
• New side-project
• Potentially deadly traffic
• Still to be tighly connected with
our core system
• New side-project
• Potentially deadly traffic
• Still to be tighly connected with
our •core system
      Solutions?
    •Dedicated system?
    •More machines & tuning?
    •Catch that train!
Proof of concept and... JUMP!
Some details?
Fast importer from
                        Quick & dirty (1w)
  existing XMLs
                                     Elasticsearch
         Prototype
    - show me the code -
        Redis                  Groovy!!!
  Fast Controllers        (XML parsing, JSON
Ajax (fewer requests)       rendering, grails
                             controllers, ...)
• Simply groovy.util.XmlSlurper
• Simply groovy.util.XmlSlurper
• Two importers, really
• Simply groovy.util.XmlSlurper
• Two importers, really
  • Bulk
• Simply groovy.util.XmlSlurper
• Two importers, really
  • Bulk
  • Incremental (continuous)
• Simply groovy.util.XmlSlurper
• Two importers, really
  • Bulk
  • Incremental (continuous)
• Born as a temporary hack...
• Simply groovy.util.XmlSlurper
• Two importers, really
  • Bulk
  • Incremental (continuous)
• Born as a temporary hack...
 soon to give way to a better system
• Redis master/slaves replication
• Redis master/slaves replication
• Fast
• Redis master/slaves replication
• Fast
• Trivial
• Redis master/slaves replication
• Fast
• Trivial
• Fast
• Redis master/slaves replication
• Fast
• Trivial
• Fast
• Trivial
• Redis master/slaves replication
• Fast
• Trivial
• Fast
• Trivial
• Did I mention fast and trivial?
Deadly simple Grails app
Deadly simple Grails app
Deadly simple Grails app
Deadly simple Grails app


“Look mum, no GORM!”
From ‘searchable’ to ElasticSearch
• Fat-trimmed new fronts
• Fast, *light* application
• Information still safe in the core
system



• Much more capacity with less
resources
• Simple integration
Old system




                                                    New system




             Wait... where did the red arrows go?
Subdomain based write-through
Subdomain based write-through




• Login, session, tracking...
Subdomain based write-through




• Login, session, tracking...
• Purchases, payments, subscriptions
Subdomain based write-through




• Login, session, tracking...
• Purchases, payments, subscriptions
• Everything goes to our *good old core
system*
Subdomain based write-through




• Login, session, tracking...
• Purchases, payments, subscriptions
• Everything goes to our *good old core
system*
• ACID, consistency, GORM, SQL,
transactions...
Subdomain based write-through




• Login, session, tracking...
• Purchases, payments, subscriptions
• Everything goes to our *good old core
system*
• ACID, consistency, GORM, SQL,
transactions...
• ...but now with a small fraction of the
load
Evaluation
Terracota/Clustering
approach vs “new thing”




               Evaluation
Terracota/Clustering
approach vs “new thing”




                Evaluation
Memory, speed, size,
   codebase
Terracota/Clustering
approach vs “new thing”




                Evaluation
Memory, speed, size,
   codebase

                 Decoupled search
                     system
Terracota/Clustering
approach vs “new thing”




                Evaluation
Memory, speed, size,
   codebase                         New problems,
                                    synchronization
                 Decoupled search
                     system
Productivity increasing again...
New landscape
New landscape
Get rid of XML importer
(event driven pub/subs...?)
New landscape
Get rid of XML importer
(event driven pub/subs...?)

                              Delete old code (yeah!)
Keep pushing for speed




             New landscape
Get rid of XML importer
(event driven pub/subs...?)

                              Delete old code (yeah!)
Keep pushing for speed

                          Keep it simple (this time)


             New landscape
Get rid of XML importer
(event driven pub/subs...?)

                               Delete old code (yeah!)
Just ask me... in two years
@jorgeuriarte
"From big GORM-centered into a cloud of fast
                                                   nodes" por Jorge Uriarte se encuentra bajo una
                                                      Licencia Creative Commons Atribución-
                                                           CompartirIgual 3.0 Unported.

                               External sources

                                       PITA
http://www.quicksales.com.au/ad/p-i-t-a-pain-in-the-ass-car-number-plate/2606513
                                     Hamster
               http://www.flickr.com/photos/sualk61/3117477410/
                                    Cliff view
            http://www.flickr.com/photos/epsos/4376727123/sizes/l/
                           Knight in the white horse
             http://www.flickr.com/photos/photoplod/7982134342/
                                       Snail
            http://www.flickr.com/photos/raphaelquinet/693813637/
                                     Fast snail
               http://www.flickr.com/photos/zorro13/4086173313
                                 Timanfaya devil
                http://www.flickr.com/photos/yelacis/6941891989/
                                  Light patterns
            http://www.flickr.com/photos/aerosolhalos/6676192013/
                           Kick in the top of the cliff
             http://www.flickr.com/photos/4elevenpix/5056089861/
                                Homer evolution
          http://www.flickr.com/photos/photonquantique/1858685882/
                                  Lego machine
              http://www.flickr.com/photos/djimison/3058818283/
                                    Landscape
              http://www.flickr.com/photos/blmiers2/6112610781/
                                       Exam
            http://www.flickr.com/photos/albertogp123/5843577306/
                                  Future is past
                 http://www.flickr.com/photos/tind/7533681980/

Mais conteúdo relacionado

Semelhante a From big GORM to fast cloud nodes

Garbage Collection of Java VM
Garbage Collection of Java VMGarbage Collection of Java VM
Garbage Collection of Java VMYongqiang Li
 
TinyOS 2.1 Tutorial: Hands-on Session
TinyOS 2.1 Tutorial: Hands-on SessionTinyOS 2.1 Tutorial: Hands-on Session
TinyOS 2.1 Tutorial: Hands-on SessionRazvan Musaloiu-E.
 
Simple, fast, and scalable torch7 tutorial
Simple, fast, and scalable torch7 tutorialSimple, fast, and scalable torch7 tutorial
Simple, fast, and scalable torch7 tutorialJin-Hwa Kim
 
Tiramisu をちょっと、味見してみました。
Tiramisu をちょっと、味見してみました。Tiramisu をちょっと、味見してみました。
Tiramisu をちょっと、味見してみました。Mr. Vengineer
 
New Directions for Mahout
New Directions for MahoutNew Directions for Mahout
New Directions for MahoutTed Dunning
 
25 лет истории C++, пролетевшей на моих глазах
25 лет истории C++, пролетевшей на моих глазах25 лет истории C++, пролетевшей на моих глазах
25 лет истории C++, пролетевшей на моих глазахcorehard_by
 
Shrimp: A Rather Practical Example Of Application Development With RESTinio a...
Shrimp: A Rather Practical Example Of Application Development With RESTinio a...Shrimp: A Rather Practical Example Of Application Development With RESTinio a...
Shrimp: A Rather Practical Example Of Application Development With RESTinio a...Yauheni Akhotnikau
 
The System of Automatic Searching for Vulnerabilities or how to use Taint Ana...
The System of Automatic Searching for Vulnerabilities or how to use Taint Ana...The System of Automatic Searching for Vulnerabilities or how to use Taint Ana...
The System of Automatic Searching for Vulnerabilities or how to use Taint Ana...Positive Hack Days
 
Vectorization vs Compilation
Vectorization vs CompilationVectorization vs Compilation
Vectorization vs CompilationAlex Averbuch
 
Handling 20 billion requests a month
Handling 20 billion requests a monthHandling 20 billion requests a month
Handling 20 billion requests a monthDmitriy Dumanskiy
 
On Mining Bitcoins - Fundamentals & Outlooks
On Mining Bitcoins - Fundamentals & OutlooksOn Mining Bitcoins - Fundamentals & Outlooks
On Mining Bitcoins - Fundamentals & OutlooksFilip Maertens
 
Java Core | Understanding the Disruptor: a Beginner's Guide to Hardcore Concu...
Java Core | Understanding the Disruptor: a Beginner's Guide to Hardcore Concu...Java Core | Understanding the Disruptor: a Beginner's Guide to Hardcore Concu...
Java Core | Understanding the Disruptor: a Beginner's Guide to Hardcore Concu...JAX London
 
[CCC-28c3] Post Memory Corruption Memory Analysis
[CCC-28c3] Post Memory Corruption Memory Analysis[CCC-28c3] Post Memory Corruption Memory Analysis
[CCC-28c3] Post Memory Corruption Memory AnalysisMoabi.com
 
[CONFidence 2016] Dmitry Chastuhin, Dmitry Yudin - SAP, dos, dos, race condi...
[CONFidence 2016] Dmitry Chastuhin, Dmitry Yudin -  SAP, dos, dos, race condi...[CONFidence 2016] Dmitry Chastuhin, Dmitry Yudin -  SAP, dos, dos, race condi...
[CONFidence 2016] Dmitry Chastuhin, Dmitry Yudin - SAP, dos, dos, race condi...PROIDEA
 
Copy Your Favourite Nokia App with Qt
Copy Your Favourite Nokia App with QtCopy Your Favourite Nokia App with Qt
Copy Your Favourite Nokia App with Qtaccount inactive
 
7 jvm-arguments-Confoo
7 jvm-arguments-Confoo7 jvm-arguments-Confoo
7 jvm-arguments-ConfooTier1 app
 
[Ruxcon 2011] Post Memory Corruption Memory Analysis
[Ruxcon 2011] Post Memory Corruption Memory Analysis[Ruxcon 2011] Post Memory Corruption Memory Analysis
[Ruxcon 2011] Post Memory Corruption Memory AnalysisMoabi.com
 
Эксплуатируем неэксплуатируемые уязвимости SAP
Эксплуатируем неэксплуатируемые уязвимости SAPЭксплуатируем неэксплуатируемые уязвимости SAP
Эксплуатируем неэксплуатируемые уязвимости SAPPositive Hack Days
 
Getting access to the SAP server via SAP Management Console
Getting access to the SAP server via SAP Management ConsoleGetting access to the SAP server via SAP Management Console
Getting access to the SAP server via SAP Management ConsoleDmitry Iudin
 

Semelhante a From big GORM to fast cloud nodes (20)

Garbage Collection of Java VM
Garbage Collection of Java VMGarbage Collection of Java VM
Garbage Collection of Java VM
 
[BGOUG] Java GC - Friend or Foe
[BGOUG] Java GC - Friend or Foe[BGOUG] Java GC - Friend or Foe
[BGOUG] Java GC - Friend or Foe
 
TinyOS 2.1 Tutorial: Hands-on Session
TinyOS 2.1 Tutorial: Hands-on SessionTinyOS 2.1 Tutorial: Hands-on Session
TinyOS 2.1 Tutorial: Hands-on Session
 
Simple, fast, and scalable torch7 tutorial
Simple, fast, and scalable torch7 tutorialSimple, fast, and scalable torch7 tutorial
Simple, fast, and scalable torch7 tutorial
 
Tiramisu をちょっと、味見してみました。
Tiramisu をちょっと、味見してみました。Tiramisu をちょっと、味見してみました。
Tiramisu をちょっと、味見してみました。
 
New Directions for Mahout
New Directions for MahoutNew Directions for Mahout
New Directions for Mahout
 
25 лет истории C++, пролетевшей на моих глазах
25 лет истории C++, пролетевшей на моих глазах25 лет истории C++, пролетевшей на моих глазах
25 лет истории C++, пролетевшей на моих глазах
 
Shrimp: A Rather Practical Example Of Application Development With RESTinio a...
Shrimp: A Rather Practical Example Of Application Development With RESTinio a...Shrimp: A Rather Practical Example Of Application Development With RESTinio a...
Shrimp: A Rather Practical Example Of Application Development With RESTinio a...
 
The System of Automatic Searching for Vulnerabilities or how to use Taint Ana...
The System of Automatic Searching for Vulnerabilities or how to use Taint Ana...The System of Automatic Searching for Vulnerabilities or how to use Taint Ana...
The System of Automatic Searching for Vulnerabilities or how to use Taint Ana...
 
Vectorization vs Compilation
Vectorization vs CompilationVectorization vs Compilation
Vectorization vs Compilation
 
Handling 20 billion requests a month
Handling 20 billion requests a monthHandling 20 billion requests a month
Handling 20 billion requests a month
 
On Mining Bitcoins - Fundamentals & Outlooks
On Mining Bitcoins - Fundamentals & OutlooksOn Mining Bitcoins - Fundamentals & Outlooks
On Mining Bitcoins - Fundamentals & Outlooks
 
Java Core | Understanding the Disruptor: a Beginner's Guide to Hardcore Concu...
Java Core | Understanding the Disruptor: a Beginner's Guide to Hardcore Concu...Java Core | Understanding the Disruptor: a Beginner's Guide to Hardcore Concu...
Java Core | Understanding the Disruptor: a Beginner's Guide to Hardcore Concu...
 
[CCC-28c3] Post Memory Corruption Memory Analysis
[CCC-28c3] Post Memory Corruption Memory Analysis[CCC-28c3] Post Memory Corruption Memory Analysis
[CCC-28c3] Post Memory Corruption Memory Analysis
 
[CONFidence 2016] Dmitry Chastuhin, Dmitry Yudin - SAP, dos, dos, race condi...
[CONFidence 2016] Dmitry Chastuhin, Dmitry Yudin -  SAP, dos, dos, race condi...[CONFidence 2016] Dmitry Chastuhin, Dmitry Yudin -  SAP, dos, dos, race condi...
[CONFidence 2016] Dmitry Chastuhin, Dmitry Yudin - SAP, dos, dos, race condi...
 
Copy Your Favourite Nokia App with Qt
Copy Your Favourite Nokia App with QtCopy Your Favourite Nokia App with Qt
Copy Your Favourite Nokia App with Qt
 
7 jvm-arguments-Confoo
7 jvm-arguments-Confoo7 jvm-arguments-Confoo
7 jvm-arguments-Confoo
 
[Ruxcon 2011] Post Memory Corruption Memory Analysis
[Ruxcon 2011] Post Memory Corruption Memory Analysis[Ruxcon 2011] Post Memory Corruption Memory Analysis
[Ruxcon 2011] Post Memory Corruption Memory Analysis
 
Эксплуатируем неэксплуатируемые уязвимости SAP
Эксплуатируем неэксплуатируемые уязвимости SAPЭксплуатируем неэксплуатируемые уязвимости SAP
Эксплуатируем неэксплуатируемые уязвимости SAP
 
Getting access to the SAP server via SAP Management Console
Getting access to the SAP server via SAP Management ConsoleGetting access to the SAP server via SAP Management Console
Getting access to the SAP server via SAP Management Console
 

Mais de Gailen Tecnologías

Agile for Scrummies - BilboStack
Agile for Scrummies - BilboStackAgile for Scrummies - BilboStack
Agile for Scrummies - BilboStackGailen Tecnologías
 
Bielsa, Guardiola, los principios ágiles, y el Scrum 4-4-2
Bielsa, Guardiola, los principios ágiles, y el Scrum 4-4-2 Bielsa, Guardiola, los principios ágiles, y el Scrum 4-4-2
Bielsa, Guardiola, los principios ágiles, y el Scrum 4-4-2 Gailen Tecnologías
 
Groovy: Un nombre tonto para una palanca de productividad sobre Java
Groovy: Un nombre tonto para una palanca de productividad sobre JavaGroovy: Un nombre tonto para una palanca de productividad sobre Java
Groovy: Un nombre tonto para una palanca de productividad sobre JavaGailen Tecnologías
 
Deconstructing grails-i18n-fields plugin
Deconstructing grails-i18n-fields pluginDeconstructing grails-i18n-fields plugin
Deconstructing grails-i18n-fields pluginGailen Tecnologías
 
La alternativa ágil - Uniencounter
La alternativa ágil - UniencounterLa alternativa ágil - Uniencounter
La alternativa ágil - UniencounterGailen Tecnologías
 
Priorización del Valor del Negocio - Euskadi Invest
Priorización del Valor del Negocio - Euskadi InvestPriorización del Valor del Negocio - Euskadi Invest
Priorización del Valor del Negocio - Euskadi InvestGailen Tecnologías
 

Mais de Gailen Tecnologías (10)

Agile for Scrummies - BilboStack
Agile for Scrummies - BilboStackAgile for Scrummies - BilboStack
Agile for Scrummies - BilboStack
 
Presentacion cas2013
Presentacion cas2013Presentacion cas2013
Presentacion cas2013
 
Bielsa, Guardiola, los principios ágiles, y el Scrum 4-4-2
Bielsa, Guardiola, los principios ágiles, y el Scrum 4-4-2 Bielsa, Guardiola, los principios ágiles, y el Scrum 4-4-2
Bielsa, Guardiola, los principios ágiles, y el Scrum 4-4-2
 
Groovy: Un nombre tonto para una palanca de productividad sobre Java
Groovy: Un nombre tonto para una palanca de productividad sobre JavaGroovy: Un nombre tonto para una palanca de productividad sobre Java
Groovy: Un nombre tonto para una palanca de productividad sobre Java
 
Deconstructing grails-i18n-fields plugin
Deconstructing grails-i18n-fields pluginDeconstructing grails-i18n-fields plugin
Deconstructing grails-i18n-fields plugin
 
La alternativa ágil - Uniencounter
La alternativa ágil - UniencounterLa alternativa ágil - Uniencounter
La alternativa ágil - Uniencounter
 
Gailen - En 3 minutos
Gailen - En 3 minutosGailen - En 3 minutos
Gailen - En 3 minutos
 
¿Agile y distribuido?
¿Agile y distribuido?¿Agile y distribuido?
¿Agile y distribuido?
 
Transición a proyectos ágiles
Transición a proyectos ágilesTransición a proyectos ágiles
Transición a proyectos ágiles
 
Priorización del Valor del Negocio - Euskadi Invest
Priorización del Valor del Negocio - Euskadi InvestPriorización del Valor del Negocio - Euskadi Invest
Priorización del Valor del Negocio - Euskadi Invest
 

From big GORM to fast cloud nodes