400 likes | 521 Views
Building Modular Enterprise Applications in the Cloud Age. Bert Ertman Fellow at Luminis in the NetherlandsJUG Leader for NLJUG and a Java Champion. @BertErtman. Paul Bakker Architect at Luminis Technologies. @pbakker. Trend Applications tend to grow bigger and more complex
E N D
Bert ErtmanFellow at Luminis in the NetherlandsJUG Leader for NLJUG and a Java Champion • @BertErtman Paul BakkerArchitect at Luminis Technologies @pbakker
Trend • Applications tend to grow bigger and more complex • Agile development and refactoring have become more common
This leads to a number of challenges : Dependency Management Versioning Maintenance (long term) Deployment
Apps are moving to the cloud • Cloud challenges require non-trivial non-functional requirements • Zero-downtime deploymentsModular deployments • Customer specific extensions (SaaS)
Modularity is the answer
What we learned about OO design in university : Promote cohesion Prevent (tight) coupling cohesion coupling
interfaces How to prevent coupling in a code base?
imp lemen tation hi di ng But how to make sure nobody accidentally uses implementation classes?
Ok, but how to create an instance of a hidden class? MyInterface myI = new MyImplementation();
Design time modularity • Divide and conquer • Forces separation of concerns • Prevents spaghetti
The jar file is the unit of runtime modularity on the Java platform What about classpath hell?
How to deal with • Runtime dynamics • Module versioning • Updating single modules • Intra-module dependency management
Runtime dynamic module framework design consequences Architectural focus on modularity What do we need? let’s not reinvent the wheel High-level enterprise APIs Right now, OSGi is the only option
Modularity does not come for free with a framework remember! Modularity is an architectural principle OSGi != modularity OSGi is the de-facto standard module system for Java What about Jigsaw?
Re: Cloud Applications • Some characteristics: • Application as a service over the internet • Impact on some non-trivial non-functionals • Availability • Scalability • Extensibility
HTML 5 + JavaScript RESTful services OSGi services Apache Felix Typical architecture • Requirements: • Modern web app • UI mostly offloaded to clients or devices • Document driven interaction • Integration via REST API • Web scale data store • Multi-tenant • Elasticity
PaaS Offerings out there: • Not good: • Proprietary platform • Vendor lock-in • White list / black list • No support for modular runtime
Solution: roll our own PaaS • Modular PaaS: • IaaS image • OSGi runtime • Deployment/provisioning • PaaS Building blocks • Pro: • freedom • Con: • no vendor support Amazon EC2 Apache Felix Apache ACE ???
Components • Auth • Blob stores • MongoDB • Multi-tenancy • OpenSocial • Search • Remote Services • REST • Template • Web • ...
HTML 5 + JavaScript RESTful services OSGi services Apache Felix A m d a t u Typical architecture • Let’s Add AMDATU to our stack • Architectural focus on modularity • Runtime dynamic services • High level API
Apache Ace - demo - What about deployment?
Auto scaling Enough capacity Without paying for idle servers at night...
node node node node node node Mongo Mongo Mongo Mongo Mongo Mongo Load Balancer Availability Zone 2 Availability Zone 1
Node AWS Auto Scaling Load Balancer Apache ACE Auto scaling 1. Start 2. register 3. register 4. provision deployment package
What have we learned? • Why modularity is important (in the cloud) • Practical solution for doing modularity now • using an Open Source development stack • using ready to use Cloud Components • We are using this for high-profile production applications!
VERY Recommended reading ;) • Available NOW! • Book signing Tue 14.30 @ O’Reilly Booth • (JavaOne Pavillion) • Free books for the early birds...
Cloud provisioning http://ace.apache.org/ Cloud OSGi services http://www.amdatu.org/ Bert Ertman bert.ertman@luminis.eu @BertErtman Amdatu That’s us http://luminis.eu/ Eclipse OSGi plugin http://bndtools.org/ Paul Bakker paul.bakker@luminis.eu @pbakker
Merci Mahalo Danke Dank U Grazie Takk Obrigado Thank you Gracias