Skip to content

Gluu Gateway for Microservices

duttarnab edited this page Jul 15, 2020 · 4 revisions

Microservices

Microservices or Microservice Architecture describes a particular way of designing software applications as suites of independently deployable services. It is a collection of services that are preferably loosely coupled and independently deployable. Nowadays microservices are becoming answers to more and more complex requirements that software needs to take care of. Compared to more monolithic design structures, microservices offer:

  • Improved fault isolation: Larger applications can remain mostly unaffected by the failure of a single module.

  • Eliminate vendor or technology lock-in: Microservices provide the flexibility to try out a new technology stack on an individual service as needed. There won’t be as many dependency concerns and rolling back changes becomes much easier. With less code in play, there is more flexibility.

  • Ease of understanding: With added simplicity, developers can better understand the functionality of a service.

  • Smaller and faster deployments: Smaller codebases and scope = quicker deployments, which also allow you to start to explore the benefits of Continuous Deployment.

  • Scalability: Since your services are separate, you can more easily scale the most needed ones at the appropriate times, as opposed to the whole application. When done correctly, this can impact cost savings.

Monolith to Microservices

Separating a monolithic system to an ecosystem of microservices is like running a city. We need to have roads between the services to communicate. We need to have security and other infrastructure in place which will help in this new way of building software.

Use Case

Take the example of a monolithic application with all of the components built into a single code base. One team comes and decides to extract one of these services outside of the application. So the 'Accounts' service is extracted and it lives separately from all the other components. The 'Accounts' microservice will need complementary features like authentication, authorization, access management, logging etc. to work. Now when another service say 'Human Resource' is extracted from the application then the same or other complementary features may/will be again required. This will lead to code duplication to make complementary features available for each extracted microservices which is not good.

Gluu Gateway

Gluu Gateway (GG) bundles the open-source Kong Gateway for its core functionality and adds a GUI and custom plugins to enable access management policy enforcement using OAuth, UMA, OpenID Connect and Open Policy Agent (OPA). In addition, GG supports the broader ecosystem of Kong plugins to enable API rate limiting, logging, and many other capabilities.

GG abstraction layer on microservices

For the above use case, GG can help in 2 ways. It forms an abstraction layer that sits on the execution path of every request that is going to one of these microservices and centralized together all of those common features that otherwise each microservices will have to implement. In GG we call those features as plugins. Plugins are the middleware functionality that you can dynamically apply on top of any microservice behind the GG cluster.

Another use case of GG is aggregating and collapsing different responses into one response. When you have microservices using other microservices some time we need to make a request to more than one upstream services. So the gateway will form an abstraction layer in front of the microservices architecture in order to collapse these responses into one response. So the client will make one request and the gateway will trigger other requests in your infrastructure and return a response. This is especially useful if you want to optimize for bandwidth and size because you do not have to trigger multiple requests and keep track of the state of the request.