Serverless Architecture – A better way to manage cloud and workloads for large-scale products
  • |
  • 4 minutes read

Introduction

Amazon Elastic Compute Cloud (Amazon EC2) is a web service provided by Amazon Web Services (AWS) that offers scalable computing capacity in the cloud. It enables users to launch and manage virtual servers known as instances, on the AWS cloud infrastructure.

EC2 provides users with full control over their virtual instances. Users can choose the operating system, customize network configurations, and install software of their choice. This flexibility allows for the deployment of a wide range of applications, from simple websites to complex enterprise systems.

Serverless Architecture for a large-scale product

JetPacked is a product designed specifically for schools, providing them with a comprehensive suite of tools and services to enhance their operations and improve the educational experience of their students. The product is built using the latest web technologies and is deployed on the Amazon Web Services (AWS) cloud platform.

The backend technology is built using Node.JS and is deployed on EC2 instances as microservices, providing high scalability and flexibility to handle large volumes of data and traffic. The frontend of the application is built using Angular, providing an intuitive and modern user interface that is easy to use and navigate.

JetPacked is built on a MySQL database, which is highly scalable, reliable, and secure. This database stores all the critical data of the application, including student records, course materials, and school administrative data.

To provide the best user experience, JetPacked is deployed using CloudFront for frontend, which is a content delivery network (CDN) service provided by AWS. CloudFront enables fast and secure delivery of the frontend to users, ensuring that the application is available at all times and performs well, even during peak traffic periods.

AWS EC2 based Architecture

Challenges with EC2-based architecture

Initially, the EC2-based architecture worked well when serving a single client. However, as the need arose to support multiple clients, we faced challenges in handling multi-tenancy. Each tenant required separate databases and microservices to manage different workloads. These requirements highlighted limitations within the EC2-based architecture.

Instance Types

EC2 instances come in a variety of types, each with varying amounts of CPU, memory, and network performance. It’s important to choose the right instance type that matches the workload of the application to avoid performance issues and unnecessary costs. This required manual intervention all the time to manage instances based on workloads.

Storage Limits

EC2 instances have a storage limit, which varies depending on the instance type. It’s important to monitor and manage storage usage to avoid running out of storage space, which can cause the application to fail.

Network Limits

EC2 instances have a large amount of network bandwidth, which can limit the application’s ability to handle large amounts of traffic. It’s important to monitor and optimize network performance to ensure that the application can handle increasing traffic loads.

Region and Availability Zone Limits

EC2 instances are available in different regions and availability zones, which can affect network latency and availability. It’s important to choose the right region and availability zone that matches the target audience of the application.

Cost Limits

EC2 instances can be costly, especially if not managed and optimized properly. It’s important to monitor and manage costs to avoid overspending and unnecessary expenses.

Elastic IP Limits

EC2 instances have a limited number of Elastic IPs available per account, which can be a problem when deploying multiple applications. It’s important to manage Elastic IPs properly to avoid running out of available IPs.

Security Limits

external threats. It’s important to implement proper security measures such as firewalls, encryption, and access control to minimize security risks.

How the product leveraged the benefits of Serverless architecture?

AWS ECS based Architecture

With updated architecture, we can leverage the power of serverless architecture and AWS services. 

Scalability 

With serverless architecture, JetPacked can scale dynamically based on the application’s traffic and usage patterns. AWS ECS can automatically launch new Docker containers in response to increased traffic and shut them down when traffic decreases. This ensures that JetPacked can handle any level of traffic without incurring downtime or performance issues.

Cost Savings

Serverless architecture can provide cost savings for JetPacked by reducing the need for dedicated servers and infrastructure management. With AWS ECS, JetPacked can pay only for the resources used by the Docker containers, without the need to purchase, configure, and maintain dedicated servers.

Performance

Serverless architecture can improve the performance of JetPacked by reducing latency and increasing the speed of execution. AWS ECS can deploy Docker containers in multiple availability zones and regions, which ensures that JetPacked can handle requests quickly, even for global users.

Security

Serverless architecture can enhance the security of JetPacked by providing built-in security measures such as encryption, access control, and automatic patching. AWS ECR can store Docker images securely, and AWS ECS can ensure that the Docker containers are launched securely with the appropriate IAM permissions and network configurations.

High Availability

Serverless architecture can provide high availability for JetPacked by automatically launching and terminating Docker containers based on the application’s traffic. AWS ECS can deploy Docker containers in multiple availability zones and regions, which ensures that it can handle any level of traffic without incurring downtime or performance issues.

Simplified Management

Serverless architecture can simplify the management of JetPacked by automating infrastructure management tasks such as scaling, monitoring, and patching. This ensures that it can focus on delivering high-quality education to its users without worrying about the underlying infrastructure.

Conclusion

Choosing between EC2-based architecture and serverless architecture depends on several factors and the choice depends on the specific requirements of your application. EC2-based architecture provides more control and customization, while serverless architecture offers scalability, cost efficiency, and simplified management for event-driven and variable workloads. It’s crucial to assess factors like workload patterns, development speed, cost considerations, and scalability needs before making a decision.

Vivek Navadia

Vivek Navadia has over 17 years of Product Engineering experience. He is a passionate and technical engineering leader and mentor with a sound record of solution-based critical thinking and positive results. He started his journey with Digicorp as a Jr. .Net Developer in 2006, and since then has played various roles of building teams to exploring cloud solutions and managing company wide products.

  • Posted on June 1, 2023

Vivek Navadia has over 17 years of Product Engineering experience. He is a passionate and technical engineering leader and mentor with a sound record of solution-based critical thinking and positive results. He started his journey with Digicorp as a Jr. .Net Developer in 2006, and since then has played various roles of building teams to exploring cloud solutions and managing company wide products.

Stay In Touch - Digicorp

Stay in Touch!

Get Our Case Studies, Newsletters, Blogs and Infographics Directly into Your Inbox