Apache Sling as a Microservices Gateway
---
Microservices are definitely the hot topic _du jour_ . Everyone ( and their dog ) is using microservices or migrating towards them. However, there is a gap between the enthusiam for microservices and the ability to create and maintain the infrastructure and culture to effectively use microservices.
Apache Sling is an innovative web framework built on top of the Java Content Repository (JCR), that uses OSGi for its component model and fosters RESTful application design. And, as we will see, it is also perfect match for a microservices gateway.
In this talk we will review the pros and cons of microservices and monoliths, and look for middle road that smaller organisations that follow to use services productively. One of the approaches we will outline and demo is an API gateway built on top of Apache Sling, used to adress the cross-cutting concerns that would otherwise be reimplemented by all microservices.
13. 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 homogeneous
The Eight Fallacies of Distributed Computing, Peter Deutsch, 1994
23. 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?
24. 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
41. 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
42. 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