Tired of Understanding Serverless Best Practices? Get started with Best Practices and Case Study Today!

Image for post
Image for post
Original Photo by Billy from Unsplash

1. Introduction

Microservices are now being widely accepted and looked at as a very strong architectural style for new projects, as well as the target for architecture for legacy monoliths. There isn’t much doubt regarding the benefits of microservice architecture, as both start-ups and major technology players have implemented and proven the benefits of this style. What remains debatable is an effective way of implementing various design patterns alongside the choice of technology and platforms to deliver. Also, there are strong opinions around how to do this quickly and at a small cost, to minimise time to market as well as being able to iterate and improve the product based on end-user feedback.

2. Questions

Let me share a story. Once upon a time in a mystical fairy cloud kingdom, I was working on a digital transformation programme as the Lead Architect, understanding and solving complex business problems. The challenges faced were similar to many big digital transformation projects, but we all know — “One size fit’s All” mantra rarely works for IT transformation projects. That said, let’s shift our focus to the key issues which needed attention:

  1. Legacy retirement: Datacenter managed externally with the support contract ending soon.

3. The Test

Addressing issue 1 was a no brainer. All major public cloud providers provide online calculators using which one can easily compare cost savings of using the public cloud over an on-prem/private cloud.

It was an unchallenged decision that the way forward was to move to the public cloud and stop paying for expensive contracts to run one’s data centre. The intention wasn’t to move existing applications AS-IS but to transform the user experience and provide users with modern tools like a mobile phone to carry out their daily tasks, which vastly helped in addressing issues caused because of manual processes (2), leading to bad data quality (3).

So, after understanding the problem which needed to be solved, the task was to MAKE IT HAPPEN. For this to be successful, the following requirements had to be met: (among others)

1. Build a reliable and scalable infrastructure to support modern application and its growing needs

2. Build a secure application/infrastructure (security is of utmost importance on the cloud!)

3. Engineering lead time

4. Reduce operational cost and complexity

With the above requirements, now the focus shifted to “How to do Microservices” There were many options but let me focus on the two options that made to the top. Below is a simplified comparison of how Containerisation and Serverless scored against given requirements:

Image for post
Image for post

So, the agreed decision was to implement a Serverless Microservices architecture to achieve the desired business functionality.

4. The Build

Now the fun part, actual approach and implementation. Let’s understand the architectural design:

Image for post
Image for post
serverless microservices architecture

The choice of the cloud provider for implementing our serverless architecture was primarily Amazon Web Services (AWS). Let me break down the above diagram and explain the design flow from left to right:

  • The Mobile app was built using the Ionic framework and used Google firebase for Analytics. The user was required to authenticate himself against an IDP (Azure Active Directory) before he could access backend microservices. On successful authentication, the user got back a JWT.

5. The Result

The new platform was designed, built and successfully delivered to pilot users within a few months of starting the project.

Following the core agile values and incremental development approach, new features and users were added every 2 weeks with no impact or change required to adjust capacity for our serverless microservices architecture and as expected, the system scaled on-demand automatically with the increase in user base throughout the year. The full rollout of mobile features was completed in a year.
So how well did the system measured against the key requirements? Let's have a look:

Image for post
Image for post

Key Learnings and Takeaways from this experience:

  • Use API Gateway caching feature where applicable. You will observe significant performance improvement.

Wish to see how to iterate on the existing design and build a serverless website as well? You won’t have to wait long!

Written by

Digital Architect, Agile practitioner, Mentor and Fitness Enthusiast.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store