• Like
  • Save
Scaling Your Spring Application on the Cloud
Upcoming SlideShare
Loading in...5
×
 

Scaling Your Spring Application on the Cloud

on

  • 1,056 views

 

Statistics

Views

Total Views
1,056
Views on SlideShare
1,054
Embed Views
2

Actions

Likes
0
Downloads
20
Comments
0

1 Embed 2

http://www.slideshare.net 2

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Scaling Your Spring Application on the Cloud Scaling Your Spring Application on the Cloud Presentation Transcript

    • Practical Guide for Developing Enterprise Application on the Cloud Nati Shalom CTO GigaSpaces Technologies
    • About GigaSpaces eXtreme Application Platform (XAP) A middleware platform enabling applications to run a distributed cluster as if it was a single machine 2,000+ Deployments Among Top 50 Cloud Vendors 100+ Direct Customers “GigaSpaces exceeded our “GigaSpaces has allowed “GigaSpaces has saved us to greatly improve the performance requirements and us significant time and scalability and enabled us to build a flexible, cost” performance of our trading cost-effective infrastructure” platform” Phil Ruhlman, Julian Browne, Geoff Buhn, CIO, Gallup Virgin Mobile Options Trading Technology Manager, SIG
    • Business motivation • IT CAN’T KEEP UP WITH THE DEMANDS OF THE BUSINESS – Capacity planning is too difficult – Time to market – The business wants a quick and dirty way to prototype – Cost saving Source: Forrester March 09
    • The ideal world
    • The challenge with existing applications Business tier Web Tier Load Balancer Back-up Back-up Back-up Back-up Data Tier Messaging
    • Challenges summary • Adding additional resources dynamically • No out-of-the-box infrastructure for J2EE • Dealing with a lack of persistence • Dealing with distributed programming models • Having to think about the whole stack. Not just the code. • Using Memory Data Grids and Caching considerations • Messaging • Understanding configuration management tools • Pricing and licensing Source: Cloud Mailing List
    • How users deal with the current challenges • Deploy multiple Web servers • Deploy multiple load balancers • Deploy several database servers. • Another way of dealing with databases is to not use them Source Grig Gheorghiu blog: Experiences deploying a large-scale infrastructure in Amazon EC2 •Requires a lot of effort in setting up the environment. •Doesn’t cover all the challenges
    • Meeting the challenges • Adding additional resources dynamically – Through virtualization of the middleware stack • Dealing with a lack of persistence – Using IMDG as a front end to the database • Dealing with distributed programming models – Use Remoting abstraction to simplify the distributed programming model • Having to think about the whole stack. Not just the code. – Use one common runtim and clustering across the entire stack • Using Memory Data Grids and Caching considerations – Make IMDG pluggable and simple to integrate with • Messaging – Use messaging over IMDG to enable seamless distribution of the messaging • Understanding configuration management tools – Add built-in monitoring and management with the deployment – Automate deployment, scaling, fail-over to avoid minimal processes • No out-of-the-box infrastructure for J2EE – Support JEE as a first class citizen • Pricing and licensing – Elastic pricing (The Amazon model) - pay-per use, reserved instances (subscription, perpetual)
    • Expected result Web Business Processing Processing Units Units Load Balancer Users DB Virtualize the Entire Application Stack
    • Solution Guidelines • Avoid radical change, enabling a gradual process • Choose an architecture supporting linear scalability • Minimize vendor lock-in – Enable application portability and freedom of choice of: • cloud provider, web container, programming language, database – Minimize API lock in: • Use of standards • API Abstractions – when standards are not available • Future proof your application - Don’t make decision today, but be ready to make one without major effort - Avoid long-term commitment – choose the right licensing model
    • Practical Steps Value IMDG as Messaging System over IMDG of Record Remoting Web Tier over IMDG Effort On-demand Partitioned Partitioned Parallel Processing Architecture provisioning vs. vs. client-server virtualized servers virtualized servers static, peak-based vs. central server vs. central server Savings 7 machines 90 machines 6x machines 6x machines Examples (10 peak – 3 avg) (100 peak, 10 avg)  Automatic failover  Self-healing  Fast& Consistent  Map/Reduce  Commodity HW Additional  Basic caching response time.  Async invocation Low latency (in- Benefits  Auto deployment  Commodity db  Location memory) vs. high-end transparency
    • Step 1: Add Self Healing and Dynamic Scaling • Dynamic scaling is the ability to: – Increase (or decrease) your application’s capacity at will, on the fly, and with no down-time • Without code changes, use a standard JEE web app • Self healing is the ability to: – Automatically recover from failure conditions (AKA failover) and restore the system to its previous state
    • Step 1: Add Self Healing and Dynamic Scaling • Deploy the web application on to the GigaSpaces SLA driven environment • Integrate with a load balancer to enable dynamic update of cluster state
    • Step 2: Add Auto Scaling Support • Auto-scaling is the ability to: • Automatically apply dynamic scaling based on SLA rules (CPU/Memory utilization, requests/sec, etc) • Use the GigaSpaces SLA driven environment to monitor the application – Web requests, CPU, memory, any other relevant stats
    • Step 2: Add Auto Scaling Support • Use simple Java/Groovy code to trigger auto-scaling – Deploy code as a reliable service in the GigaSpaces SLA driven environment – When the SLA is breached (e.g. average number of requests per container crosses 100/Sec): • Instruct the environment to increase the number of instances
    • Step 2: Add Auto Scaling Support • Calculating average request rate (Groovy): • Scaling up (Groovy):
    • Step 2: Add Auto Scaling Support
    • Deploying on the cloud using CCF4 XAP MT Application Provisioning 2)Deploy Application 3)Manage Deployment Configuration 1)Install Provision IaaS Provider (EC2, GoGrid, VMWhere, Citrix,..) Application Repository App A App B
    • Application Deployment Configuration <cloud-config> <cloud-name>my-app</cloud-name> Amount of machines to <gsc-numof-machines>10</gsc-numof-machines> start initially <gsc-per-machine>1</gsc-per-machine> <alternate-s3-source-dir>myapplicationfiles</..> Application Repository <gigaspaces-version-id>662ga3100ct233</…> <processing-units> <processing-unit> Application To deploy <name>$CPD/myApp.war</name> <deploy-options/> </processing-unit> </processing-units> </cloud-config>
    • GigaSpaces Cloud Customers • Large UK Telco Company – Deploying discrete stand alone services in the Cloud – More cost effective; easier to outsource; enabled by secure service interface • Large Global Telco Company – Deploying carrier grade VOIP service to the Cloud – New SaaS business model; New revenue stream • Global Media Company – Using the Cloud to process events for innovative new TV programme – Cloud makes concept cost effective • Financial Services Start-up – Using the Cloud for a trading exchange – Cloud lowers barrier to entry and makes proposition possible • Online Gaming Company – Using the Cloud for testing and scaling – Able to test large scale user support early / easy on cloud, hard otherwise
    • Key Takeaways • Enterprise applications can run on the cloud today: – No need to re-write your application – Preventing lock-in to specific cloud provider – Enabling seamless portability between your local environment to cloud environment • Choose simple applications first – Avoid dealing with complex security issues – Application with Clear path to ROI (Fluctuating load, large scale testing, DR,..)
    • GigaSpaces XAP 7.0 (EA): http://www.gigaspaces.com/wiki/display/RN/GigaSpaces+7.0.0+Early+Acces GigaSpaces XAP Product Overview: http://www.gigaspaces.com/wiki/display/XAP7/Concepts GigaSpaces XAP for Web Applications: http://www.gigaspaces.com/wiki/display/XAP66/Scaling+Your+Web+Application Try It Today on the Cloud http://www.gigaspaces.com/mycloud http://www.gigaspaces.com/mycloud-stg