DevOps For Developers

Lambda

Kirk Haines

kirk.haines@joshsoftware.com

Lambda?

Lambda?

Lambda?

In computer programming, an anonymous function (function literal, lambda abstraction, or lambda expression) is a function definition that is not bound to an identifier.

-- https://en.wikipedia.org/wiki/Anonymous_function

Lambda?

This sounds more like

Developers for DevOps

than

DevOps for Developers

Lambda?

That's kind of the point of AWS Lambda.

Lambda!

AWS Lambda lets you run code without provisioning or managing servers.

Lambda!

Developers without the Ops?

Lambda!

It's not quite that simple, but...

 

Benefits:

  • No servers to provision or to manage
  • Continuous scaling
  • High concurrency capacity
  • Consistent, predictable performance
  • Reduced costs!
  • Resilient

Lambda!

Drawbacks

  • Stateless
  • No control over the environment
  • Limited execution time
  • There are hard limits on capacity
  • Cold start delays
  • You pay for everything -- pricing is complex to calculate
    • amount of concurrency
    • amount of RAM
    • number of requests
    • compute time of requests

Lambda!

Support for a variety of languages

 

  • Node.js 12/10
  • Python 3.8/3.7/3.6/2.7
  • Ruby 2.7/2.5
  • Java 11/8
  • Golang 1.x
  • .NET Core 3.1/2.1
  • Others (like Crystal) via custom runtime

Lambda!

But really, no DevOps?

Lambda!

There is still some DevOps, yes.

 

But at least there are no servers to manage or provision.

Lambda.

Use Cases?

  • Data processing and analysis
  • File processing and transformation
  • Web/Mobile API servers
  • Highly parallel tasks like email delivery
  • Notifications and event processing
  • Time scheduled functions
  • Triggered monitoring handlers
  • ....many others!

Lambda.

I'm in!

How do I use it?

Lambda.

AWS Console

Lambda.

AWS has hundreds of sample apps and blueprints to help one get started.

Lambda.

Anatomy of a Lambda Function

  1. It has a handler --this is the code that will be executed.
    It should expect to receive JSON input and to return JSON output.
  2. It has a runtime environment -- this is typically determined by the language that the handler is implemented in.
  3. It has at least one trigger -- this is something that causes the function to be invoked.

Let's Do a Simple One

Live Coding Time...

DevOps For Developers: Lambda

By wyhaines

DevOps For Developers: Lambda

DevOps topics are frequently a mystery, even to experienced developers. This presentation covers the use of the AWS Lambda service, teaching the devops concepts that are useful for a developer to know in order to dive in and start using Lambda themselves.

  • 558