do you really want to go fully micro?
TRANSCRIPT
#Devoxx #ApacheSling @rombert
Do you really want to go fully micro?
Do you really want to go fully micro?
Robert MunteanuAdobe
#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
#Devoxx #ApacheSling @rombert
Agenda● Microservices and monoliths● Microservices and microservices● A middle ground?● Apache Sling primer● Demo Application● Conclusion
#Devoxx #ApacheSling @rombert
Agenda● Microservices and monoliths● Microservices and microservices● A middle ground?● Apache Sling primer● Demo Application● Conclusion
#Devoxx #ApacheSling @rombert
Microservices – the cool factor
#Devoxx #ApacheSling @rombert
Microservices – best tool for the job
#Devoxx #ApacheSling @rombert
Microservices – always think of failures
#Devoxx #ApacheSling @rombert
Microservices – simpler scaling
#Devoxx #ApacheSling @rombert
Microservices – different reusability
#Devoxx #ApacheSling @rombert
Microservices – faster deployment
#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
#Devoxx #ApacheSling @rombert
Monoliths – crowdsourced wisdom
#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
#Devoxx #ApacheSling @rombert
Monoliths – Latency/Bandwidth
#Devoxx #ApacheSling @rombert
Monoliths – Security
#Devoxx #ApacheSling @rombert
Monoliths – less operations overhead
#Devoxx #ApacheSling @rombert
Monoliths – less operations overhead
#Devoxx #ApacheSling @rombert
Monoliths – better code reuse
#Devoxx #ApacheSling @rombert
Monoliths – simpler availability
Ordering
Search
Catalogue
User Preferences
#Devoxx #ApacheSling @rombert
Monoliths – easier service discovery
#Devoxx #ApacheSling @rombert
Monoliths – easier troubleshooting
#Devoxx #ApacheSling @rombert
Agenda● Microservices and monoliths● Microservices and microservices● A middle ground?● Apache Sling primer● Demo Application● Conclusion
#Devoxx #ApacheSling @rombert
Microservices and microservices
#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?
#Devoxx #ApacheSling @rombert
Agenda● Microservices and monoliths● Microservices and microservices● A middle ground?● Apache Sling primer● Demo Application● Conclusion
#Devoxx #ApacheSling @rombert
A middle ground – using an API gatewayProvides:● Authentication● Authorization● KPIs● Circuit breakers
Must be:● Lightweight● Stateless● Extensible
#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
#Devoxx #ApacheSling @rombert
A middle ground – an advanced gatewayProvides:● Adapter for API changes● Protocol/format unification● Call batching for reduced network usage
#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
#Devoxx #ApacheSling @rombert
Agenda● Microservices and monoliths● Microservices and microservices● A middle ground?● Apache Sling primer● Demo Application● Conclusion
#Devoxx #ApacheSling @rombert
Apache Sling – Brief History
2007Incubation
2009TLP
2015Version 8
200xPre-Apache
#Devoxx #ApacheSling @rombert
Apache Sling – Code Statistics
#Devoxx #ApacheSling @rombert
Apache Sling – Contributor activity
#Devoxx #ApacheSling @rombert
Apache Sling – Value proposition● Content-oriented/RESTful ● Lightweight● Extensible● Easily deployable
#Devoxx #ApacheSling @rombert
Sling – Repository view of the world
[sling/redirect][catalog/welcome][catalog/category]
[page/specials]
//catalog/catalog/watches/special-offers
#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
#Devoxx #ApacheSling @rombert
Agenda● Microservices and monoliths● Microservices and microservices● A middle ground?● Apache Sling primer● Demo application● Conclusion
#Devoxx #ApacheSling @rombert
Demo application - overview
#Devoxx #ApacheSling @rombert
Demo application - authentication
#Devoxx #ApacheSling @rombert
Demo application - JWT
#Devoxx #ApacheSling @rombert
Demo application – Actual demo!!!!one
#Devoxx #ApacheSling @rombert
Agenda● Microservices and monoliths● Microservices and microservices● A middle ground?● Apache Sling primer● Demo Application● Conclusion
#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
#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
#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