Unlocking Efficiency: Emojot’s Migration to a Multi-API Gateway Architecture on AWS

Ravindu Nirmal Fernando
Emojot Engineering
Published in
3 min readJun 29, 2023

At Emojot, we believe in continually evolving our digital landscape to provide the best services for our users. One significant change we’ve recently made is migrating our API management layer to AWS API Gateway from a self-managed solution we used for over six years.

The Trigger for Transformation

Our journey started when we realized our self-managed API management solution was causing more challenges than we’d like. First, it meant a higher overhead, as we had to manage resources ourselves. The difficulty of horizontally scaling became apparent as we expanded our operations. We also struggled to update our authorization system — we were using SAML-based authorization but decided to transition to OAuth 2.0 and OIDC to align with modern development tools and the nature of our platform.

Strategic Adoption of AWS API Gateway

Our resources were already deployed on AWS, making the AWS API Gateway a clear and strategic choice among available managed API gateway services. The transition to AWS API Gateway delivered benefits beyond merely improved API management. It optimized cloud cost, as we shifted away from self-managed services on EC2 instances, thus alleviating the need for continuous infrastructure management. This strategic move opened up our resources for innovative endeavours rather than focusing on infrastructure upkeep.

Embracing a Multi API Gateway Architecture

Our API consumers had different access, governance, and security levels that needed to be addressed effectively. In response, we adopted a multi-API gateway architecture, which allowed us to improve and control the security and governance of our API requests significantly. We divided our API Gateways based on the user base and applications interacting with our API services into three categories: Authenticated users, Internal Applications, and External customers or applications with openly exposed endpoints.

Emojot Multi API Gateway Architecture — High-Level Overview

Adopting a multi-API Gateway architecture delivered numerous benefits:

  • Granular Control: Each gateway could be customized with specific policies and configurations, allowing different access levels and rules based on the types of consumers.
  • Enhanced Security: By defining distinct security measures for each gateway, we could limit the attack surface for each service.
  • Scalability: Each API Gateway can scale independently based on its own traffic patterns and requirements, leading to more efficient use of resources.
  • Isolation: If one gateway experiences issues, it does not necessarily affect the others, limiting the scope of potential problems and reducing the risk of widespread outages.
  • Organization and Governance: With each gateway catering to different consumers, the management and governance of APIs are better organized and maintained.

Looking Forward: Service Discovery

The decision to adopt a multi-API Gateway architecture wasn’t made lightly. We carefully considered other options, such as adopting a service discovery layer. Though it presents benefits like better service-to-service communication and efficient management of microservices, the complexity and learning curve it presented made the multi-API Gateway approach a more practical choice for us at this stage.

However, we are aware of the evolving technological landscapes and are excited to explore new strategies. Service discovery layers for more complex microservice management is a direction we will definitely explore in the future.

Conclusion

Our transition to AWS API Gateway and the adoption of a multi-API Gateway architecture represent significant strides in our technological evolution. This transition has not only improved our processes but also has significantly increased the security, scalability, and efficiency of our API management system, all while optimizing our cloud costs.

As we navigate our journey in the cloud, we remain committed to adopting technologies and strategies that align with our vision and enhance our platform. We are excited about the potential of service discovery layers and other advancements as we continue our mission to provide the best possible services to our users. Stay tuned for more updates on our tech journey!

--

--