This content is part of the Essential Guide: AWS Lambda architecture brings serverless to enterprise cloud

How do I manage and monitor AWS Lambda code?

AWS Lambda code creates threads and processes to help companies thrive. But how should developers manage Lambda functions for the best results?

Coding for AWS Lambda can be slightly different than coding for traditional development languages. AWS Lambda supports JavaScript (Node.js), which can include JavaScript libraries. Lambda functions can be used to launch other processes, such as scripts in Java, Ruby, Bash and Python.

Amazon Web Services (AWS) Lambda code creates threads and processes, but resources that AWS provisions -- memory and network bandwidth -- are shared among the threads and processes that are created. This can affect performance of the Lambda function.

AWS Lambda also relies on a "stateless" coding model, meaning the code cannot rely on the computing infrastructure that it runs on. For example, Lambda code cannot assume any particular hardware, system configuration, disk contents and so on. In addition, Lambda code should not be persistent if possible; persistent, or stateful data, must be stored in a cloud-compatible storage resource such as Amazon Simple Storage Service, a database like Amazon DynamoDB or another third-party online storage service. Lambda can access stateful data for later use.

There are several restrictions on activities within Lambda. For example, only TCP/IP sockets are available; TCP Port 25 activities, typically used for Simple Mail Transfer Protocol, are also limited to prevent misuse or malware attacks. Debugging system calls are also prohibited, preventing users from gaining access to the underlying Lambda infrastructure.

Lambda code is created using the console or can be packaged and uploaded as a compressed (zip) file. Include any libraries in the compressed package. If you don't want to use the Lambda console to create or upload functions, you could upload compressed packages through the Lambda command-line interface (CLI). The Lambda console and CLI allows developers to list, update and delete functions as needed.

Monitoring will report statistical data on AWS Lambda functions, including the total number of requests (invocations), errors, durations and throttled requests. Administrators can monitor AWS Lambda using the console, CLI, Amazon CloudWatch or APIs in the Lambda code that report to third-party monitoring tools.

Next Steps

How to develop code and run functions with AWS Lambda

AWS Lambda aims to shear time off cloud development

IT pros can avoid management overhead on AWS Lambda

How AWS Lambda pushes PaaS to next level

AWS Lambda to drive innovation in the cloud

Dig Deeper on AWS Lambda