building modular java applications for the cloud€¦ · runtime dynamic services high level api....

33
Building Modular Java Applications for the Cloud

Upload: others

Post on 17-Oct-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Building Modular Java Applications for the Cloud€¦ · Runtime dynamic services High level API. Demo. What about deployment? Provisioning Server. Demo. Auto scaling Enough capacity

Building Modular Java Applications

for the Cloud

Page 3: Building Modular Java Applications for the Cloud€¦ · Runtime dynamic services High level API. Demo. What about deployment? Provisioning Server. Demo. Auto scaling Enough capacity

Observations !

Extremely agile (first mover advantage)

!Architecture (and code base)

should be able to cope with change

Trend !

Applications tend to grow bigger and more complex !Agile development and refactoring have become more common

Page 4: Building Modular Java Applications for the Cloud€¦ · Runtime dynamic services High level API. Demo. What about deployment? Provisioning Server. Demo. Auto scaling Enough capacity

This leads to a number of challenges :

Maintenance (long term)

Versioning Dependency

Management

Deployment

Page 5: Building Modular Java Applications for the Cloud€¦ · Runtime dynamic services High level API. Demo. What about deployment? Provisioning Server. Demo. Auto scaling Enough capacity
Page 6: Building Modular Java Applications for the Cloud€¦ · Runtime dynamic services High level API. Demo. What about deployment? Provisioning Server. Demo. Auto scaling Enough capacity

Modularity is the answer

Page 7: Building Modular Java Applications for the Cloud€¦ · Runtime dynamic services High level API. Demo. What about deployment? Provisioning Server. Demo. Auto scaling Enough capacity

The case for modularity

Modularity is the ultimate agile tool!

!Small, disposable, components !Prevents code rot on the architectural level !Isolate problems, focus work

Page 8: Building Modular Java Applications for the Cloud€¦ · Runtime dynamic services High level API. Demo. What about deployment? Provisioning Server. Demo. Auto scaling Enough capacity

Prevent (tight)

coupling

What we learned about OO design in university :

Promote cohesion

coupling

cohesion

Page 9: Building Modular Java Applications for the Cloud€¦ · Runtime dynamic services High level API. Demo. What about deployment? Provisioning Server. Demo. Auto scaling Enough capacity

How to prevent coupling in a code

base?

Page 10: Building Modular Java Applications for the Cloud€¦ · Runtime dynamic services High level API. Demo. What about deployment? Provisioning Server. Demo. Auto scaling Enough capacity

How to prevent coupling in a code

base?

interfaces

Page 11: Building Modular Java Applications for the Cloud€¦ · Runtime dynamic services High level API. Demo. What about deployment? Provisioning Server. Demo. Auto scaling Enough capacity

But how to make sure nobody

accidentally uses implementation

classes?

Page 12: Building Modular Java Applications for the Cloud€¦ · Runtime dynamic services High level API. Demo. What about deployment? Provisioning Server. Demo. Auto scaling Enough capacity

But how to make sure nobody

accidentally uses implementation

classes?

imp lemen tation

hi di ng

Page 13: Building Modular Java Applications for the Cloud€¦ · Runtime dynamic services High level API. Demo. What about deployment? Provisioning Server. Demo. Auto scaling Enough capacity

Ok, but how to create an instance of a hidden

class?

MyInterface myI = new MyImplementation();

Page 14: Building Modular Java Applications for the Cloud€¦ · Runtime dynamic services High level API. Demo. What about deployment? Provisioning Server. Demo. Auto scaling Enough capacity

Modules Service Lookups

Page 15: Building Modular Java Applications for the Cloud€¦ · Runtime dynamic services High level API. Demo. What about deployment? Provisioning Server. Demo. Auto scaling Enough capacity

Stop talking… and show me code!

Page 16: Building Modular Java Applications for the Cloud€¦ · Runtime dynamic services High level API. Demo. What about deployment? Provisioning Server. Demo. Auto scaling Enough capacity

Back to the cloud...

Page 17: Building Modular Java Applications for the Cloud€¦ · Runtime dynamic services High level API. Demo. What about deployment? Provisioning Server. Demo. Auto scaling Enough capacity

!Application as a Service over the Internet !Cloud challenges require non-trivial non-functional requirements: !

Zero-downtime deployments Modular deployments Customer specific extensions (SaaS)

Apps are moving to the cloud

Page 18: Building Modular Java Applications for the Cloud€¦ · Runtime dynamic services High level API. Demo. What about deployment? Provisioning Server. Demo. Auto scaling Enough capacity

HTML 5 + JavaScript

RESTful services

OSGi services

Mongo

Apache Felix

S3

Typical architectureRequirements: !

Modern web app UI mostly offloaded to clients or devices Document driven interaction Integration via REST API Web scale data store Multi-tenant Elasticity

Page 19: Building Modular Java Applications for the Cloud€¦ · Runtime dynamic services High level API. Demo. What about deployment? Provisioning Server. Demo. Auto scaling Enough capacity

Auth Blob stores MongoDB Multi-tenancy OpenSocial Search Remote Services REST Template Web ...

Components

Page 20: Building Modular Java Applications for the Cloud€¦ · Runtime dynamic services High level API. Demo. What about deployment? Provisioning Server. Demo. Auto scaling Enough capacity

HTML 5 + JavaScript

RESTful services

OSGi services

Mongo

Apache Felix

A m d a t u

S3

Typical architecture

Let’s Add AMDATU to our stack

Architectural focus on modularity Runtime dynamic

services High level API

Page 21: Building Modular Java Applications for the Cloud€¦ · Runtime dynamic services High level API. Demo. What about deployment? Provisioning Server. Demo. Auto scaling Enough capacity

Demo

Page 22: Building Modular Java Applications for the Cloud€¦ · Runtime dynamic services High level API. Demo. What about deployment? Provisioning Server. Demo. Auto scaling Enough capacity

What about deployment?

Page 23: Building Modular Java Applications for the Cloud€¦ · Runtime dynamic services High level API. Demo. What about deployment? Provisioning Server. Demo. Auto scaling Enough capacity

Provisioning Server

Page 24: Building Modular Java Applications for the Cloud€¦ · Runtime dynamic services High level API. Demo. What about deployment? Provisioning Server. Demo. Auto scaling Enough capacity

Demo

Page 25: Building Modular Java Applications for the Cloud€¦ · Runtime dynamic services High level API. Demo. What about deployment? Provisioning Server. Demo. Auto scaling Enough capacity

Auto scaling

Enough capacity

Without paying for idle servers

at night...

Page 26: Building Modular Java Applications for the Cloud€¦ · Runtime dynamic services High level API. Demo. What about deployment? Provisioning Server. Demo. Auto scaling Enough capacity

Load Balancer

nodenode

node

nodenode

node

Availability Zone 1

MongoMongo

Mongo

MongoMongo

Mongo

Availability Zone 2

Page 27: Building Modular Java Applications for the Cloud€¦ · Runtime dynamic services High level API. Demo. What about deployment? Provisioning Server. Demo. Auto scaling Enough capacity

Auto scaling

Node

AWS Auto Scaling

1. Start Load Balancer

Apache ACE

2. register

3. register

4. provision deployment

package

Page 28: Building Modular Java Applications for the Cloud€¦ · Runtime dynamic services High level API. Demo. What about deployment? Provisioning Server. Demo. Auto scaling Enough capacity

Wrap up

Page 29: Building Modular Java Applications for the Cloud€¦ · Runtime dynamic services High level API. Demo. What about deployment? Provisioning Server. Demo. Auto scaling Enough capacity

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!

Page 30: Building Modular Java Applications for the Cloud€¦ · Runtime dynamic services High level API. Demo. What about deployment? Provisioning Server. Demo. Auto scaling Enough capacity
Page 31: Building Modular Java Applications for the Cloud€¦ · Runtime dynamic services High level API. Demo. What about deployment? Provisioning Server. Demo. Auto scaling Enough capacity
Page 33: Building Modular Java Applications for the Cloud€¦ · Runtime dynamic services High level API. Demo. What about deployment? Provisioning Server. Demo. Auto scaling Enough capacity

TakkGrazie

Thank you

Obrigado

MahaloDankeDank U

Merci

Gracias