Building Modular Cloud Applications in Java - Lessons Learned

  • 3,065 views
Uploaded on

Over the past couple of years we have been building large scale Java applications and deployed them in the cloud. While dealing with typical cloud issues such as auto scaling, failover, and …

Over the past couple of years we have been building large scale Java applications and deployed them in the cloud. While dealing with typical cloud issues such as auto scaling, failover, and incremental deployments we meanwhile had to refactor them for significant functional changes.

Being able to deal with change and dynamics are important reasons for companies to resort to the cloud for application development. Short time to market and rapidly changing requirements can lead to experimental software design however. Dealing with constant change in a codebase is non-trivial. In order to facilitate much change a modular codebase is of great importance.

In this talk we will show you what we have learned on how to create modular Java applications and how to deploy them in the cloud using an Open Source approach without locking into one of the PaaS providers. We will discuss OSGi, scalable web application architecture, and Apache ACE for deployment and provisioning.

More in: Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
No Downloads

Views

Total Views
3,065
On Slideshare
0
From Embeds
0
Number of Embeds
5

Actions

Shares
Downloads
39
Comments
0
Likes
7

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. Building ModularCloud Applicationsin JavaLessons Learned
  • 2. Bert ErtmanFellow at Luminis in the NetherlandsJUG Leader for NLJUG and a Java ChampionPaul BakkerArchitect at Luminis Technologies@BertErtman@pbakker a presentation for
  • 3. The casePulseOnEducational systemfocussed on personalizedlearningUsed in high schools inthe NetherlandsExpand to other countriesin the near future
  • 4. Re: Cloud ApplicationsSome characteristics:Application as a service over the internetImpact on some non-trivial non-functionalsAvailabilityScalabilityExtensibility
  • 5. ObservationsExtremely agileArchitecture (and code base) shouldbe able to cope with change
  • 6. The case for modularityModularity is theultimate agile tool!Small, disposable, componentsPrevents code rot on thearchitectural levelIsolate problems, focus work
  • 7. Prevent(tight)couplingWhat we learned about OO design in university :Promotecohesioncouplingcohesion
  • 8. Whatdoweneed?designconsequencesHigh-levelenterprise APIsArchitecturalfocus onmodularityRuntimedynamicmoduleframeworkRight now,OSGi is theonly optionlet’s notreinvent thewheel
  • 9. OSGi is the de-factostandard modulesystem for JavaOSGi != modularityWhat about Jigsaw?
  • 10. OSGi is the de-factostandard modulesystem for JavaOSGi != modularityWhat about Jigsaw?remember!Modularity isan architecturalprinciple
  • 11. OSGi is the de-factostandard modulesystem for JavaOSGi != modularityWhat about Jigsaw?remember!Modularity isan architecturalprincipleModularitydoes not comefor free with aframework
  • 12. demo
  • 13. Profiles RestProfiles APIProfilesServiceMongoDBProgress RestProgress APIProgressServiceMongoDBCurriculumAPICurriculumServiceMongoDB... Rest... API...Servicemodularityin action...
  • 14. Back to the cloud...
  • 15. HTML 5 + JavaScriptRESTful servicesOSGi servicesMongoApache FelixS3Typical architectureRequirements:Modern web appUI mostly offloaded toclients or devicesDocument driveninteractionIntegration via RESTAPIWeb scale data storeMulti-tenantElasticity
  • 16. HTML 5 + JavaScriptRESTful servicesOSGi servicesMongoApache FelixAmdatuS3Typical architectureLet’s Add AMDATUto our stackArchitectural focuson modularityRuntime dynamicservicesHigh level API
  • 17. AuthBlob storesMongoDBMulti-tenancyOpenSocialSearchRemote ServicesRESTTemplateWeb...Components
  • 18. What aboutdeployment?
  • 19. PaaS Offerings out there:Not good:Proprietary platformVendor lock-inWhite list / black listOS LimitationsNo support for modularruntime
  • 20. Solution: roll our own PaaSModular PaaS:IaaS imageOSGi runtimeDeployment/provisioningPaaS Building blocksPro:freedomCon:no vendor supportAmazon EC2Apache FelixApache ACEAmdatu
  • 21. DeploymentLoadLoad BalancerPulseOn nodePulseOn nodePulseOn nodeSchool AMongoMongoMongoLoadLoad BalancerPulseOn nodePulseOn nodePulseOn nodeSchool BMongoMongoMongo
  • 22. Availability zones
  • 23. Horizontal scaling requires stateless nodesHTML5 clients need less server side stateAny state should go to some kind of storeHorizontal scalability
  • 24. Auto scalingConsiderable higher loads during school hoursEnoughcapacityWithout payingfor idle serversat night...
  • 25. Load Balancer small nodeCluster per schoolAlways use a load balancer because we don’t wantdowntime during scaling
  • 26. Early morning...Load Balancer small node
  • 27. Early morning...Load Balancer small nodelarge nodelarge node
  • 28. End of the day...Load Balancer small nodelarge nodelarge node
  • 29. End of the day...Load Balancer small node
  • 30. But how do we installour software on a node?
  • 31. Some numbers190bundlesin a deployment120PulseOnbundles
  • 32. Provisioning servers
  • 33. Provisioning serversNodeAWS Auto Scaling1. StartLoad BalancerApache ACE2. register3. register4. provisiondeploymentpackage
  • 34. ./as-­‐create-­‐launch-­‐config  demo            -­‐-­‐image-­‐id  ami-­‐0ee8e07a            -­‐-­‐instance-­‐type  m1.small            -­‐-­‐region  eu-­‐west-­‐1            -­‐-­‐group  sg-­‐ce1420ba            -­‐-­‐user-­‐data-­‐file  userdata.txt./as-­‐create-­‐auto-­‐scaling-­‐group  demo          -­‐-­‐launch-­‐configuration  demo          -­‐-­‐min-­‐size  1          -­‐-­‐max-­‐size  1          -­‐-­‐availability-­‐zones  eu-­‐west-­‐1a          -­‐-­‐load-­‐balancers  demo          -­‐-­‐tag  "k=Name,v=demo,p=true"
  • 35. Or by UI configuration...
  • 36. Provisioning serversNodes are completely disposableAutomated cluster recoveryNodes do not require maintenanceNo “big” container
  • 37. Developer Tools
  • 38. Educational system focussed onpersonalized learningUsed in high schools in theNetherlandsExpand to other countries in thenear futureDevelopment tool stackIDE with fast turn aroundsVersion ControlContinuous Integration ServerIssue trackerWIKIwhat do we need?
  • 39. Continuous integrationAll BndTools projects supportheadless buildsBuild on git pushMeasure test coverage(both unit and integration tests)
  • 40. Wrap up
  • 41. what have we learned?Modularity is the ultimate agile toolModularity is no longer difficult(BndTools / Amdatu)Stateless architecture is the onlyscalable wayCloud deployments made easy with aprovisioning server
  • 42. Shameless self-promotion...Our bookBuilding Modular CloudApplications in JavaPublished by O’ReillyDue: end of summer this yearunderconstruction
  • 43. Want to try this yourself?Tomorrow: 10 AM - 12.30Hands-on Lab:Building Modular Cloud Applications in JavaVenue: Hotel Wyspiańskiul.Westerplatte 1531-033 Kraków
  • 44. Cloud provisioninghttp://ace.apache.org/Eclipse OSGi pluginhttp://bndtools.org/That’s ushttp://luminis.eu/Bert Ertmanbert.ertman@luminis.eu@BertErtmanCloud OSGi serviceshttp://www.amdatu.org/AmdatuPaul Bakkerpaul.bakker@luminis.eu@pbakker
  • 45. TakkGrazieThankyouObrigadoMahaloDankeDank UMerciGracias