SlideShare uma empresa Scribd logo
1 de 34
Baixar para ler offline
Gridify
your Spring application
    with Grid Gain
           Sergio Bossa
      Pro-Netics / Sourcesense
About me
✔   Software architect and engineer
    ➔   Pro-Netics (http://www.pronetics.it)
    ➔   Sourcesense (http://www.sourcesense.com)
✔   Blogger
    ➔   http://sbtourist.blogspot.com
✔   Open Source Enthusiast
    ➔   Lead at Scarlet - Clustering for Jira (http://scarlet.sf.net)
    ➔   Committer at Spring Modules
        (http://springmodules.dev.java.net)
    ➔   Committer at Taconite Ajax Framework
        (http://taconite.sourceforge.net/)
Agenda
✔   Common ground.
    ➔   Why Grid?
    ➔   Performance and Scalability.
    ➔   Map / Reduce.
✔   Grid Gain and The Spring Framework.
    ➔   Grid Gain concepts.
    ➔   Grid Gain on Spring.
    ➔   A practical example.
Why grid?
                     Social changes
✔   Cheaper hardware.
    ➔   Computer as an off-the-shelf product.
✔   Web explosion.
    ➔   Everything is on the web.
    ➔   Everyone is on the web.
        ➔   More and more users.
        ➔   More and more transactions.
Why grid?
               Technological changes
✔   Cheaper hardware.
    ➔   We have more power.
        ➔   We want more speed.
✔   Moore's Law: the number of transistors that can be
    inexpensively placed on an integrated circuit is
    increasing exponentially.
    ➔   But we had to go from single-core processors to multi-
        core ones ...
    ➔   So your for-loop will always run at the same speed.
        ➔   Forever.
Why grid?


   +

   =
Performance
It's all about doing one thing.
             Faster.
Scalability
It's all about doing the same one thing.
             In a bigger way.
Performance vs Scalability

✔   Performance is about how fast.
✔   Scalability is about how much.
✔   Nowadays, if you want to save your job and hears
    (remember that Boss screaming at your face) ...
    ➔   You have to scale.
Scalability in two words
✔   Vertical scalability is about adding more and more
    power (CPU, RAM ...) to your single computer.
    ➔   Also known as scaling-in.
    ➔   Finite and costly.
✔   Horizontal scalability is about adding more and more
    computers.
    ➔   Also known as scaling-out.
    ➔   Infinite and cheaper, because using commodity
        hardware.
✔   Guess what, we want to scale-out ...
The scalability factor

✔   Available resources while scaling out.
    ➔   Linear scalability.
    ➔   Supra-linear scalability.
    ➔   Sub-linear scalability.
    ➔   Negative scalability.
✔   A scalable application should always strive for (almost)
    linear scalability.
The scalability problem


✔   Amdahl's Law: performance decreases as number of
    processors increases once there is even a small
    percentage of non-parallelizable code.
    ➔   Most of the software is written in a non-parallelizable
        way.
    ➔   Writing software that scales out is perceived as hard.
Entering Map / Reduce

✔   From Google Labs.
    ➔   Is it enough?
Map / Reduce explained
✔   Programming model for linearly scaling out.
✔   De-facto standard for parallelizing intensive processing
    tasks.
✔   Based on:
    ➔   Splitting tasks into several parallelizable jobs grouped
        by key.
    ➔   Mapping jobs to processing units, optionally taking
        into account the job key.
    ➔   Merging jobs results, joining them into a global task
        result.
Map / Reduce illustrated
   Counting words
Grid computing with Map / Reduce

✔   Grid computing.
    ➔   Basically, a way to exploit multi-core / multi-
        processors / multi-computer environments for
        achieving horizontal scalability.
✔   Map / Reduce.
    ➔   Common paradigm in grid computing for
        implementing scalable applications.
Entering Grid Gain
✔   Open Source Grid Computing Framework.
    ➔   Web : http://www.gridgain.com
    ➔   Created and supported by Grid Gain Systems.
        ➔   Community support.
        ➔   Professional support.
✔   Powerful, yet simple, yet fun, Map / Reduce
    implementation.
✔   Integrated with major servlet containers and application
    servers.
✔   Integrated with major data grid solutions.
✔   Integrated with the Spring Framework.
Map / Reduce in Grid Gain

               -1-
               Task arrives to the first grid node, where is
               split into three jobs.
               First job is self-assigned and processed.
               -2-
               Second job is sent to the second grid node,
               where is processed.
               -3-
               Third job is sent to a the third grid node,
               where is processed.
               -4-
               Result from the second job is collected by
               the task on the first node.
               -5-
               Result from the third job is collected by the
               task on the first node.
               -6-
               Collected job results, together with the
               result from the first job, are reduced by the
               task and returned as a global result.
Grid Gain Quick Start
✔   GridTask.
    ➔   Implements the Map / Reduce logic.
✔   GridJob.
    ➔   Implements the processing logic.
✔   GridFactory.
    ➔   Provides access to the grid for executing tasks.
✔   Automatic deployment.
    ➔   Tasks are automatically deployed to the grid.
✔   Peer class loading.
    ➔   Needed classes are automatically loaded from peers.
Grid Gain Advanced
✔   SPI (Service Provider Interface) based configuration.
    ➔   Discovery SPI.
    ➔   Topology SPI.
    ➔   Checkpoint SPI.
    ➔   Load Balancing SPI.
    ➔   Collision SPI.
    ➔   Failover SPI.
    ➔   Metrics SPI.
    ➔   ...
Entering Spring Framework

The leading full-stack Java/JEE application framework.
Grid Gain on Spring


✔   POJO configuration.
✔   AOP grid execution.
✔   Resource Look-up.
Spring-based configuration
✔   POJO-based.
✔   Spring-based.
✔   GridConfiguration
    ➔   Configure grid parameters.
    ➔   Configure actual SPI implementations.
    ➔   Declared as a Spring bean.
✔   GridFactory
    ➔   GridFactory.start(GridConfiguration cfg)
    ➔   GridFactory.start(String springCfg)
AOP-based grid execution
✔   Parallelization on grid as a cross-cutting concern.
✔   Transparent task deployment and execution.
✔   Gridify
    ➔   Annotation to identify methods that must be executed
        on grid.
✔   GridifySpringEnhancer
    ➔   Proxy-based enhancer for executing annotated object
        methods on grid as an aspect.
Container-based resource look-
                 up.
✔   Spring application context as a source for resources
    needed by tasks and jobs.
✔   GridSpringApplicationContextResource
    ➔   Annotation for injecting the Spring application context
        into tasks and jobs.
✔   GridFactory.start(GridConfiguration cfg,
    ApplicationContext springCtx)
    ➔   Starts grid with a specific context to use for looking-up
        resources.
An Example
The Business Problem
An Example
The Grid Task
An Example
The Grid Job
An Example
Grid Configuration
An Example
Grid Starter
An Example
Grid Tester (...)
An Example
Grid Tester (... continued)
Q&A
Thank you
       Sergio Bossa
   s.bossa@pronetics.it
s.bossa@sourcesense.com

Mais conteúdo relacionado

Mais procurados

Apache Beam and Google Cloud Dataflow - IDG - final
Apache Beam and Google Cloud Dataflow - IDG - finalApache Beam and Google Cloud Dataflow - IDG - final
Apache Beam and Google Cloud Dataflow - IDG - final
Sub Szabolcs Feczak
 
The Future starts with a Promise
The Future starts with a PromiseThe Future starts with a Promise
The Future starts with a Promise
Alexandru Nedelcu
 

Mais procurados (20)

Collecting metrics with Graphite and StatsD
Collecting metrics with Graphite and StatsDCollecting metrics with Graphite and StatsD
Collecting metrics with Graphite and StatsD
 
Google Cloud Dataflow meets TensorFlow
Google Cloud Dataflow meets TensorFlowGoogle Cloud Dataflow meets TensorFlow
Google Cloud Dataflow meets TensorFlow
 
Resource Scheduling using Apache Mesos in Cloud Native Environments
Resource Scheduling using Apache Mesos in Cloud Native EnvironmentsResource Scheduling using Apache Mesos in Cloud Native Environments
Resource Scheduling using Apache Mesos in Cloud Native Environments
 
GCPUG.TW - GCP學習資源分享
GCPUG.TW - GCP學習資源分享GCPUG.TW - GCP學習資源分享
GCPUG.TW - GCP學習資源分享
 
Scaling Graphite At Yelp
Scaling Graphite At YelpScaling Graphite At Yelp
Scaling Graphite At Yelp
 
Building Robust Pipelines with Airflow
Building Robust Pipelines with AirflowBuilding Robust Pipelines with Airflow
Building Robust Pipelines with Airflow
 
Apache Beam and Google Cloud Dataflow - IDG - final
Apache Beam and Google Cloud Dataflow - IDG - finalApache Beam and Google Cloud Dataflow - IDG - final
Apache Beam and Google Cloud Dataflow - IDG - final
 
Using A100 MIG to Scale Astronomy Scientific Output
Using A100 MIG to Scale Astronomy Scientific OutputUsing A100 MIG to Scale Astronomy Scientific Output
Using A100 MIG to Scale Astronomy Scientific Output
 
Intro to Airflow: Goodbye Cron, Welcome scheduled workflow management
Intro to Airflow: Goodbye Cron, Welcome scheduled workflow managementIntro to Airflow: Goodbye Cron, Welcome scheduled workflow management
Intro to Airflow: Goodbye Cron, Welcome scheduled workflow management
 
The Future starts with a Promise
The Future starts with a PromiseThe Future starts with a Promise
The Future starts with a Promise
 
Cloud native java script apps
Cloud native java script appsCloud native java script apps
Cloud native java script apps
 
Airflow at WePay
Airflow at WePayAirflow at WePay
Airflow at WePay
 
BlazingSQL & Graphistry - Netflow Demo
BlazingSQL & Graphistry - Netflow DemoBlazingSQL & Graphistry - Netflow Demo
BlazingSQL & Graphistry - Netflow Demo
 
Hadoop & Spark Performance tuning using Dr. Elephant
Hadoop & Spark Performance tuning using Dr. ElephantHadoop & Spark Performance tuning using Dr. Elephant
Hadoop & Spark Performance tuning using Dr. Elephant
 
Unlimited Virtual Computing Capacity using the Cloud for Automated Parameter ...
Unlimited Virtual Computing Capacity using the Cloud for Automated Parameter ...Unlimited Virtual Computing Capacity using the Cloud for Automated Parameter ...
Unlimited Virtual Computing Capacity using the Cloud for Automated Parameter ...
 
AWS re:Invent 2014 talk: Scheduling using Apache Mesos in the Cloud
AWS re:Invent 2014 talk: Scheduling using Apache Mesos in the CloudAWS re:Invent 2014 talk: Scheduling using Apache Mesos in the Cloud
AWS re:Invent 2014 talk: Scheduling using Apache Mesos in the Cloud
 
Airflow Clustering and High Availability
Airflow Clustering and High AvailabilityAirflow Clustering and High Availability
Airflow Clustering and High Availability
 
Device status anomaly detection
Device status anomaly detectionDevice status anomaly detection
Device status anomaly detection
 
Graphs as Streams: Rethinking Graph Processing in the Streaming Era
Graphs as Streams: Rethinking Graph Processing in the Streaming EraGraphs as Streams: Rethinking Graph Processing in the Streaming Era
Graphs as Streams: Rethinking Graph Processing in the Streaming Era
 
Graphite
GraphiteGraphite
Graphite
 

Semelhante a Gridify your Spring application with Grid Gain @ Spring Italian Meeting 2008

Rails Conf Europe 2007 Notes
Rails Conf  Europe 2007  NotesRails Conf  Europe 2007  Notes
Rails Conf Europe 2007 Notes
Ross Lawley
 
[Roblek] Distributed computing in practice
[Roblek] Distributed computing in practice[Roblek] Distributed computing in practice
[Roblek] Distributed computing in practice
javablend
 

Semelhante a Gridify your Spring application with Grid Gain @ Spring Italian Meeting 2008 (20)

Lightweight Grids With Terracotta
Lightweight Grids With TerracottaLightweight Grids With Terracotta
Lightweight Grids With Terracotta
 
DOSUG GridGain Java Grid Computing Made Simple
DOSUG GridGain Java Grid Computing Made SimpleDOSUG GridGain Java Grid Computing Made Simple
DOSUG GridGain Java Grid Computing Made Simple
 
GridGain - Java Grid Computing Made Simple
GridGain - Java Grid Computing Made SimpleGridGain - Java Grid Computing Made Simple
GridGain - Java Grid Computing Made Simple
 
Castles in the Cloud: Developing with Google App Engine
Castles in the Cloud: Developing with Google App EngineCastles in the Cloud: Developing with Google App Engine
Castles in the Cloud: Developing with Google App Engine
 
Deep Learning on AWS (November 2016)
Deep Learning on AWS (November 2016)Deep Learning on AWS (November 2016)
Deep Learning on AWS (November 2016)
 
Rails Conf Europe 2007 Notes
Rails Conf  Europe 2007  NotesRails Conf  Europe 2007  Notes
Rails Conf Europe 2007 Notes
 
[Roblek] Distributed computing in practice
[Roblek] Distributed computing in practice[Roblek] Distributed computing in practice
[Roblek] Distributed computing in practice
 
Empowering the AWS DynamoDB™ application developer with Alternator
Empowering the AWS DynamoDB™ application developer with AlternatorEmpowering the AWS DynamoDB™ application developer with Alternator
Empowering the AWS DynamoDB™ application developer with Alternator
 
Profiling & Testing with Spark
Profiling & Testing with SparkProfiling & Testing with Spark
Profiling & Testing with Spark
 
Galaxy
GalaxyGalaxy
Galaxy
 
Smuggling Multi-Cloud Support into Cloud-native Applications using Elastic Co...
Smuggling Multi-Cloud Support into Cloud-native Applications using Elastic Co...Smuggling Multi-Cloud Support into Cloud-native Applications using Elastic Co...
Smuggling Multi-Cloud Support into Cloud-native Applications using Elastic Co...
 
Gatling - Stress test tool
Gatling - Stress test toolGatling - Stress test tool
Gatling - Stress test tool
 
Gatling
GatlingGatling
Gatling
 
Ten practical ways to improve front-end performance
Ten practical ways to improve front-end performanceTen practical ways to improve front-end performance
Ten practical ways to improve front-end performance
 
Deep Dive: Amazon EC2 Elastic GPUs - May 2017 AWS Online Tech Talks
Deep Dive: Amazon EC2 Elastic GPUs - May 2017 AWS Online Tech TalksDeep Dive: Amazon EC2 Elastic GPUs - May 2017 AWS Online Tech Talks
Deep Dive: Amazon EC2 Elastic GPUs - May 2017 AWS Online Tech Talks
 
Deep Dive on Amazon EC2 Elastic GPUs - May 2017 AWS Online Tech Talks
Deep Dive on Amazon EC2 Elastic GPUs - May 2017 AWS Online Tech TalksDeep Dive on Amazon EC2 Elastic GPUs - May 2017 AWS Online Tech Talks
Deep Dive on Amazon EC2 Elastic GPUs - May 2017 AWS Online Tech Talks
 
10 things i wish i'd known before using spark in production
10 things i wish i'd known before using spark in production10 things i wish i'd known before using spark in production
10 things i wish i'd known before using spark in production
 
Spark: The State of the Art Engine for Big Data Processing
Spark: The State of the Art Engine for Big Data ProcessingSpark: The State of the Art Engine for Big Data Processing
Spark: The State of the Art Engine for Big Data Processing
 
vega
vegavega
vega
 
AWS (Hadoop) Meetup 30.04.09
AWS (Hadoop) Meetup 30.04.09AWS (Hadoop) Meetup 30.04.09
AWS (Hadoop) Meetup 30.04.09
 

Mais de Sergio Bossa

Terrastore - A document database for developers
Terrastore - A document database for developersTerrastore - A document database for developers
Terrastore - A document database for developers
Sergio Bossa
 
Clustering In The Wild
Clustering In The WildClustering In The Wild
Clustering In The Wild
Sergio Bossa
 

Mais de Sergio Bossa (8)

To be relational, or not to be relational? That's NOT the question!
To be relational, or not to be relational? That's NOT the question!To be relational, or not to be relational? That's NOT the question!
To be relational, or not to be relational? That's NOT the question!
 
Three Languages in Thirty Minutes
Three Languages in Thirty MinutesThree Languages in Thirty Minutes
Three Languages in Thirty Minutes
 
Terrastore - A document database for developers
Terrastore - A document database for developersTerrastore - A document database for developers
Terrastore - A document database for developers
 
Actor concurrency for the JVM: a case study
Actor concurrency for the JVM: a case studyActor concurrency for the JVM: a case study
Actor concurrency for the JVM: a case study
 
Scalable Databases - From Relational Databases To Polyglot Persistence
Scalable Databases - From Relational Databases To Polyglot PersistenceScalable Databases - From Relational Databases To Polyglot Persistence
Scalable Databases - From Relational Databases To Polyglot Persistence
 
Scale Your Database And Be Happy
Scale Your Database And Be HappyScale Your Database And Be Happy
Scale Your Database And Be Happy
 
Clustering In The Wild
Clustering In The WildClustering In The Wild
Clustering In The Wild
 
Real Terracotta
Real TerracottaReal Terracotta
Real Terracotta
 

Último

Último (20)

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
 
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...
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
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...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
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
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
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, ...
 
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
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
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
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
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
 
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)
 

Gridify your Spring application with Grid Gain @ Spring Italian Meeting 2008

  • 1. Gridify your Spring application with Grid Gain Sergio Bossa Pro-Netics / Sourcesense
  • 2. About me ✔ Software architect and engineer ➔ Pro-Netics (http://www.pronetics.it) ➔ Sourcesense (http://www.sourcesense.com) ✔ Blogger ➔ http://sbtourist.blogspot.com ✔ Open Source Enthusiast ➔ Lead at Scarlet - Clustering for Jira (http://scarlet.sf.net) ➔ Committer at Spring Modules (http://springmodules.dev.java.net) ➔ Committer at Taconite Ajax Framework (http://taconite.sourceforge.net/)
  • 3. Agenda ✔ Common ground. ➔ Why Grid? ➔ Performance and Scalability. ➔ Map / Reduce. ✔ Grid Gain and The Spring Framework. ➔ Grid Gain concepts. ➔ Grid Gain on Spring. ➔ A practical example.
  • 4. Why grid? Social changes ✔ Cheaper hardware. ➔ Computer as an off-the-shelf product. ✔ Web explosion. ➔ Everything is on the web. ➔ Everyone is on the web. ➔ More and more users. ➔ More and more transactions.
  • 5. Why grid? Technological changes ✔ Cheaper hardware. ➔ We have more power. ➔ We want more speed. ✔ Moore's Law: the number of transistors that can be inexpensively placed on an integrated circuit is increasing exponentially. ➔ But we had to go from single-core processors to multi- core ones ... ➔ So your for-loop will always run at the same speed. ➔ Forever.
  • 7. Performance It's all about doing one thing. Faster.
  • 8. Scalability It's all about doing the same one thing. In a bigger way.
  • 9. Performance vs Scalability ✔ Performance is about how fast. ✔ Scalability is about how much. ✔ Nowadays, if you want to save your job and hears (remember that Boss screaming at your face) ... ➔ You have to scale.
  • 10. Scalability in two words ✔ Vertical scalability is about adding more and more power (CPU, RAM ...) to your single computer. ➔ Also known as scaling-in. ➔ Finite and costly. ✔ Horizontal scalability is about adding more and more computers. ➔ Also known as scaling-out. ➔ Infinite and cheaper, because using commodity hardware. ✔ Guess what, we want to scale-out ...
  • 11. The scalability factor ✔ Available resources while scaling out. ➔ Linear scalability. ➔ Supra-linear scalability. ➔ Sub-linear scalability. ➔ Negative scalability. ✔ A scalable application should always strive for (almost) linear scalability.
  • 12. The scalability problem ✔ Amdahl's Law: performance decreases as number of processors increases once there is even a small percentage of non-parallelizable code. ➔ Most of the software is written in a non-parallelizable way. ➔ Writing software that scales out is perceived as hard.
  • 13. Entering Map / Reduce ✔ From Google Labs. ➔ Is it enough?
  • 14. Map / Reduce explained ✔ Programming model for linearly scaling out. ✔ De-facto standard for parallelizing intensive processing tasks. ✔ Based on: ➔ Splitting tasks into several parallelizable jobs grouped by key. ➔ Mapping jobs to processing units, optionally taking into account the job key. ➔ Merging jobs results, joining them into a global task result.
  • 15. Map / Reduce illustrated Counting words
  • 16. Grid computing with Map / Reduce ✔ Grid computing. ➔ Basically, a way to exploit multi-core / multi- processors / multi-computer environments for achieving horizontal scalability. ✔ Map / Reduce. ➔ Common paradigm in grid computing for implementing scalable applications.
  • 17. Entering Grid Gain ✔ Open Source Grid Computing Framework. ➔ Web : http://www.gridgain.com ➔ Created and supported by Grid Gain Systems. ➔ Community support. ➔ Professional support. ✔ Powerful, yet simple, yet fun, Map / Reduce implementation. ✔ Integrated with major servlet containers and application servers. ✔ Integrated with major data grid solutions. ✔ Integrated with the Spring Framework.
  • 18. Map / Reduce in Grid Gain -1- Task arrives to the first grid node, where is split into three jobs. First job is self-assigned and processed. -2- Second job is sent to the second grid node, where is processed. -3- Third job is sent to a the third grid node, where is processed. -4- Result from the second job is collected by the task on the first node. -5- Result from the third job is collected by the task on the first node. -6- Collected job results, together with the result from the first job, are reduced by the task and returned as a global result.
  • 19. Grid Gain Quick Start ✔ GridTask. ➔ Implements the Map / Reduce logic. ✔ GridJob. ➔ Implements the processing logic. ✔ GridFactory. ➔ Provides access to the grid for executing tasks. ✔ Automatic deployment. ➔ Tasks are automatically deployed to the grid. ✔ Peer class loading. ➔ Needed classes are automatically loaded from peers.
  • 20. Grid Gain Advanced ✔ SPI (Service Provider Interface) based configuration. ➔ Discovery SPI. ➔ Topology SPI. ➔ Checkpoint SPI. ➔ Load Balancing SPI. ➔ Collision SPI. ➔ Failover SPI. ➔ Metrics SPI. ➔ ...
  • 21. Entering Spring Framework The leading full-stack Java/JEE application framework.
  • 22. Grid Gain on Spring ✔ POJO configuration. ✔ AOP grid execution. ✔ Resource Look-up.
  • 23. Spring-based configuration ✔ POJO-based. ✔ Spring-based. ✔ GridConfiguration ➔ Configure grid parameters. ➔ Configure actual SPI implementations. ➔ Declared as a Spring bean. ✔ GridFactory ➔ GridFactory.start(GridConfiguration cfg) ➔ GridFactory.start(String springCfg)
  • 24. AOP-based grid execution ✔ Parallelization on grid as a cross-cutting concern. ✔ Transparent task deployment and execution. ✔ Gridify ➔ Annotation to identify methods that must be executed on grid. ✔ GridifySpringEnhancer ➔ Proxy-based enhancer for executing annotated object methods on grid as an aspect.
  • 25. Container-based resource look- up. ✔ Spring application context as a source for resources needed by tasks and jobs. ✔ GridSpringApplicationContextResource ➔ Annotation for injecting the Spring application context into tasks and jobs. ✔ GridFactory.start(GridConfiguration cfg, ApplicationContext springCtx) ➔ Starts grid with a specific context to use for looking-up resources.
  • 32. An Example Grid Tester (... continued)
  • 33. Q&A
  • 34. Thank you Sergio Bossa s.bossa@pronetics.it s.bossa@sourcesense.com