do you really want to go fully micro?

45
#Devoxx #ApacheSling @rombert Do you really want to go fully micro? Do you really want to go fully micro? Robert Munteanu Adobe

Upload: robert-munteanu

Post on 14-Apr-2017

306 views

Category:

Software


1 download

TRANSCRIPT

Page 1: Do you really want to go fully micro?

#Devoxx #ApacheSling @rombert

Do you really want to go fully micro?

Do you really want to go fully micro?

Robert MunteanuAdobe

Page 2: Do you really want to go fully micro?

#Devoxx #ApacheSling @rombert

Who I am $DAYJOB

Adobe Experience Manager Apache Sling Apache Jackrabbit Apache Felix

Open Source Apache Sling MantisBT Mylyn Connector for MantisBT Mylyn Connector for Review Board

Page 3: Do you really want to go fully micro?

#Devoxx #ApacheSling @rombert

Agenda● Microservices and monoliths● Microservices and microservices● A middle ground?● Apache Sling primer● Demo Application● Conclusion

Page 4: Do you really want to go fully micro?

#Devoxx #ApacheSling @rombert

Agenda● Microservices and monoliths● Microservices and microservices● A middle ground?● Apache Sling primer● Demo Application● Conclusion

Page 5: Do you really want to go fully micro?

#Devoxx #ApacheSling @rombert

Microservices – the cool factor

Page 6: Do you really want to go fully micro?

#Devoxx #ApacheSling @rombert

Microservices – best tool for the job

Page 7: Do you really want to go fully micro?

#Devoxx #ApacheSling @rombert

Microservices – always think of failures

Page 8: Do you really want to go fully micro?

#Devoxx #ApacheSling @rombert

Microservices – simpler scaling

Page 9: Do you really want to go fully micro?

#Devoxx #ApacheSling @rombert

Microservices – different reusability

Page 10: Do you really want to go fully micro?

#Devoxx #ApacheSling @rombert

Microservices – faster deployment

Page 11: Do you really want to go fully micro?

#Devoxx #ApacheSling @rombert

Microservices – faster delivery

Week 1 Week 2 Week 3 Week 4 Week 5 Week 6 Week 7 Week 8

Release Release Release

Week 1h Week 2 Week 3 Week 4 Week 5 Week 6 Week 7 Week 8

SearchCataloguePayment

Payment SearchPayment

CataloguePayment

SearchPayment

Payment SearchCataloguePayment

Payment

Page 12: Do you really want to go fully micro?

#Devoxx #ApacheSling @rombert

Monoliths – crowdsourced wisdom

Page 13: Do you really want to go fully micro?

#Devoxx #ApacheSling @rombert

Monoliths – less distributed computing1. The network is reliable

2. Latency is zero

3. Bandwidth is infinite

4. The network is secure

5. Topology doesn't change

6. There is one administrator

7. Transport cost is zero

8. The network is homogeneousThe Eight Fallacies of Distributed Computing, Peter Deutsch, 1994

Page 14: Do you really want to go fully micro?

#Devoxx #ApacheSling @rombert

Monoliths – Latency/Bandwidth

Page 15: Do you really want to go fully micro?

#Devoxx #ApacheSling @rombert

Monoliths – Security

Page 16: Do you really want to go fully micro?

#Devoxx #ApacheSling @rombert

Monoliths – less operations overhead

Page 17: Do you really want to go fully micro?

#Devoxx #ApacheSling @rombert

Monoliths – less operations overhead

Page 18: Do you really want to go fully micro?

#Devoxx #ApacheSling @rombert

Monoliths – better code reuse

Page 19: Do you really want to go fully micro?

#Devoxx #ApacheSling @rombert

Monoliths – simpler availability

Ordering

Search

Catalogue

User Preferences

Page 20: Do you really want to go fully micro?

#Devoxx #ApacheSling @rombert

Monoliths – easier service discovery

Page 21: Do you really want to go fully micro?

#Devoxx #ApacheSling @rombert

Monoliths – easier troubleshooting

Page 22: Do you really want to go fully micro?

#Devoxx #ApacheSling @rombert

Agenda● Microservices and monoliths● Microservices and microservices● A middle ground?● Apache Sling primer● Demo Application● Conclusion

Page 23: Do you really want to go fully micro?

#Devoxx #ApacheSling @rombert

Microservices and microservices

Page 24: Do you really want to go fully micro?

#Devoxx #ApacheSling @rombert

How to choose?● What are you trying to solve with microservices?● What level of technical diversity does your organisation have?● Are you comfortable with partially embracing microservices?

Page 25: Do you really want to go fully micro?

#Devoxx #ApacheSling @rombert

Agenda● Microservices and monoliths● Microservices and microservices● A middle ground?● Apache Sling primer● Demo Application● Conclusion

Page 26: Do you really want to go fully micro?

#Devoxx #ApacheSling @rombert

A middle ground – using an API gatewayProvides:● Authentication● Authorization● KPIs● Circuit breakers

Must be:● Lightweight● Stateless● Extensible

Page 27: Do you really want to go fully micro?

#Devoxx #ApacheSling @rombert

Middle ground – transparent API gateway

API Gateway

Billing Microservice

Consumer

PUT /payments/

PUT /payments/

201 CreatedContent-Type: application/json

201 CreatedContent-Type: application/json

Page 28: Do you really want to go fully micro?

#Devoxx #ApacheSling @rombert

A middle ground – an advanced gatewayProvides:● Adapter for API changes● Protocol/format unification● Call batching for reduced network usage

Page 29: Do you really want to go fully micro?

#Devoxx #ApacheSling @rombert

A middle ground – transforming API gateway

API Gateway

Catalog Microservice

Consumer

GET /special-offers

GET /special-offers

200 OKContent-Type: application/json

200 OKContent-Type: application/json

Search microservice

GET /search/?q=special

200 OKContent-Type: application/xml

Page 30: Do you really want to go fully micro?

#Devoxx #ApacheSling @rombert

Agenda● Microservices and monoliths● Microservices and microservices● A middle ground?● Apache Sling primer● Demo Application● Conclusion

Page 31: Do you really want to go fully micro?

#Devoxx #ApacheSling @rombert

Apache Sling – Brief History

2007Incubation

2009TLP

2015Version 8

200xPre-Apache

Page 32: Do you really want to go fully micro?

#Devoxx #ApacheSling @rombert

Apache Sling – Code Statistics

Page 33: Do you really want to go fully micro?

#Devoxx #ApacheSling @rombert

Apache Sling – Contributor activity

Page 34: Do you really want to go fully micro?

#Devoxx #ApacheSling @rombert

Apache Sling – Value proposition● Content-oriented/RESTful ● Lightweight● Extensible● Easily deployable

Page 35: Do you really want to go fully micro?

#Devoxx #ApacheSling @rombert

Sling – Repository view of the world

[sling/redirect][catalog/welcome][catalog/category]

[page/specials]

//catalog/catalog/watches/special-offers

Page 36: Do you really want to go fully micro?

#Devoxx #ApacheSling @rombert

Sling – ResourceProviders

//customers/inventory/orders

CustomerµService

InventoryµService

OrdersµService

Logg

ing

KPIs

Circ

uit B

reak

ers

Auth

enti

cati

onAu

thor

izat

ion

Page 37: Do you really want to go fully micro?

#Devoxx #ApacheSling @rombert

Agenda● Microservices and monoliths● Microservices and microservices● A middle ground?● Apache Sling primer● Demo application● Conclusion

Page 38: Do you really want to go fully micro?

#Devoxx #ApacheSling @rombert

Demo application - overview

Page 39: Do you really want to go fully micro?

#Devoxx #ApacheSling @rombert

Demo application - authentication

Page 40: Do you really want to go fully micro?

#Devoxx #ApacheSling @rombert

Demo application - JWT

Page 41: Do you really want to go fully micro?

#Devoxx #ApacheSling @rombert

Demo application – Actual demo!!!!one

Page 42: Do you really want to go fully micro?

#Devoxx #ApacheSling @rombert

Agenda● Microservices and monoliths● Microservices and microservices● A middle ground?● Apache Sling primer● Demo Application● Conclusion

Page 43: Do you really want to go fully micro?

#Devoxx #ApacheSling @rombert

Conclusions – Apache Sling● Eventing, Thread Pooling, Job Management, Caching● Scripting: Groovy, Scala, JSP, Sightly, Java, Ruby, Thymeleaf● Flexible resource rendering with resource types● Very extensible due to being internally powered by OSGi – most extension points available to clients

Page 44: Do you really want to go fully micro?

#Devoxx #ApacheSling @rombert

Conclusions – Microservices● Microservices are a useful tool, but make sure you understand the tradeoffs● Microservices are not an all-or-nothing proposition, pick what is best for your organisation● An API gateway can bring a lot of value to a microservices deployment● Try Apache Sling today

Page 45: Do you really want to go fully micro?

#Devoxx #ApacheSling @rombert

Resources●Apache Sling – https://sling.apache.org ●Apache Jackrabbit

● https://jackrabbit.apache.org● http://jackrabbit.apache.org/oak/

●JWT – https://jwt.io●Netflix Hystrix - https://github.com/Netflix/Hystrix