Post a response on your own site? Send me a webmention!


hjertnes

💬

@eli So, let me get this straight. It isn't possible to test serverless functions locally?

eli

💬

@hjertnes not at all, what I was saying (but very badly...sorry!) is that you can't run the entire system locally.

oyam

💬

@eli I design my lambda functions to be very minimal, as in extract the input parameters and call the actual function. It makes testing considerably easier. Sam also helps.

hjertnes

💬

@eli Okay. And what kind of databases would be accessible on let's say Amazon Lambda?

oyam

💬

@hjertnes you can get all the common stuff... Postgres, MySQL, nosql (amazon’s own), redis/mamcached. They also provide their own graph database.

hjertnes

💬

@oyam Plain Postgres or some weird ass configuration?

eli

💬

@hjertnes you can also always install your own DB on an EC2 instance. That is how I run redis on AWS.

hjertnes

💬

@eli EC2 is really expensive...

eli

💬

@hjertnes enter the fun second problem with serverless: cost, and figuring out how to calculate that

hjertnes

💬

@eli Okay. This is one of the things that have been driving me nuts for close to 10 years. They say "Amazon is soooo cheap" even though the cheapest EC2 is 3x the price of the cheapest Linode.

oyam

💬

@hjertnes it’s monkey Postgres but works quite well. Used it in the past and we migrated to it from fairly customized Postgres install and all went well.

oyam

💬

@hjertnes I think when people refer to “amazon” being cheap it’s in regards of S3 most of the time. EC2 is hella expensive, but you can do lots with CloudFront, lambda, S3 , API gateway, etc and fit in the free model and/or pay close to nothing. At least if those tools fit your bill.

hjertnes

💬

@oyam Would you write an entire backend on AWS Serverless?

oyam

💬

@hjertnes github.com/awslabs/a... is a great help. With that+docker you can run some functions locally, depending on the resources you need.

oyam

💬

@hjertnes I have not, and I’m not sure if I would for production purposes. I’m playing with the idea though, implementing Micropub endpoint serverless as an experiment. I’m not sold on serverless, just toying with tools and ideas.

cleverdevil

💬

@oyam realistically, AWS can be much cheaper than other platforms, but you have to fully embrace their pricing model, and leverage RIs, spot instances, auto-scaling, etc. For VPS use cases, RIs are particular good.

oyam

💬

@cleverdevil Even with RIs you’re looking at $25/mo for medium instance (counting the full 75% discount), plus transfer out. With DO, I can get that at $20 including 4tb transfer at on-demand pricing, no commitment. Similar on linode. Even GCP will be cheaper at that config. Unless you’re pushing out upward of 10tb data/month, I don’t see how EC2 can beat any of the other offering out there.

cleverdevil

💬

@oyam if you compare exclusively on static workloads, I think you're right. But, Linode and DO don't have things like auto-scaling, spot instances, instance scheduling, etc.

oyam

💬

@cleverdevil That’s true, however, I think spot instances are, to a degree, solved by the lower pricing. Neither have auto scaling, but that’s not that complicated to solve as is instance scheduling. Their APIs are good enough to deal with if if you’re willing to put a little more work in. My initial comment was mostly about static loads - lot of people use EC2 to run databases or web servers, which can be done much cheaper elsewhere.

cleverdevil

💬

@oyam yup, I think we are in total agreement!

Content: CC BY-SA 4.0