apache sling as a microservices gateway

43
http://robert.muntea.nu @rombert Apache Sling as a Microservices Gateway Apache Sling as a Microservices Gateway Robert Munteanu, Adobe Systems Voxxed Days Bucharest 2016

Upload: robert-munteanu

Post on 23-Jan-2018

1.421 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Apache Sling as a Microservices Gateway

http://robert.muntea.nu @rombert

Apache Sling as a Microservices Gateway

Apache Sling as a Microservices Gateway

Robert Munteanu, Adobe SystemsVoxxed Days Bucharest 2016

Page 2: Apache Sling as a Microservices Gateway

http://robert.muntea.nu @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: Apache Sling as a Microservices Gateway

http://robert.muntea.nu @rombert

Agenda

● Of microservices and monoliths● Advantages of microservices● Advantages of monoliths● A middle ground?

● Apache Sling primer● Meeting Barry● Demo Application● Conclusion

Page 4: Apache Sling as a Microservices Gateway

http://robert.muntea.nu @rombert

Agenda

● Of microservices and monoliths● Advantages of microservices● Advantages of monoliths● A middle ground?

● Apache Sling primer● Meeting Barry● Demo Application● Conclusion

Page 5: Apache Sling as a Microservices Gateway

http://robert.muntea.nu @rombert

Advantages of microservices

Page 6: Apache Sling as a Microservices Gateway

http://robert.muntea.nu @rombert

Advantages of microservices – best tool for the job

Page 7: Apache Sling as a Microservices Gateway

http://robert.muntea.nu @rombert

Advantages of microservices – always think of failures

Page 8: Apache Sling as a Microservices Gateway

http://robert.muntea.nu @rombert

Advantages of microservices – simpler scaling

Page 9: Apache Sling as a Microservices Gateway

http://robert.muntea.nu @rombert

Advantages of microservices – faster deployment

Page 10: Apache Sling as a Microservices Gateway

http://robert.muntea.nu @rombert

Advantages of microservices – different level of reusability

Page 11: Apache Sling as a Microservices Gateway

http://robert.muntea.nu @rombert

Agenda

● Of microservices and monoliths● Advantages of microservices● Advantages of monoliths● A middle ground?

● Apache Sling primer● Meeting Barry● Demo Application● Conclusion

Page 12: Apache Sling as a Microservices Gateway

http://robert.muntea.nu @rombert

Advantages of monoliths – crowdsourced wisdom

Page 13: Apache Sling as a Microservices Gateway

http://robert.muntea.nu @rombert

Advantages of monoliths – less distributed computing

1. 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: Apache Sling as a Microservices Gateway

http://robert.muntea.nu @rombert

Advantages of monoliths – Latency/Bandwidth

Page 15: Apache Sling as a Microservices Gateway

http://robert.muntea.nu @rombert

Advantages of monoliths – Security

Page 16: Apache Sling as a Microservices Gateway

http://robert.muntea.nu @rombert

Advantages of monoliths – less operations overhead

Page 17: Apache Sling as a Microservices Gateway

http://robert.muntea.nu @rombert

Advantages of monoliths – less operations overhead

Page 18: Apache Sling as a Microservices Gateway

http://robert.muntea.nu @rombert

Advantages of monoliths – better code reuse

Page 19: Apache Sling as a Microservices Gateway

http://robert.muntea.nu @rombert

Advantages of monoliths – simpler availabilty

Page 20: Apache Sling as a Microservices Gateway

http://robert.muntea.nu @rombert

Advantages of monoliths – easier service discovery

Page 21: Apache Sling as a Microservices Gateway

http://robert.muntea.nu @rombert

Advantages of monoliths – easier troubleshooting

Page 22: Apache Sling as a Microservices Gateway

http://robert.muntea.nu @rombert

Agenda

● Of microservices and monoliths● Advantages of microservices● Advantages of monoliths● A middle ground?

● Apache Sling primer● Meeting Barry● Demo Application● Conclusion

Page 23: Apache Sling as a Microservices Gateway

http://robert.muntea.nu @rombert

A middle ground – value proposition

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

Page 24: Apache Sling as a Microservices Gateway

http://robert.muntea.nu @rombert

A middle ground – using an API gateway

Provides:● Authentication● Authorization● KPIs● Circuit breakers● API adaptions

Must be:● Lightweight● Stateless● Extensible

Page 25: Apache Sling as a Microservices Gateway

http://robert.muntea.nu @rombert

Agenda

● Of microservices and monoliths● Advantages of microservices● Advantages of monoliths● A middle ground?

● Apache Sling primer● Meeting Barry● Demo Application● Conclusion

Page 26: Apache Sling as a Microservices Gateway

http://robert.muntea.nu @rombert

Apache Sling – Brief History

2007Incubation

2009TLP

2015Version 8

200xPre-Apache

Page 27: Apache Sling as a Microservices Gateway

http://robert.muntea.nu @rombert

Apache Sling – Code Statistics

Page 28: Apache Sling as a Microservices Gateway

http://robert.muntea.nu @rombert

Apache Sling – Contributor activity

Page 29: Apache Sling as a Microservices Gateway

http://robert.muntea.nu @rombert

Apache Sling – Value proposition

● Content-oriented ● RESTful● Lightweight● OSGi-powered ● Easily deployable

Page 30: Apache Sling as a Microservices Gateway

http://robert.muntea.nu @rombert

Apache Sling – Repository view of the world

[sling/redirect][sling/redirect]

[blog/welcome][blog/page]

//content/content/blog/content/blog/hello-world

Page 31: Apache Sling as a Microservices Gateway

http://robert.muntea.nu @rombert

Apache Sling – gateway through ResourceProviders

Page 32: Apache Sling as a Microservices Gateway

http://robert.muntea.nu @rombert

Apache Sling – gateway through ResourceProviders

//customers/inventory/orders

CustomerµService

InventoryµService

OrdersµService

Logg

ing

KIP

Mea

sure

men

tCi

rcui

t Bre

aker

s

Auth

enti

cati

onAu

thor

izat

ion

Page 33: Apache Sling as a Microservices Gateway

http://robert.muntea.nu @rombert

Agenda

● Of microservices and monoliths● Advantages of microservices● Advantages of monoliths● A middle ground?

● Apache Sling primer● Meeting Barry● Demo Application● Conclusion

Page 34: Apache Sling as a Microservices Gateway

http://robert.muntea.nu @rombert

Meeting Barry

Page 35: Apache Sling as a Microservices Gateway

http://robert.muntea.nu @rombert

Agenda

● Of microservices and monoliths● Advantages of microservices● Advantages of monoliths● A middle ground?

● Apache Sling primer● Meeting Barry● Demo Application● Conclusion

Page 36: Apache Sling as a Microservices Gateway

http://robert.muntea.nu @rombert

Demo application - overview

Page 37: Apache Sling as a Microservices Gateway

http://robert.muntea.nu @rombert

Demo Application - authentication

Page 38: Apache Sling as a Microservices Gateway

http://robert.muntea.nu @rombert

Demo Application - JWT

Page 39: Apache Sling as a Microservices Gateway

http://robert.muntea.nu @rombert

Demo Application – Actual demo!!!!1oneone

Page 40: Apache Sling as a Microservices Gateway

http://robert.muntea.nu @rombert

Agenda

● Of microservices and monoliths● Advantages of microservices● Advantages of monoliths● A middle ground?

● Apache Sling primer● Meeting Barry● Demo Application● Conclusion

Page 41: Apache Sling as a Microservices Gateway

http://robert.muntea.nu @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 42: Apache Sling as a Microservices Gateway

http://robert.muntea.nu @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 43: Apache Sling as a Microservices Gateway

http://robert.muntea.nu @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