43
http://robert.muntea.nu @rombert Of Microservices and Microservices Of Microservices and Microservices Robert Munteanu, Adobe Systems OSGi Community Event 2016

Of microservices and microservices

Embed Size (px)

Citation preview

http://robert.muntea.nu @rombert

Of Microservices and Microservices

Of Microservices and Microservices

Robert Munteanu, Adobe SystemsOSGi Community Event 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

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

http://robert.muntea.nu @rombert

Agenda

● Microservices and monoliths● Microservices and microservices● A middle ground?● Apache Sling primer● 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 – different level of reusability

http://robert.muntea.nu @rombert

Advantages of microservices – faster deployment

http://robert.muntea.nu @rombert

Advantages of 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

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 availability

Ordering

Search

Catalogue

User Preferences

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

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

http://robert.muntea.nu @rombert

Microservices and microservices

http://robert.muntea.nu @rombert

How to choose?

● 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

Agenda

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

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

● Microservices and monoliths● Microservices and microservices● A middle ground?● Apache Sling primer● 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

● Microservices and monoliths● Microservices and microservices● A middle ground?● Apache Sling primer● 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

● Microservices and monoliths● Microservices and microservices● A middle ground?● Apache Sling primer● 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