of microservices and microservices - robert munteanu

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

Upload: mfrancis

Post on 06-Jan-2017

81 views

Category:

Technology


1 download

TRANSCRIPT

Page 1: Of Microservices and Microservices -  Robert Munteanu

http://robert.muntea.nu @rombert

Of Microservices and Microservices

Of Microservices and Microservices

Robert Munteanu, Adobe SystemsOSGi Community Event 2016

Page 2: Of Microservices and Microservices -  Robert Munteanu

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: Of Microservices and Microservices -  Robert Munteanu

http://robert.muntea.nu @rombert

Agenda

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

Page 4: Of Microservices and Microservices -  Robert Munteanu

http://robert.muntea.nu @rombert

Agenda

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

Page 5: Of Microservices and Microservices -  Robert Munteanu

http://robert.muntea.nu @rombert

Advantages of microservices

Page 6: Of Microservices and Microservices -  Robert Munteanu

http://robert.muntea.nu @rombert

Advantages of microservices – best tool for the job

Page 7: Of Microservices and Microservices -  Robert Munteanu

http://robert.muntea.nu @rombert

Advantages of microservices – always think of failures

Page 8: Of Microservices and Microservices -  Robert Munteanu

http://robert.muntea.nu @rombert

Advantages of microservices – simpler scaling

Page 9: Of Microservices and Microservices -  Robert Munteanu

http://robert.muntea.nu @rombert

Advantages of microservices – different level of reusability

Page 10: Of Microservices and Microservices -  Robert Munteanu

http://robert.muntea.nu @rombert

Advantages of microservices – faster deployment

Page 11: Of Microservices and Microservices -  Robert Munteanu

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

Page 12: Of Microservices and Microservices -  Robert Munteanu

http://robert.muntea.nu @rombert

Advantages of monoliths – crowdsourced wisdom

Page 13: Of Microservices and Microservices -  Robert Munteanu

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: Of Microservices and Microservices -  Robert Munteanu

http://robert.muntea.nu @rombert

Advantages of monoliths – Latency/Bandwidth

Page 15: Of Microservices and Microservices -  Robert Munteanu

http://robert.muntea.nu @rombert

Advantages of monoliths – Security

Page 16: Of Microservices and Microservices -  Robert Munteanu

http://robert.muntea.nu @rombert

Advantages of monoliths – less operations overhead

Page 17: Of Microservices and Microservices -  Robert Munteanu

http://robert.muntea.nu @rombert

Advantages of monoliths – less operations overhead

Page 18: Of Microservices and Microservices -  Robert Munteanu

http://robert.muntea.nu @rombert

Advantages of monoliths – better code reuse

Page 19: Of Microservices and Microservices -  Robert Munteanu

http://robert.muntea.nu @rombert

Advantages of monoliths – simpler availability

Ordering

Search

Catalogue

User Preferences

Page 20: Of Microservices and Microservices -  Robert Munteanu

http://robert.muntea.nu @rombert

Advantages of monoliths – easier service discovery

Page 21: Of Microservices and Microservices -  Robert Munteanu

http://robert.muntea.nu @rombert

Advantages of monoliths – easier troubleshooting

Page 22: Of Microservices and Microservices -  Robert Munteanu

http://robert.muntea.nu @rombert

Agenda

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

Page 23: Of Microservices and Microservices -  Robert Munteanu

http://robert.muntea.nu @rombert

Microservices and microservices

Page 24: Of Microservices and Microservices -  Robert Munteanu

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?

Page 25: Of Microservices and Microservices -  Robert Munteanu

http://robert.muntea.nu @rombert

Agenda

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

Page 26: Of Microservices and Microservices -  Robert Munteanu

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 27: Of Microservices and Microservices -  Robert Munteanu

http://robert.muntea.nu @rombert

Agenda

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

Page 28: Of Microservices and Microservices -  Robert Munteanu

http://robert.muntea.nu @rombert

Apache Sling – Brief History

2007Incubation

2009TLP

2015Version 8

200xPre-Apache

Page 29: Of Microservices and Microservices -  Robert Munteanu

http://robert.muntea.nu @rombert

Apache Sling – Code Statistics

Page 30: Of Microservices and Microservices -  Robert Munteanu

http://robert.muntea.nu @rombert

Apache Sling – Contributor activity

Page 31: Of Microservices and Microservices -  Robert Munteanu

http://robert.muntea.nu @rombert

Apache Sling – Value proposition

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

Page 32: Of Microservices and Microservices -  Robert Munteanu

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 33: Of Microservices and Microservices -  Robert Munteanu

http://robert.muntea.nu @rombert

Apache Sling – gateway through ResourceProviders

Page 34: Of Microservices and Microservices -  Robert Munteanu

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 35: Of Microservices and Microservices -  Robert Munteanu

http://robert.muntea.nu @rombert

Agenda

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

Page 36: Of Microservices and Microservices -  Robert Munteanu

http://robert.muntea.nu @rombert

Demo application - overview

Page 37: Of Microservices and Microservices -  Robert Munteanu

http://robert.muntea.nu @rombert

Demo Application - authentication

Page 38: Of Microservices and Microservices -  Robert Munteanu

http://robert.muntea.nu @rombert

Demo Application - JWT

Page 39: Of Microservices and Microservices -  Robert Munteanu

http://robert.muntea.nu @rombert

Demo Application – Actual demo!!!!1oneone

Page 40: Of Microservices and Microservices -  Robert Munteanu

http://robert.muntea.nu @rombert

Agenda

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

Page 41: Of Microservices and Microservices -  Robert Munteanu

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: Of Microservices and Microservices -  Robert Munteanu

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: Of Microservices and Microservices -  Robert Munteanu

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