In this workshop, you will build and deploy a series of simple microservices with an event-driven architecture approach.
The main objective of this workshop is to build a foundation of extending and scaling microservices architecture by leveraging synchronous and asynchronous communication β with choreography and orchestration patterns.
The content of this workshop will be updated regularly and if you have questions or find issues in this workshop, please file them as an Issue.
This repo consists of 3 workshops:
In this workshop, you will build 2 AWS Lambda Functions. One AWS Lambda Function (as the Producer) will dispatch events, and one AWS Lambda Function (as the Consumer) to receive events. In addition to receiving events, the Consumer will also print logs to AWS CloudWatch Logs to ensure the flow is going well.
As a continuation of the previous workshop, in this workshop, you will do a more complex system that uses multiple microservices. You will learn how to combine synchronous and asynchronous communication as it's a commonly used pattern in building microservices.
You will build an HTTP API with Amazon API Gateway and AWS Lambda Function. In the background, the HTTP API will dispatch events to Amazon EventBridge for backend processing. The event will be consumed by 4 other microservices represented by AWS Lambda Functions. Communication between microservices on the backend will run asynchronously by applying a choreographed approach using Amazon EventBridge.
Besides choreography, we also need to understand another approach, widely known as orchestration. In this lab, you will build a state machine to manage orchestration between microservices.
In this workshop, you will build a simple banking system that has 4 domains. This system aims to perform assessment and validation before opening an account at a bank.
You will learn how to use AWS Step Functions to build a state machine for orchestration. Apart from that, you can also use several state types provided by AWS Step Functions.
This workshop welcomes developers of all levels.
This workshop is structured as puzzles in which you need to complete a set of partial codes into a complete code. It is an intended design to help build an understanding of a specific concept. Also, to help you get familiar with common resources needed to develop with AWS services.
If this is your first time using this workshop, this section is an important piece that you need to read before moving on.
Please make sure that your development environment meets the requirements below and properly configured before starting any of the workshops.
Workshop Requirements
Requirement | More Information | Notes |
---|---|---|
Active AWS Account | Link | Mandatory requirement |
AWS CDK | Link | Require Node JS |
AWS CLI | Link | Require active AWS account. Please configure your account as described on this page |
Python 3.8 | Link | Most of the workshop will be using Python 3.8 |
Boto3 | Link | Amazon Web Services (AWS) Software Development Kit (SDK) for Python |
Node JS 10.30 or later | Link | Node.js versions 13.0.0 through 13.6.0 are not compatible with the AWS CDK |
Since we will be using AWS CDK extensively in this workshop, please properly configure AWS CDK for your development environment.
If you haven't done that, please follow the instruction here.
In summary, here's a quick checklist to complete the required checking.
- Installed AWS CLI
- Configured AWS CLI with
aws configure
- Installed Node JS
- Installed AWS CDK with
npm install -g aws-cdk
- Configured AWS CDK with
cdk bootstrap
Lab Name | Level | Duration |
---|---|---|
Lab 0 - Requirements Checking | All Levels | 15 mins |
Lab 1 - Basic Dispatch Consume | Beginner | 15 mins |
Lab 2 - Building Choreographed Microservices | Intermediate | 30 mins |
Lab 3 - Orchestrating Microservices | Intermediate | 15 mins |
For the more complex tasks that you need to complete, there will be a π‘ HINT to guide you on how to solve it. Most of the time, it will also include link(s) for further reading.
Please remember that if you are stuck and can't move to the next step, you can always see the main reference file to see the solution. For easy access, π Are you stuck? will guide you directly to the solution.
Some of the services from AWS that are used in this workshop are as follows:
- AWS CDK
- AWS Lambda
- Amazon API Gateway
- Amazon CloudWatch
- Amazon EventBridge
- Amazon DynamoDB
- AWS Step Functions
This workshop uses AWS services that are mostly covered by the Free Tier allowance - ONLY if your account is less than 12 months old. For accounts passed the free tier eligibility, it may incur some costs. To minimize the cost, make sure you delete resources used in this workshop when you are finished.
All of the labs in this workshop use a standardized cleaning method with AWS CDK.
- Go to each lab
- Change the directory to
cdk /
- Run
cdk destroy
- If in some cases it fails, you need to go to AWS CloudFormation to manually delete the stack.