Download - Apache Sling as a Microservices Gateway
![Page 1: Apache Sling as a Microservices Gateway](https://reader034.vdocuments.net/reader034/viewer/2022050614/5876feb51a28abf3398b6da9/html5/thumbnails/1.jpg)
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](https://reader034.vdocuments.net/reader034/viewer/2022050614/5876feb51a28abf3398b6da9/html5/thumbnails/2.jpg)
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](https://reader034.vdocuments.net/reader034/viewer/2022050614/5876feb51a28abf3398b6da9/html5/thumbnails/3.jpg)
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](https://reader034.vdocuments.net/reader034/viewer/2022050614/5876feb51a28abf3398b6da9/html5/thumbnails/4.jpg)
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 6: Apache Sling as a Microservices Gateway](https://reader034.vdocuments.net/reader034/viewer/2022050614/5876feb51a28abf3398b6da9/html5/thumbnails/6.jpg)
http://robert.muntea.nu @rombert
Advantages of microservices – best tool for the job
![Page 7: Apache Sling as a Microservices Gateway](https://reader034.vdocuments.net/reader034/viewer/2022050614/5876feb51a28abf3398b6da9/html5/thumbnails/7.jpg)
http://robert.muntea.nu @rombert
Advantages of microservices – always think of failures
![Page 8: Apache Sling as a Microservices Gateway](https://reader034.vdocuments.net/reader034/viewer/2022050614/5876feb51a28abf3398b6da9/html5/thumbnails/8.jpg)
http://robert.muntea.nu @rombert
Advantages of microservices – simpler scaling
![Page 9: Apache Sling as a Microservices Gateway](https://reader034.vdocuments.net/reader034/viewer/2022050614/5876feb51a28abf3398b6da9/html5/thumbnails/9.jpg)
http://robert.muntea.nu @rombert
Advantages of microservices – faster deployment
![Page 10: Apache Sling as a Microservices Gateway](https://reader034.vdocuments.net/reader034/viewer/2022050614/5876feb51a28abf3398b6da9/html5/thumbnails/10.jpg)
http://robert.muntea.nu @rombert
Advantages of microservices – different level of reusability
![Page 11: Apache Sling as a Microservices Gateway](https://reader034.vdocuments.net/reader034/viewer/2022050614/5876feb51a28abf3398b6da9/html5/thumbnails/11.jpg)
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](https://reader034.vdocuments.net/reader034/viewer/2022050614/5876feb51a28abf3398b6da9/html5/thumbnails/12.jpg)
http://robert.muntea.nu @rombert
Advantages of monoliths – crowdsourced wisdom
![Page 13: Apache Sling as a Microservices Gateway](https://reader034.vdocuments.net/reader034/viewer/2022050614/5876feb51a28abf3398b6da9/html5/thumbnails/13.jpg)
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](https://reader034.vdocuments.net/reader034/viewer/2022050614/5876feb51a28abf3398b6da9/html5/thumbnails/14.jpg)
http://robert.muntea.nu @rombert
Advantages of monoliths – Latency/Bandwidth
![Page 16: Apache Sling as a Microservices Gateway](https://reader034.vdocuments.net/reader034/viewer/2022050614/5876feb51a28abf3398b6da9/html5/thumbnails/16.jpg)
http://robert.muntea.nu @rombert
Advantages of monoliths – less operations overhead
![Page 17: Apache Sling as a Microservices Gateway](https://reader034.vdocuments.net/reader034/viewer/2022050614/5876feb51a28abf3398b6da9/html5/thumbnails/17.jpg)
http://robert.muntea.nu @rombert
Advantages of monoliths – less operations overhead
![Page 18: Apache Sling as a Microservices Gateway](https://reader034.vdocuments.net/reader034/viewer/2022050614/5876feb51a28abf3398b6da9/html5/thumbnails/18.jpg)
http://robert.muntea.nu @rombert
Advantages of monoliths – better code reuse
![Page 19: Apache Sling as a Microservices Gateway](https://reader034.vdocuments.net/reader034/viewer/2022050614/5876feb51a28abf3398b6da9/html5/thumbnails/19.jpg)
http://robert.muntea.nu @rombert
Advantages of monoliths – simpler availabilty
![Page 20: Apache Sling as a Microservices Gateway](https://reader034.vdocuments.net/reader034/viewer/2022050614/5876feb51a28abf3398b6da9/html5/thumbnails/20.jpg)
http://robert.muntea.nu @rombert
Advantages of monoliths – easier service discovery
![Page 21: Apache Sling as a Microservices Gateway](https://reader034.vdocuments.net/reader034/viewer/2022050614/5876feb51a28abf3398b6da9/html5/thumbnails/21.jpg)
http://robert.muntea.nu @rombert
Advantages of monoliths – easier troubleshooting
![Page 22: Apache Sling as a Microservices Gateway](https://reader034.vdocuments.net/reader034/viewer/2022050614/5876feb51a28abf3398b6da9/html5/thumbnails/22.jpg)
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](https://reader034.vdocuments.net/reader034/viewer/2022050614/5876feb51a28abf3398b6da9/html5/thumbnails/23.jpg)
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](https://reader034.vdocuments.net/reader034/viewer/2022050614/5876feb51a28abf3398b6da9/html5/thumbnails/24.jpg)
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](https://reader034.vdocuments.net/reader034/viewer/2022050614/5876feb51a28abf3398b6da9/html5/thumbnails/25.jpg)
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](https://reader034.vdocuments.net/reader034/viewer/2022050614/5876feb51a28abf3398b6da9/html5/thumbnails/26.jpg)
http://robert.muntea.nu @rombert
Apache Sling – Brief History
2007Incubation
2009TLP
2015Version 8
200xPre-Apache
![Page 29: Apache Sling as a Microservices Gateway](https://reader034.vdocuments.net/reader034/viewer/2022050614/5876feb51a28abf3398b6da9/html5/thumbnails/29.jpg)
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](https://reader034.vdocuments.net/reader034/viewer/2022050614/5876feb51a28abf3398b6da9/html5/thumbnails/30.jpg)
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](https://reader034.vdocuments.net/reader034/viewer/2022050614/5876feb51a28abf3398b6da9/html5/thumbnails/31.jpg)
http://robert.muntea.nu @rombert
Apache Sling – gateway through ResourceProviders
![Page 32: Apache Sling as a Microservices Gateway](https://reader034.vdocuments.net/reader034/viewer/2022050614/5876feb51a28abf3398b6da9/html5/thumbnails/32.jpg)
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](https://reader034.vdocuments.net/reader034/viewer/2022050614/5876feb51a28abf3398b6da9/html5/thumbnails/33.jpg)
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 35: Apache Sling as a Microservices Gateway](https://reader034.vdocuments.net/reader034/viewer/2022050614/5876feb51a28abf3398b6da9/html5/thumbnails/35.jpg)
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 40: Apache Sling as a Microservices Gateway](https://reader034.vdocuments.net/reader034/viewer/2022050614/5876feb51a28abf3398b6da9/html5/thumbnails/40.jpg)
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](https://reader034.vdocuments.net/reader034/viewer/2022050614/5876feb51a28abf3398b6da9/html5/thumbnails/41.jpg)
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](https://reader034.vdocuments.net/reader034/viewer/2022050614/5876feb51a28abf3398b6da9/html5/thumbnails/42.jpg)
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](https://reader034.vdocuments.net/reader034/viewer/2022050614/5876feb51a28abf3398b6da9/html5/thumbnails/43.jpg)
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