Lamda as a serverless architecture

What does it mean serverless architecture? Classic web app has a server spun up which is awaiting for users to come and serve them with responses of info. This requires to take care of load and bandwidth. All that means if one Million users are trying to reach your app at the same time your server has to have adequate capacity of CPU, RAM and network IO throughput to keep all of them happy.

 However, there is a quite handy alternative right on the shelf. AWS has presented Lambda a while ago and it has found its lovers along by offering to save cash.

Lambda function is a piece of code which is starting where it needed and all the rest of the time it’s just sitting and doing nothing. Unlike server you do not pay for anything until your code runs. On a top, if Million of users are deciding to come and visit your resource, Lambda will serve all of them at the same time. Also pricing model is based on number of runs. There are some pros and cons. Let’s have a closer look.
Lambda goes in several different flavours. This is matter of your choice: Python, Node, Java or Go. All of them have minor differences. For example, if you choose Python, in this case function runs very fast with a predictable stable benchmark.

Node on the other hand is not that consistent. Seems like Node version is starting process in the background and if your calls are following very close to each other or simultaneously and they are completed asynchronously.

Another characteristic is to be kept in the back of your mind is a cold start. In the background Lambda is starting a container in which your function is gonna run. So first execution includes container start-up time. Next, following functions are fast until container has to be restarted or added new one in order to keep with scaling requirements.

Embedded IDE at this moment is available for Python or Node. If you choose Go, then you have to create code base locally on your machine, zip it and upload it to the console. This is very straight forward process, but it is very handy to have an IDE on AWS side.

AWS SDK is included in dependency list in all languages by default. This means for us that it is very easy to manipulate with other AWS services to have reach functionality in our application. There is an unlimited amount of options are on the table. Like so API endpoint connected to Lambda, SNS or Cloudwatch alarms along with S3 events.

Lambda has some limitations, such as execution time, limits for a RAM and disk space usage. But they are not such horrible and we still have a room for a maneuver.

Leave a Reply

Your email address will not be published. Required fields are marked *