Live data from Hacker News

AWS Lambda – Best practices

cloudncode.blog

11–20 of 68 posts

Re: AWS Lambda – Best practices

#11
The biggest thing I have found about lambda is that if you plan to deploy with cloudformation backed by s3 you either need to do some hacks to ever update your function, manage versions in s3 or change the filename in s3 and cloudformation to trigger an update. It's a rather annoying issue.

I really wish that there was an always update flag on the cloudformation property to resolve this.

Re: AWS Lambda – Best practices

#12
Unfortunately, there's absolutely nothing here regarding things like git, or CI/CD, or how-to-use-it-when-a-medium-to-large-team-is-involved

If anyone has any research, thoughts, or comments on this side of Lambda, I'd love to learn more

Re: AWS Lambda – Best practices

#13
post #8

Earlier quoted context omitted.

I've been using Lambda since the beginning (was an early private beta user). I am actually considering writing a book or perhaps some courseware. I don't blog. Unfortunately, if I do I cannot post it here as it would defeat the purpose of using a throw-away account :(

Off-topic question: Why do people use throwaway accounts here on HN? Why is it so important that nobody knows who the real person behind posts is?

Because the information people give away is more important than their identity.

Re: AWS Lambda – Best practices

#14
post #10

As someone who uses Lambda heavily I find this post somewhat disappointing from a "best practices" standpoint. No mention of Lambda best practices like: - Using CloudFormation - IAM policies - Managing config - How to handle databases and connection pools Instead we get a logging suggestion that while interesting (I too prefer ElasticSearch to CloudWatch logs) is definitely not Lambda best practice. And suggestion ab…

I like in https://serverless.com/ 's serverless.yml how it provisions the CloudFormation stuff and gives you a way to manage IAM permissions.

AWS has its own Serverless Application Model (SAM) https://github.com/awslabs/serverless-application-model released last Oct. Rather than learning another framework, you'd use the same CloudFormation yaml syntax to define your stack and apps. It simplifies calling Lambda functions by providing a higher level abstraction triggers called Events. This makes it simpler to create Lambda functions for Rest API, Cron schedule, IoT devices, create Alexa skills, response to S3 events etc. Then its just "aws cloudformation package" and "aws cloudformation deploy" to create and update your app. It appears AWS team is learning the best from Serverless Framework. If you not mind the vendor lockin, SAM is the way to go. Serverless Framework has the promise of using the same tool against AWS Lambda, Google/Azure Functions and IBM OpenWhisk.

Re: AWS Lambda – Best practices

#15
post #8

Earlier quoted context omitted.

I've been using Lambda since the beginning (was an early private beta user). I am actually considering writing a book or perhaps some courseware. I don't blog. Unfortunately, if I do I cannot post it here as it would defeat the purpose of using a throw-away account :(

Off-topic question: Why do people use throwaway accounts here on HN? Why is it so important that nobody knows who the real person behind posts is?

Can't speak for parent. For me, I don't care if people know the real person behind the post. But I don't want someone to be able to see a list of everything I have ever said. And unfortunately there is no way to do one without the other.

Just like everyday conversation. I can speak without anonymity. But I would hate for someone to go look at some of the things I said 20 years ago.

Re: AWS Lambda – Best practices

#16
post #8

Earlier quoted context omitted.

I've been using Lambda since the beginning (was an early private beta user). I am actually considering writing a book or perhaps some courseware. I don't blog. Unfortunately, if I do I cannot post it here as it would defeat the purpose of using a throw-away account :(

Off-topic question: Why do people use throwaway accounts here on HN? Why is it so important that nobody knows who the real person behind posts is?

Can't speak for parent. For me, I don't care if people know the real person behind the post. But that I don't want someone to be able to see a list of everything I have ever said. And unfortunately there is no way to do one without the other.

Re: AWS Lambda – Best practices

#17

Unfortunately, there's absolutely nothing here regarding things like git, or CI/CD, or how-to-use-it-when-a-medium-to-large-team-is-involved If anyone has any research, thoughts, or comments on this side of Lambda, I'd love to learn more

Hey Daniel,

We've been experimenting with a lot of best practices around serverless development with StdLib [1]. Everything from versioning, project and team management, to authentication and billing. Basically --- we acknowledged that a lot of these aspects were surprisingly difficult and created a "git-esque" workflow for serverless function management ("lib up" to deploy, "lib get" to retrieve a current version of a function, etc.) - would love your feedback if you have time.

(Disclaimer: Founder.)

[1] https://stdlib.com/

Re: AWS Lambda – Best practices

#18

As someone who uses Lambda heavily I find this post somewhat disappointing from a "best practices" standpoint. No mention of Lambda best practices like: - Using CloudFormation - IAM policies - Managing config - How to handle databases and connection pools Instead we get a logging suggestion that while interesting (I too prefer ElasticSearch to CloudWatch logs) is definitely not Lambda best practice. And suggestion ab…

How do you use database connection pools with lambda? I thought it wasn't possible.

Re: AWS Lambda – Best practices

#19

As someone who uses Lambda heavily I find this post somewhat disappointing from a "best practices" standpoint. No mention of Lambda best practices like: - Using CloudFormation - IAM policies - Managing config - How to handle databases and connection pools Instead we get a logging suggestion that while interesting (I too prefer ElasticSearch to CloudWatch logs) is definitely not Lambda best practice. And suggestion ab…

How do you use database connection pools with lambda? I thought it wasn't possible.

AWS will sometimes reuse the container in which your Lambda runs, so if you set up e.g., database pools during load time, they're often still there the next time.

Related: https://aws.amazon.com/blogs/compute/container-reuse-in-lamb...

Re: AWS Lambda – Best practices

#20
post #11

The biggest thing I have found about lambda is that if you plan to deploy with cloudformation backed by s3 you either need to do some hacks to ever update your function, manage versions in s3 or change the filename in s3 and cloudformation to trigger an update. It's a rather annoying issue. I really wish that there was an always update flag on the cloudformation property to resolve this.

Have you tried adding a timestamp or git sha to your CF input params?
Post reply on HN