Last updated on May 29, 2024
At the core of every application is computing power which is mostly in the form of a server but, do you know about Serverless computing and Microservices architecture? When it comes to building your cloud applications, it’s certainly an advantage to know about servers and architecture. Welcome to part 1 of my 6-part series called Basics of the Basics to AWS where I introduce you to AWS by breaking it down into smaller digestible concepts related to software development.
In this article, I will be talking about AWS Computing Services. Before we proceed with the services, we’ll be talking about Monolithic vs Microservices architecture and Traditional vs Serverless. The services included in this article are Amazon EC2 and AWS Lambda. Let’s get started!
Monolithic vs Microservices
When starting out on your application, you have to decide what type of architecture you’ll be using. This helps you model your application based on your chosen architecture. Simply, we have Monolithic Architecture and Microservices Architecture. A Monolithic Architecture is one where all the components of your application – UI, Backend, Database Interface – is in a single codebase. A Microservices Architecture is one where your components are “decoupled” in different codebases; an architecture that uses functionality from other applications or made by a third-party. Each has their own pros and cons, some of which are in the table below:
For this specific application, we will be choosing a Microservices Architecture so that we can decouple our components and have an easier time scaling and maintaining our application.
Traditional vs Serverless
No matter what we do, an application must have a server. This can be an ordinary personal computer or a dedicated server. A server is like the brain of our application which handles all the processing and coordinates with each component to ensure that the users get the proper output. Traditionally, companies would have dedicated computers to run their applications 24/7. As technology advances, cloud computing is invented, and cloud service providers then give companies the ability to access digital or virtual servers from the internet. This lessened the costs for companies, but they still have to pay for the 24/7 time that their server is running, even though there are currently no users of the application. This was a big problem, especially for smaller companies or entities, until Serverless was invented. In Serverless, you still have a server, but you’d only be paying now for when your application is actually in use. Thanks to Serverless, we can scale down the costs for our servers down to zero.
Amazon EC2 and AWS Lambda
Introducing Amazon EC2 and AWS Lambda. These are the two main AWS services for computing. Amazon EC2, which stands for Elastic Cloud Compute, allows users to create virtual servers called EC2 instances. These EC2 instances are just like physical servers but on the cloud. They can be configured through the AWS Console, and they can be set up by connecting to the instance through a terminal. EC2 instances have 3 main states – Running, Stopped, and Terminated – and users pay for the time their EC2 instances are running, even if it isn’t really being used. On the other hand, AWS Lambda is the core AWS service for serverless computing. Through AWS Lambda users can upload their application’s functionality through AWS Lambda Functions. These functions run only when they are triggered and will immediately stop once the processing is finished. This makes it a more cost-efficient method. As you might’ve guessed, Amazon EC2 is for Traditional, while AWS Lambda is for Serverless. For this application, we will be using both. Since our application is decoupled, we can use Amazon EC2 to host our Frontend or UI 24/7 while our Backend or Business Logic is stored in AWS Lambda as Functions.
We are now done with the first part of our Basics of the Basics to AWS series. In this article, I talked about the differences between Monolithic and Microservices architecture, traditional servers and Serverless, Amazon EC2, and AWS Lambda. In the next article, we will be talking about storage options in AWS.