Skip to main content

Command Palette

Search for a command to run...

DAY 12 : 🖥️ EC2 vs. Lambda: Choosing the Right AWS Compute Service for Your Needs

Published
2 min read
DAY 12 : 🖥️ EC2 vs. Lambda: Choosing the Right AWS Compute Service for Your Needs
A

"I'm a 3rd-year Computer Engineering student at Marwadi University with skills in C++, web development (MERN stack), and DevOps tools like Kubernetes. I contribute to open-source projects and share tech knowledge on GitHub and LinkedIn. I'm learning cloud technologies and app deployment. As an Internshala Student Partner, I help others find jobs and courses." now currently focusing on #90DaysOfDevops

Amazon EC2 (Elastic Compute Cloud) and AWS Lambda are two distinct compute services offered by AWS, each with its own use cases and benefits.

What is Amazon EC2? - Amazon Elastic Compute Cloud

Amazon EC2:

  • Provisioning: Allows you to provision virtual servers (instances) in AWS within minutes.

  • AMIs: Amazon Machine Images (AMIs) are templates for deploying EC2 instances.

  • Instance Types: Offers a variety of instance types tailored for different workloads:

    • General Purpose: Balanced compute, memory, and networking resources; versatile.

    • Compute Optimized: High-performance CPUs for compute-heavy tasks like batch processing, media transcoding, and machine learning.

    • Memory Optimized: For memory-intensive workloads such as databases.

    • Storage Optimized: High I/O operations per second (IOPS) for storage-heavy tasks.

    • Accelerated Computing: Uses hardware accelerators (e.g., GPUs) for tasks like graphics processing and data pattern matching.

  • Operating Systems: Supports a wide range of OS options, including RHEL, SUSE, Ubuntu, Amazon Linux, and Windows.

  • Processors: Offers various processors, including ARM, AMD, and Intel.

AWS Lambda Logo - Brian Cline

AWS Lambda:

  • Serverless: Lets you run code without provisioning or managing servers. AWS handles server maintenance, scaling, capacity provisioning, and logging.

  • Use Cases: Suitable for file processing, stream processing, web applications, and mobile/web backends.

  • Components:

    • Function: A piece of code written in a supported programming language.

    • Trigger: An event that initiates the function, such as an S3 file upload, HTTP request, CronJob, or DynamoDB update.

    • Event Info: Data about the event that triggered the function, passed to the function.

  • Benefits: No server management, automatic scaling, and pay-as-you-go pricing.

  • Downsides: No local state, limited to 15-minute execution time, and potential cold start latency.

  • Pricing Factors: Based on the number of function executions, execution duration, and memory/CPU usage.

Both services offer unique advantages depending on the specific needs of your application, with EC2 providing more control over the server environment and Lambda offering a fully managed, serverless experience.

Thankyou for reading !!!!!

More from this blog

A

Anand Raval

118 posts

Hello I am Anand Raval , i contributed my work in robotics(arduino uno) , fronted web devloper,competitive programming, now currently focusing on #90DaysOfDevops