What is the difference between EC2 and Lambda?
EC2, or Elastic Compute Cloud, is much more flexible than Lambda. You should use EC2 when you need to customise the environment with regards operating system, capacity etc. Lambda on the other hand is an "off the shelf" solution, where all the admin overhead is looked after for you. You have very limited control over the Lambda environment.
For a typical set up, it's likely that you will be running the main application(s) on EC2 and using Lambda for specific definable aspects of the overall application.
What languages does AWS Lambda support?
AWS Lambda supports a range of popular languages: node.js, C#, Java & Python.
Microsoft .Net developers can use the AWS Toolkit within the Microsoft Visual Studio IDE, giving them the ability to easily develop & debug Lambda Functions.
And you'll also find that the AWS Toolkit for VS creates the deployment package.
How do I know my Lambda functions will run fast enough?
To keep things simple, you configure the amount of memory each Lambda function is allowed to use. AWS then allocates the compute power based on a simple rule.
If you require better performance from your Lambda function then it's just a question of allocating more memory to it.
And with the ability to run the same function concurrently multiple times, there is no reason why you should suffer from poor performance.
Serverless computing does not make any sense to me
The term "serverless" is less than helpful. It is deliberately used by Amazon to make you stop and think, "what do they mean".
It is used to emphasise that as far as you and your team are concerned you have no server to concern yourself with. Instead all the server admin, patches, monitoring and provisioning is invisible to you.
You need only concern yourself with the code, or functions, that run on the server.
You can invoke that code through any number of means, giving you the control you need without any of the admin costs.
Serverless computing with Lambda
- No admin overhead, with a pay for use business model.
- Microsoft .Net developers can build and deploy Lambda Functions from within Visual Studio.
- Trigger your Lambda Functions in a variety of ways.
- Provides a simple horizontal scaling option.
- An off the shelf solution, simpler to use than EC2
Surely starting up a Lambda function is going to be slow?
It will take a second or so to load and begin the execution of your Lambda Function, so it's important that the design of the overall solution takes that into consideration.
You also need to properly consider that the maximum run time of the function can be no longer than 5 minutes. That means you need to ensure that your Lambda Function completes in a tidy, controlled and safe manner. At deployment you can set the termination time to be less than 5 minutes.
Will I have security issues using AWS Lamba?
Lambda has the same protections as EC2, making it extremely secure.
AWS Lambda stores code in S3 (Simple Storage Service) and encrypts it at rest, while also carrying out integrity tests when it is running.
Will I be able to see how my Lambda Function is performing?
Yes. Because AWS Lambda is a fully managed service, it automatically monitors Lambda functions. It does this by using Amazon CloudWatch as well as the AWS Lambda Console and the other AWS Consoles.
If you are interested in request and error rates you can see these on the AWS Lambda console & the CloudWatch console. Performance metrics related to compute and memory etc can be seen on the AWS Management Console.
How easy is it to scale up a Lambda Function?
You can scale up simply by carrying out multiple parallel executions of your Lambda Function. This gives you truly instant flexibility with respect to scaling - both up and down.
And of course you can always configure your Lamba Function to use more memory when that makes sense. Increasing the memory allocated will result in more compute power being allocated.
Can I use threads within a Lambda Function?
Yes, though obviously, you have to consider that any threads you create will need to share the resources that have been allocated to the Lambda Function.
You'll want to bear that in mind.
But in short you can use any normal operating system features within a Lambda Function.
When is it best to use EC2 rather than Lambda?
You'll want to use EC2 for you main application, ie the part of your application that is running 24/7. EC2 allows you to configure the compute, storage, memory and other network features that are right for your business.
AWS Lambda, on the other hand, is ideal for carrying our burst activities where loads have spiked, or when you need to carry out regular admin activities on your main application. Perhaps filtering data, analysing logs, deleting redundant data and so on. Activities that would impact the performance of your main application are ideal.
What limits will cause me problems with AWS Lambda?
Although extremely scalable there are limits - nothing is infinite in the world of computing.
The limit on the number of concurrent functions executing within an Account is 1000. You can specify a concurrency limit for a particular Function if needed, or simply let the total pool be shared among all the functions.
If this limit causes you problems, and results in throttling, then simply add another account.
There are also limits on memory usage, file descriptors and the number of threads and processes per Function invocation.
See improved performance overnight
If you have periods when your online application slows, then the chances are that the bottleneck can be moved onto AWS Lambda and addressed fast.
Perhaps you are checking log files, or carrying out database filtering, or have periodic surges in data processing demands. Whatever it is, by moving areas of your application to AWS Lambda overall performance can be dramatically improved.
Performance with only minimum costs
With a pay per usage model Amazon have given businesses a cost effective way to scale their business applications.
Parts of your application which only run to cope with peak demands can be deployed to AWS Lambda and only envoked when required. The result is reduced server costs.
AWS Lambda Consultancy & Development experts
You may have reached a point where adding more and more server power simply isn't an option. You may be wondering why your Admin costs are growing fatser than you ever imagined possible.
In situations like that it's time to look at your Scale Up and Scale Out options. AWS Lambda can deliver both: Scale Out by envoking AWS Lambda Functions with "serverless" computing and Scale Up by increasing the power you allocate to each individual Lambda Function.
Our team of AWS Lambda experts are on hand to help with your development and Lambda deployment. We have the pragmatic skills that you need to get your critical business systems moving.
What aspects of your application need moved to AWS Lambda, how can these elements be structured, how can you ensure that your Lamba Functions perform perfectly. We have the answers to all your AWS Lambda questions.