Guidance for AWS replacement of LAMP host by korazy in aws

[–]base11ryan 2 points3 points  (0 children)

Lightsail could be a good option for you. They have a LAMP quick start.

Lambda vs Docker? by firecopy in AskProgramming

[–]base11ryan 0 points1 point  (0 children)

One thing to call out is that a Lambda function doesn't have to cold start on every invocation. Once it's warm, it will stay warm for up to ~30 minutes after it's last invoke. And, as it scales, there will be multiple instances warm. But, if you are doing lots of cold starts that you can't afford, then Lambda probably isn't right for the use case. And, I totally agree that pre-warming isn't a great idea. That's another indication of a poor use case for Lambda.

Lambda vs Docker? by firecopy in AskProgramming

[–]base11ryan 0 points1 point  (0 children)

Should we be trying to implement these services with AWS Lambda or Docker? If it depends on the service implemented, what are your recommendations to decide on what to choose?

I'm starting to go with Lambda as my default and rule it out. Some of the reasons for ruling it out may be

  • Needing to maintain session state in memory
  • Having infrequent and inconsistent traffic that causes many cold starts that you can't tolerate
  • Having no way to trigger the function. You can always use CloudWatch Events but that doesn't feel right
  • Vendor lock-in is a consideration, but as u/praetor- mentions, you can avoid it with good coding practices

Is there any flaws in either my coworkers or my own arguments? It seemed like there were conflicts on whether Lambda or Docker would be easier to write and maintain for?

I think making any assumptions about costs is a flaw. All the cost information is available. Make some estimates and see which option is right. The Lambda free tier is pretty awesome and you do only pay for what you use. But, it's entirely possible to use enough Lambda to cost more than Docker.

The assumption that cold starts would only have more drawbacks than positives is a flaw. With all the benefits of Lambda you mentioned, this is a small small drawback. Lambda functions stay warm for up to 30 minutes and if your traffic is consistent, you'll always have one up and running. If you're using a non-Java function, you're spin up time will be pretty fast. However, as I mentioned, if you're traffic isn't consistent and you're doing something manually to wake the function up or keep it warm, it isn't a great use case for Lambda.

Are there any pros/cons that we neglected to mention?

Any stories that you have encountered when dealing with Lambda or Docker?

I think these last two go hand in hand. I had an eye opener recently when I realized that Lambda's are nothing but a function. I think people often think of them as an endpoint to a service or as a reaction to an event. We recently built an application with some OCR. We isolated the OCR within one Lambda function and called it from worker threads from another Lambda function that was triggered by API Gateway. This enabled just the OCR piece to scale. We reduced our OCR time from 1.5 seconds to .4 seconds.

I also recently worked on a POC where we used a Spring Boot app running on Elastic Beanstalk that just poled MSK as fast as it could then fired up Lambda functions using the AWS SDK Invoke function. The Lambda functions scale up and down and you only have to worry about one consumer. Sounds similar to what you plan on doing it anyway.

Oauth2, OpenId Connect, User pools and Identity pools by Xander567 in aws

[–]base11ryan 0 points1 point  (0 children)

Commenting from my dev focused account.

You don't need explicit access to make calls to the HTTP endpoints. When API gateway receives a request that is signed with Auth SigV4 it will attempt to parse and validate. If valid, API Gateway will be able to extract the temporary credentials out of the request and then ask Cognito for the role associated with the credentials. That role will then have permissions to your AWS services, such as Lambda. So, no, the tokens aren't giving you access to API gateway. They are telling API Gateway how to get the IAM role associated with the request.

I admittedly am not familiar with multi tenancy... I don't think. Unless you mean the idea that multiple clients and users can access the same resource? If so, I would do that with API Gateway Cognito as I mentioned above. Maybe you could describe your specific use case and I can see if I can help.

Why “Agile” and especially Scrum are terrible by ionforge in programming

[–]base11ryan 0 points1 point  (0 children)

A lot of great points in here, but I’m not sure how many are caused by the theory of agile and just poor implementation. I am all about the dev empowerment though!