
Microservices are a software development approach where applications are broken down into small, independent services that work together to accomplish a larger task. This architecture provides greater flexibility and scalability, as each service can be developed, deployed, and scaled independently. Microservices also allow for better fault isolation and faster time-to-market. This approach is becoming increasingly popular in the software industry, enabling organizations to build and maintain complex systems more quickly and efficiently.
Microservices and Monolithic are two different software architectures used in developing complex applications. In a monolithic architecture, the entire application is built as a single unit. In contrast, in a Microservices architecture, the application is divided into more minor, independent services that communicate with each other. This article discusses the differences between Microservices and Monolithic architectures, including their advantages and disadvantages. It also covers the factors organizations should consider when choosing between these architectures.
The anatomy of a microservices-based application refers to the architectural components and design principles that underpin the development of scalable, flexible, and resilient software systems based on the microservices approach. This approach involves breaking down complex applications into smaller, independent services that communicate with each other using APIs. In this article, we explore the key features of a microservices-based application, including service independence, decentralized data management, fault tolerance, and scalability, among others. We also discuss the benefits and challenges of implementing this approach and best practices for designing and deploying microservices-based applications.
AWS Cognito is a powerful user authentication and management service offered by Amazon Web Services (AWS). It enables developers to easily add sign-up, sign-in, and access control to web and mobile applications. With AWS Cognito, you can create and manage user accounts, authenticate users through multiple identity providers, and control access to your application's resources. This introduction to AWS Cognito will help you understand its key features, benefits, and use cases and how it can help you enhance your applications' security and user experience.
API Gateway is a crucial software architecture pattern that allows untrusted actors, such as mobile applications and third-party systems, to access our microservices. In this video, you will learn about this pattern and some API Gateway systems that are common in the market and that you can use.
Creating a mock API with AWS API Gateway allows you to simulate and test your API's behaviour without needing backend implementation. By leveraging this powerful service, you can quickly prototype and validate your application's functionality, saving valuable time and resources. With AWS API Gateway, you can define your mock API's endpoints, methods, and responses, providing a realistic environment for your developers to work with. By optimizing your development workflow and enabling efficient collaboration between frontend and backend teams, AWS API Gateway empowers you to build robust and reliable applications quickly. Take advantage of this versatile service to streamline your development process and ensure the seamless integration of your APIs.
In this topic, we'll delve into the importance of authenticating API requests and provide expert insights on best practices. Authenticating API requests is a crucial step in ensuring the security and integrity of your data exchange. By implementing robust authentication mechanisms, you can protect your application from unauthorized access, data breaches, and potential misuse. From API keys to OAuth tokens and digital certificates, various authentication methods are available to suit your specific needs. Stay ahead of the curve and learn how to authenticate API requests effectively, safeguarding your data and maintaining trust with your users. Discover the essential techniques and tools that will empower you to authenticate API requests seamlessly.
"Adding CORS Headers to APIs" is a crucial step for developers to enable cross-domain communication between different web applications. CORS stands for Cross-Origin Resource Sharing, which allows web pages from different domains to access resources hosted on other servers. By adding CORS headers to your APIs, you can ensure secure and seamless data sharing, enhance user experience, and improve the performance of your web applications. This guide provides valuable insights on how to add CORS headers to your APIs, including practical tips and best practices to optimize your API's SEO and usability.
If you ever attend a job interview relevant to software development, you will be asked about the types of microservices. There are two ways to answer this question: Superficial and Resounding answers. The latter will impress the interviewer and will get you so many credits.
In this lecture, we understand the concept of a Chassis in the context of microservices, and then we will realise why different microservices exist.
In this lecture, we will see how an AWS Lambda file is created, packaged and deployed to the AWS Lambda service. We also see how we can debug a Lambda.
This comprehensive lecture will use Python to explore the step-by-step process of capturing the request body in AWS Lambda. By implementing this efficient technique, you can seamlessly extract and process valuable data from incoming requests, allowing you to build robust and dynamic APIs. Whether you're a seasoned developer or just starting your journey, our easy-to-follow instructions and best practices will empower you to harness the full potential of AWS Lambda as an API backend. Get ready to supercharge your serverless architecture and unlock unparalleled flexibility with the combination of AWS Lambda, Python, and request body capturing. Let's dive in and revolutionize your API development workflow today!
Although authorization can be performed with a Lambda Authorizer at the API Gateway level, we can do it in the Lambda code. This scenario is handy when two microservices call each other's APIs without going through an API Gateway (although not a best practice).
Every application has to store some information, i.e., customer details, in a database. Also, sometimes files have to be kept. For example, the Hotel Management project we work on in this course has to keep the hotel images somewhere. In this topic, we will learn about AWS'sAWS's data and file storage options.
A Lambda, by default, can only access the CloudWatch service. In this topic, we will create and configure an Execution IAM service for our Lambda microservice.
AWS S3 is used for storing files (i.e., Hotel Images). Therefore, we need to configure S3 correctly so that a microservice can securely access it, but unauthorised people or systems cannot perform illegal actions.
We will use Amazon DynamoDB, a no-SQL database offered by AWS, to store hotel information. In this short lecture, we will see how a table is created and what considerations we must consider for an optimal design.
We have already created a Restful API in API Gateway. This lecture will connect this API to our Microservice via a Resource Proxy.
Up to this lecture, we have completed a POST API with a backend microservice that allows an administrator to add hotels to the system. Next, we will test our API and Lambda and look at the logs and monitoring information in AWS Cloudwatch.
In this lecture, we will add a new method to the HotelAdmin microservice to return the list of hotels created by an Admin user. This lecture aims to demonstrate how a Lambda function can receive JWT tokens (via the idToken) from a GET API, which does not have a Body and extract useful information.
If you have followed the instructions given in the two practice tests before this lecture, you must have successfully setup the backend of a page where hotels can be seen (on the Hotel Manager website).
In this lecture, you can compare your achievement with what is expected.
When creating an API Gateway Lambda Authorizer, we must pass the token (a Jason Web Token) to the Lambda Authorizer. The Lambda Authorizer then must validate the token. The validation of the token is done with a private key that is given to us by AWS Cognito. In this lecture, we explore the structure of a Jason Web Token further, and we learn about JSON Web Key Sets and their relationship with JWT. This information is crucial for validating idToken correctly.
This topic explains validating a Jason Web Token using a Jason Web Key Set in an API Gateway Lambda Authorizer.
In this topic we will explore the options of authorizing the user and making sure that the caller user of an API has enough privileges to access a microservice.
In this lecture we will deploy our Lambda Authorizer, and attach it to an existing API in AWS API Gateway. Then we perform an end-to-end test.
What is Command and Query Responsibility Segregation?
Event-Driven microservices may face challenges that are stemmed from the fact that event buses may deliver a message more than once or because a microservice can be cloned several times for the sake of scaling out and coping with the increased load. In this topic, we will analyse such situations and learn what patterns can handle these challenges.
In this tutorial, you'll discover how to use AWS SNS (Simple Notification Service) SDK to publish an event after creating an object with AutoMapper and mapping the correct values to its properties. By following this guide, you'll learn how to leverage the power of AWS SNS to publish and manage notifications within your application easily.
Elasticsearch is a powerful and versatile distributed search and analytics engine, ideal for enhancing the search functionality of websites and applications. Leveraging the open-source technology of Apache Lucene, Elasticsearch provides a RESTful API that enables easy indexing and searching of data with support for full-text, real-time, faceted, and geospatial search capabilities.
If you want to implement Elasticsearch in a microservice architecture, you can easily integrate it with other components to achieve a comprehensive solution. For instance, in the next topic, we will explore how to create a microservice that receives a HotelCreated event and publishes it to an Elasticsearch instance. This setup will allow you to use Elasticsearch to provide users with a seamless and efficient search experience while leveraging the benefits of microservices, such as scalability, agility, and fault tolerance. So, whether you want to improve website search or build a more efficient data analytics solution, Elasticsearch is an excellent tool in your technology stack.
In AWS, Amazon OpenSearch Service is used to provision an Elasticsearch cluster.
The Idempotent Consumer pattern is an event-based design pattern that ensures events are processed only once, even if delivered multiple times.
Using the Idempotent Consumer pattern can help ensure reliable message processing and avoid duplicated work.
In this lecture, we will create a microservice that receives the events from the Event Bus and writes them into an Elasticsearch instance. It implements Idempotent Consumer pattern to make sure an event is written to Elasticsearch only once.
In this lecture, we will complete the code of our "Updater" microservice that catches the events from an event bus and puts them into a read-optimised data store such as Elasticsearch. This lecture is related to the CQRS pattern.
Another thing that you will learn is how you can test your AWS Lambda locally before it is deployed to AWS. Testing an AWS Lambda locally will significantly improve your development speed.
What is containerisation, and what are the benefits of deploying microservices in the form of containers? In this lecture, we will answer such questions. We will also explore the AWS services that enable us to deploy our microservices as containers.
Now that our Search API is ready, we must create a Docker Image to use it and create Docker Containers. A Docker container will represent our actual microservice. What you will learn includes the syntax of a dockerfile, as well as docker commands for building images and running containers.
Once a Docker image has been successfully created, it must be pushed to a registry. AWS has an Elastic Container Registry (ECR) service, a subsidiary of Elastic Container Service (ECS). This lesson will teach you how to push your Search microservice to ECR.
AWS Fargate is a serverless model for running Docker containers. In this lesson you will learn the steps that you need to take to deploy your Docker image to ECS and launch it with Fargate.
Ideally, a microservice deployed to a Production environment must be deployed into a private subnet of a VPC explicitly created for hosting the application. Such microservice must not be exposed to the Internet either. In this case, and without a public IP, API Gateway will not be able to reach the microservice.
In this lesson, you will learn how to set up API Proxy and your microservice container so that they can work with a private IP only.
The circuit breaker pattern is a crucial concept in microservices architecture that helps prevent system failures and enhances the system's overall reliability. It acts as a safety mechanism that monitors the communication between microservices and prevents cascading losses when one microservice malfunctions.
By implementing the circuit breaker pattern, microservices can isolate themselves from failures and reduce the impact of a system outage. Additionally, the circuit breaker pattern can provide real-time monitoring of the system's health and help detect potential issues before they escalate.
In this lecture, you will learn how a Rest API can implement the Circuit Breaker pattern.
Microservices patterns, especially event-driven ones, are best suitable for large enterprise systems critical for a business's success. Such enterprise systems must be highly available and be able to receive, accept and process requests at all times. Therefore it is crucial to make their microservices as resilient as possible. One of the main design patterns in this context is the Event Sourcing Pattern. With Event Sourcing Pattern, microservices capture changes as a sequence of events stored in an event log. By subscribing to these events, other microservices can update their state accordingly. Using the Event Sourcing Pattern helps microservices maintain independent databases, which boosts their resilience and scalability. In addition, theIn addition, theIn addition, the pattern provides an audit trail of all system changes, which is handy for debugging and compliance.
Event sourcing microservices are a popular approach in modern software architecture, where each microservice maintains its own event store and database. This architecture style allows for efficient and scalable storage and retrieval of events, as well as providing a reliable source of truth for all data changes. By storing every change as an immutable event, developers can easily trace and debug issues, and the system can quickly recover from failures. With event sourcing microservices, businesses can build robust, event-driven architectures that are highly resilient and fault-tolerant, making them an excellent choice for mission-critical applications.
This lecture will deploy the Booking—command microservice pushed to AWS ECR as a Docker container to AWS Fargate. To create containers based on the Docker image in hand, we will use the Service model (as opposed to Task) to compare the pros and cons of the two deployment models.
HTTP API in AWS API Gateway is a lightweight and cost-effective option for building APIs that can be easily integrated with AWS Lambda and any HTTP endpoints. Unlike REST API, HTTP API provides a simplified API creation experience with reduced features, making it easier to configure and manage. For example, with HTTP API, you can define API routes and methods, configure authorization and access control, and set up routing rules for API requests. Additionally, HTTP API supports the latest version of the WebSocket protocol, making it easier to create real-time applications with bidirectional communication between clients and servers. Overall, HTTP API in AWS API Gateway is an excellent choice for building modern and scalable APIs easily integrated with other AWS services.
In this lesson, we will create and secure an HTTP API for our Booking Command microservice.
CQRS (Command Query Responsibility Segregation) is a software design pattern that separates the write and read operations of a system. By implementing CQRS, developers can create a more scalable and performant architecture. Building a Query Microservice with Docker and ECS is a popular way to implement CQRS in a distributed environment. With Docker, developers can create lightweight and portable containers that can be easily deployed on any platform. Amazon ECS (Elastic Container Service) is a scalable container orchestration service that simplifies the deployment and management of Docker containers. By combining CQRS with Docker and ECS, developers can create a powerful and flexible microservice architecture that can handle large amounts of data and complex queries. Whether you are building a new system or modernizing an existing one, implementing CQRS with Docker and ECS can help you achieve better performance and scalability.
Service discovery pattern is a crucial aspect of modern distributed systems, enabling them to locate and communicate with other services in the network dynamically. It is a mechanism that allows services to advertise their availability and will help clients to discover and connect to these services. With the increasing popularity of microservices architecture, efficient service discovery has become more critical than ever. Organizations can use a service discovery pattern to ensure their services are always accessible, even as they scale up or down. This not only enhances the performance and reliability of the system but also reduces the complexity of managing the infrastructure. Service discovery is a critical component of any modern application architecture, and its proper implementation can significantly improve the user experience.
AWS CloudMap is a powerful service discovery tool that enables developers to easily manage and discover services in a microservices architecture. With CloudMap, developers can register any service with a unique name and metadata, making it easier to locate and connect with other services. CloudMap also enables developers to create custom namespaces and DNS routing policies, making it easier to manage services across multiple AWS accounts and regions. Additionally, CloudMap integrates with other AWS services such as Amazon Route 53, Amazon Elastic Container Service, and AWS Fargate, making it even easier to manage and discover services in complex and dynamic environments. By leveraging CloudMap, developers can build scalable, resilient, and fault-tolerant microservices architectures that can easily adapt to changing business needs. Overall, AWS CloudMap provides a comprehensive and flexible service discovery solution for modern microservices architectures, enabling developers to build and deploy complex systems with ease.
If you want to create an HTTP API in AWS, using AWS API Gateway and AWS Cloud Map can be an efficient solution. AWS API Gateway is a fully managed service that enables you to create, deploy, and manage APIs at any scale. AWS Cloud Map, on the other hand, is a highly available service that provides a central registry for your application resources. By combining these two services, you can easily create and manage HTTP APIs that are highly available, scalable, and easy to maintain.
Deploying a Docker microservice to AWS ECS with EC2 launch type is a powerful and flexible way to manage your containerized applications. This deployment strategy lets you launch and manage containers using EC2 instances, giving you complete control over your infrastructure. With ECS, you can quickly deploy, run, and scale Docker containers across a cluster of EC2 instances, making it an ideal choice for building scalable and resilient microservices. Additionally, deploying to AWS ECS with EC2 launch type provides many benefits, including improved security, increased scalability, and reduced operational costs. By following best practices and leveraging the powerful features of ECS, you can quickly deploy and manage your Docker microservices on AWS.
Creating an HTTP API for ECS Microservices with EC2 Launch Type can be straightforward with the right tools and understanding. By leveraging the capabilities of Amazon's Elastic Container Service (ECS) and EC2 Launch Type, developers can quickly build, deploy and manage HTTP APIs. In addition, by following best practices and utilizing the available tools and resources, developers can quickly create and deploy HTTP APIs for ECS Microservices with EC2 Launch Type.
The Sidecar pattern is a design pattern used in microservices architecture, where a secondary container (known as a sidecar) is deployed alongside the main container of an application. The sidecar container is responsible for providing additional functionalities such as monitoring, logging, security, and other auxiliary tasks that the main container requires but cannot perform by itself.
Logging is an essential aspect of modern software development, especially in the context of microservices. As applications become more complex, it becomes increasingly difficult to identify and resolve issues that may arise in production. This is where logging comes into play by providing developers with a way to capture and store relevant data, such as error messages, performance metrics, and user activity. In microservices, logging becomes even more critical, as multiple services may be involved in a single request, making it challenging to pinpoint the source of an issue. By implementing a robust logging strategy, developers can gain greater visibility into their applications, enabling them to diagnose and fix problems quickly.
Logging Solutions in AWS are critical for monitoring and troubleshooting your applications, infrastructure, and security. AWS offers various logging services, such as Amazon CloudWatch, AWS CloudTrail, and Amazon Elasticsearch Service, that can help you collect, process, and analyze your log data scalable and cost-effectively. These services provide valuable insights into your system's performance, errors, and user activities, allowing you to detect and resolve issues quickly. By implementing logging solutions in AWS, you can enhance your application's reliability and security and ensure compliance with regulatory requirements. So, if you're looking for effective logging solutions, AWS has covered you!
Setting up an AWS Cognito Identity Pool is an excellent option if you want to secure your Kibana dashboard with user authentication. Cognito Identity Pool provides a simple and secure way to manage user identities and their access to your application resources. With this setup, you can create a user pool in Cognito, configure authentication providers, and then use AWS Identity and Access Management (IAM) roles to control access to your Kibana dashboard. By leveraging Cognito Identity Pool, you can ensure that only authorized users can access your Kibana dashboard while maintaining a smooth user experience. With a few simple steps, you can keep your Kibana dashboard up and running securely.
Microservices architecture has gained popularity and is now widely used by solution architects and developers to build scalable, maintainable, and secure software systems and applications.
Although microservices have significant benefits, building and maintaining a complex system can be challenging. Some frameworks, such as Django, tried to reduce this complexity and overhead with a "battery-included" approach, which takes care of essential aspects of a microservices-based ecosystem in the background.
With the advent of public cloud services such as Amazon Web Services (AWS), applications have become distributed. Such distributed applications use the native services of AWS, such as Event Bus, API Gateway and Security, to form a Cloud-Native application.
Unfortunately, frameworks like Django are unsuitable for building a modern cloud-native distributed system because they promote monolithic architecture and may produce significant service-level dependencies. Such frameworks also may impede developers from learning the nitty-gritty of how event-driven microservices work.
This course teaches how a modern distributed system is architected and coded via a complete Hotel Booking System. You will be hands-on and will code this system with me. This hotel booking system utilises the native services of Amazon Web Services (AWS) and Event-Driven architecture to build a system that is easily maintainable, resillient and can scale virtually unlimited.
What you will learn:
The architecture of a modern event-driven and cloud-native distributed system.
AWS services are used to build microservices, including Incognito, API Gateway, Lambda, ECS, DynamoDB, S3, SNS, CloudMap, and Secrets Manager.
Python coding for building small and independent microservices using FastAPI. If you prefer Flask for creating APIs, you can use that instead.
Serverless Python Microservices.
Architectural patterns for microservices, including API Gateway, Event Bus, Circuit Breaker, CQRS, and more.
Containerised Docker Python Microservices.
What is not included:
Web Development. I have, on purpose, not included coding a web UI using a Javascript framework, i.e., React, so that we focus solely on microservices. The course comes with a simple HTML/Javascript UI. This is NOT a full-stack development course.
Legacy microservices and web frameworks such as Django.
What you must already know:
Elementary-level Python programming.
Intermediate-level knowledge of Amazon Web Services (AWS). I will teach you in details how each service is configured; however, you will need some AWS experience.
Basic understanding of what containers and Docker are.
To successfully master the architecting and building of Python microservices, you must come in with an open mind and be ready for a paradigm shift. At the end of this course, you will be praised for your knowledge and skill in quickly building a modern enterprise-scale system.
Enrol now and join me on this exciting journey!