To set the scene for some more advanced details we'll find out about later on, we need to derive some understanding about the characteristics of an AWS Lambda function. For brevity, from here on, I'll refer to an AWS Lambda function as a function.
Simply put, a function is a piece of your own code that executes every time it is triggered by an event. A function can be written in many different programming languages, and you can also bundle any libraries or dependencies that the code needs. A function is executed within a runtime provided by AWS, on a platform provided by AWS, and hosted on an infrastructure provided by AWS.
You may include code in your function that performs any task you like, within the bounds of the execution model. For example, you may use it to regularly check on the status of a web page, run some processing on a file, or respond to an attribute that has changed in AWS and take action. You are responsible for writing, testing, and deploying the code running the logic.
You do get the option to select how much memory is allocated to a function; this also governs the amount of CPU share that the function receives when it is executing. CPU share is allocated relative to the amount of memory selected. The minimum amount of memory you can allocate is 128 MB, but this goes all the way up to 3,008 MB (at the time of writing). This means you can be quite fine-grained about performance, with many options to tune and optimize. However, your choices do have cost implications, which we will explore shortly.