Building Serverless Microservices on AWS

Microservices has been a key trend in software architecture. Let’s discuss what microservices are and what is Microservices Architecture.

I’ll give you the standard definition of Microservices Architecture, first.

The idea of microservices architecture is to take a large complex system and break it down into independent decoupled services that are easy to manage and extend.

Microservices are an approach to software development where software is composed of small, independent services that communicate over a well-defined API. These services are generally owned by small self-contained teams.

Microservices architecture makes your applications easier to scale and faster to develop, enabling innovation and accelerating time to market for new features.

Each service performs a single specific function and because they’re independent of each other, they can be run, deployed, updated independently to meet the demands of your application.

Main Characteristics of Microservices

Microservices have two specific characteristics.

  1. they’re autonomous, and
  2. they are specialized

‘Autonomous’ means each service can be deployed, developed, maintained, and updated independent of other services, and without affecting the functionality of other services. These services also do not share their code or implementation with other services. They simply communicate over well-defined APIs.

‘Specialized’ means each service performs a single specific function. If developers add more code to a service over time making it complex, it can then be broken down into smaller services.

Benefits of Microservices

Now let’s discuss some of the benefits of using microservices.

  1. First is Agility. Microservices promote an organization of small, independent teams, that take ownership of their services. This shortens the development cycle times.
  2. Second is flexible scaling. Microservices can be independently scaled, providing fine-grained control of infrastructural needs. Then, we have easy deployment. Microservices support Continuous Integration and Continuous Delivery, making it easy for you to try out new ideas.
  3. Then, we have technological freedom. You have the freedom to choose your programming language and your tools, to develop your services to solve your specific problems. Then, we have reusable code. A service that is written for a specific function can be used as a building block for another feature. This allows the application to bootstrap off itself, as developers can create new functionality and new capability without writing code from scratch.
  4. Lastly, we have Resilience. Service independence increases your application’s resistance to failure. With microservices, applications handle total system failure by degrading functionality and not by crashing the entire system.

AWS Serverless Microservices

“No server is easier to manage than no server”. Serverless drastically simplifies operational overhead of your application. AWS Lambda and API Gateway provide that perfect combination of web services that you can use to build, deliver, and maintain a set of microservices that in turn form your complex serverless application.

Let’s quickly understand how AWS Lambda and API Gateway can help. AWS Lambda enables you to run your code without having to manage any servers. You simply upload your code to Lambda and Lambda takes care of the rest, enabling your application to run on highly-available and highly-scalable infrastructure. Each piece of code that you upload to Lambda is called as a Lambda Function, and it runs as an independent, self-contained microservice.

API Gateway allows you to expose your code running in AWS Lambda in the form of RESTful APIs. RESTful APIs are the APIs that follow a client-server model, where client is stateful but server is completely stateless. Again, API Gateway is a fully-managed service and can support thousands of concurrent API calls. It also allows you fine-grained access control and version management capabilities. These APIs can then be consumed by your mobile, web or IoT applications, allowing you to interact with different AWS services through your code running in AWS Lambda.

You can learn more the AWS approach to Microservices by reading this whitepaper: Microservices on AWS.

If you’d like to how to create your own Serverless Microservices on AWS, I talk more about this and take you through hand-on labs in my online course AWS Lambda - Introduction to Serverless Microservices in AWS. This is a short and concise course as I know you are short on time. In addition to gaining understanding of serverless computing, you’ll learn how to create completely serverless microservices using AWS Lambda, API Gateway and DynamoDB. We’ll use the new Lambda Console with AWS Cloud9-based Code Editor so you don’t have to install any software. All you need is your favorite web browser.

But you know, there is also a free way of doing this: If you don’t have the money, then head over to my YouTube channel and subscribe. You’ll find free preview of this course there. I truly believe there is enough information out there for you to do this for free and learn these skills as a developer if you have enough determination.

If you enjoyed this post and found it useful, please share, comment, and press that 👏 a few times. . .Maybe it will inspire someone to start learning this new stuff!

Subscribe to my YouTube Channel and follow me on Medium if you’re interested in more informative write-ups like these in the future!