Apache Sling as a Microservices Gateway

Preview:

Citation preview

http://robert.muntea.nu @rombert

Apache Sling as a Microservices Gateway

Apache Sling as a Microservices Gateway

Robert Munteanu, Adobe SystemsVoxxed Days Bucharest 2016

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

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

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

http://robert.muntea.nu @rombert

Advantages of microservices

http://robert.muntea.nu @rombert

Advantages of microservices – best tool for the job

http://robert.muntea.nu @rombert

Advantages of microservices – always think of failures

http://robert.muntea.nu @rombert

Advantages of microservices – simpler scaling

http://robert.muntea.nu @rombert

Advantages of microservices – faster deployment

http://robert.muntea.nu @rombert

Advantages of microservices – different level of reusability

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

http://robert.muntea.nu @rombert

Advantages of monoliths – crowdsourced wisdom

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

http://robert.muntea.nu @rombert

Advantages of monoliths – Latency/Bandwidth

http://robert.muntea.nu @rombert

Advantages of monoliths – Security

http://robert.muntea.nu @rombert

Advantages of monoliths – less operations overhead

http://robert.muntea.nu @rombert

Advantages of monoliths – less operations overhead

http://robert.muntea.nu @rombert

Advantages of monoliths – better code reuse

http://robert.muntea.nu @rombert

Advantages of monoliths – simpler availabilty

http://robert.muntea.nu @rombert

Advantages of monoliths – easier service discovery

http://robert.muntea.nu @rombert

Advantages of monoliths – easier troubleshooting

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

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?

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

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

http://robert.muntea.nu @rombert

Apache Sling – Brief History

2007Incubation

2009TLP

2015Version 8

200xPre-Apache

http://robert.muntea.nu @rombert

Apache Sling – Code Statistics

http://robert.muntea.nu @rombert

Apache Sling – Contributor activity

http://robert.muntea.nu @rombert

Apache Sling – Value proposition

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

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

http://robert.muntea.nu @rombert

Apache Sling – gateway through ResourceProviders

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

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

http://robert.muntea.nu @rombert

Meeting Barry

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

http://robert.muntea.nu @rombert

Demo application - overview

http://robert.muntea.nu @rombert

Demo Application - authentication

http://robert.muntea.nu @rombert

Demo Application - JWT

http://robert.muntea.nu @rombert

Demo Application – Actual demo!!!!1oneone

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

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

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

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

Recommended