AWS Lambda & Amazon EC2 – Two Paradigms, One Decision

The fundamental answer to such an obvious issue should be the provision of code by the client in any supported language if the event-managed service is to control and monitor AWS Lambda. In counterpart, for customization and adaptations to own needs, Amazon EC2 is the most flexible solution and has a range of EC2 instances. However, this is just a brief introduction. A deeper comparison is needed to understand each of these services and what are the benefits they bring to your company and / or business.

About AWS Lambda

Its main function is to execute code without server support or server infrastructure. AWS Lambda comes into play only when invoked to execute the code, escalating automatically regardless of the number of requests per second that are made from one moment of time to another. The supported codes work practically for any application without any type of administration.

The support of AWS Lambda guarantees High Availability which includes administration, maintenance, capacity and automatic scaling activities. AWS Lambda currently supports Node.js, Java, C #, Go and Python.

What do I need to know before using AWS Lambda?

Essential components of an application based on AWS Lambda

  • Lambda function: fundamental element, it consists of custom code and dependencies.
  • Event source: an AWS service, such as Amazon SNS, or a customized service, which activates the function and executes its logic.
  • Subsequent resources: an AWS service such as DynamoDB tables or Amazon S3 buckets, which it calls its Lambda function once activated.
  • Log flows: although Lambda automatically monitors invocations of the function and registers metrics in CloudWatch, you can comment on the code of your function with customized log statements that allow you to analyze the execution flow and the performance of your Lambda function to guarantee that works correctly.
  • AWS SAM: a model to define applications without a server. AWS CloudFormation natively supports AWS SAM and defines a simplified syntax for expressing serverless resources.

The Real Intrinsic Advantage of AWS Lambda

You pay only for the executed code, this without the need of administrative responsibility. You just need to upload your code and Amazon AWS takes care of the rest. However, we can not leave aside the monitoring capacity that reverts special importance in services of this type. That’s where Dashbird.io offers its most remarkable strength.

About Amazon EC2

Amazon Elastic Compute Cloud (Amazon EC2) is a web service that provides secure and modifiable cloud computing capabilities. EC2 allows users to rent virtual computers in which they can run their own applications. This type of service implies a change in the computer model by providing computing capacity with a modifiable size in the cloud, paying for the capacity used. Instead of buying or renting a certain processor to use it for several months or years, in EC2 the capacity is rented per hour.

The Amazon EC2 web services interface allows you to obtain and configure capacity with minimal effort. It provides complete control over computing resources and can be executed in Amazon’s accredited computing environment. Amazon EC2 reduces the time it takes to get and start new server instances in a matter of minutes, allowing you to quickly scale up capacity, either by increasing or reducing it, as your needs change. Amazon EC2 changes the economic model of computing, since you only have to pay for the capacity you actually use.

Amazon EC2 relies primarily on virtualization technologies, allowing you to use a wide variety of operating systems through its web services interfaces, customize them, manage network access permissions and run as many systems as you wish. EC2 allows the scalable deployment of applications by providing a Web service using Amazon Virtual Machines called Instances and which in turn will contain any desired software. A user can create, launch and end server instances as much as they need, by paying for active hour / server, for this reason the term “elastic” is given. EC2 provides users with control over geographical locations of instances that allow for optimization of latency and high levels of redundancy. Amazon EC2 also provides data recovery tools and strong isolation from other processes performed on their machines.

So, what should I consider when choosing the most appropriate tool?

With Amazon EC2, there is a wide range of tools available to monitor and register your instances automatically; however, the configuration of the triggers is not automatic. These must be configured by Amazon AWS upon approval by themselves. Unlike Amazon Lambda, which is, always using the appropriate language and the code is correct for the start of a triggered event, all information is collected specifically for those assets, allowing real-time analysis of raw data. In Dashbird.io we have a wide range of experiences shared by satisfied clients in the understanding of the monitoring of their programmed functions.

Amazon Lambda suppresses the need to abstract or worry about infrastructure, and companies highlight the benefits they acquired. Amazon Lambda offers sample code for real-time file processing, real-time flow processing, extraction, transformation, data validation, servers without servers. IoT Sensors to detect and redirect information, mobile backends for social media applications and web applications, that is, Weather Application. Amazon AWS has shown once again why they are the leading company in cloud computing services.

However, it is necessary to emphasize that there is a cost structure inherent to each type of service that can make a difference, as the case may be, when choosing one or the other for our needs. In the best scenario, a Lambda function running for 1 hour (even several calls to the same function that summed up one hour) can cost $ 0.030024, while an EC2 on demand service with similar statistics costs $ 0.0059.

At first glance, everything favors EC2, however it must be remembered that this EC2 server remains active listening to new connections during that hour, underutilized with few calculations, while a Lambda function, will hardly run for a whole hour, unless it is doing something very wrong. In this case, thinking about computing efficiency. Added to this, is the monitoring offered by Dashbird.io to optimize this efficiency to the maximum.

Read our blog

Introducing easy custom event monitoring for serverless applications.

Today we are excited to announce scheduled searches – a new feature on Dashbird that allows you to track any log event across your stack, turn it into time-series metric and also configure alert notifications based on it.

Why and How to Monitor Amazon OpenSearch Service

One of the most vital aspects to monitor is the metrics. You should know how your cluster performs and if it can keep up with the traffic. Learn more about monitoring Amazon OpenSearch Service.

Why and How to Monitor AWS Elastic Load Balancing

Dashbird recently added support for ELB, so now you can keep track of your load balancers in one central place. It comes with all the information you expect from AWS monitoring services and more!

More articles

Made by developers for developers

Dashbird was born out of our own need for an enhanced serverless debugging and monitoring tool, and we take pride in being developers.

What our customers say

Dashbird gives us a simple and easy to use tool to have peace of mind and know that all of our Serverless functions are running correctly. We are instantly aware now if there’s a problem. We love the fact that we have enough information in the Slack notification itself to take appropriate action immediately and know exactly where the issue occurred.

Thanks to Dashbird the time to discover the occurrence of an issue reduced from 2-4 hours to a matter of seconds or minutes. It also means that hundreds of dollars are saved every month.

Great onboarding: it takes just a couple of minutes to connect an AWS account to an organization in Dashbird. The UI is clean and gives a good overview of what is happening with the Lambdas and API Gateways in the account.

I mean, it is just extremely time-saving. It’s so efficient! I don’t think it’s an exaggeration or dramatic to say that Dashbird has been a lifesaver for us.

Dashbird provides an easier interface to monitor and debug problems with our Lambdas. Relevant logs are simple to find and view. Dashbird’s support has been good, and they take product suggestions with grace.

Great UI. Easy to navigate through CloudWatch logs. Simple setup.

Dashbird helped us refine the size of our Lambdas, resulting in significantly reduced costs. We have Dashbird alert us in seconds via email when any of our functions behaves abnormally. Their app immediately makes the cause and severity of errors obvious.