eli
eli

🙌  Liked: The Power of Serverless

|
Embed
hjertnes
hjertnes

@eli What do you think about serverless?

|
Embed
eli
eli

@hjertnes eh, comme ci comme ça. I am underwhelmed for the most part. I think serverless makes sense when working at scale (either of service or workforce), or in a scenario where you’ve got time to get the architecture right. It makes some things heaps easier, and others more confusing. That all being said, it is probably the way-of-the-future, so I’m working on understanding it inside and out. What do you think?

|
Embed
hjertnes
hjertnes

@eli I'm not sure yet. To route urls to a lambda or what ever instead of running a full server kind of makes sense. But where does databases and redis fit in server less? And how far are development environments from production?

|
Embed
jack
jack

@hjertnes @eli We're in the process of evaluating Lambda/RDS/etc. for use here. I agree that for some cases (transcoding videos, images, etc) that Lambda seems like a terrific use case. I wouldn't want everything serverless though. Way too many moving parts for me (and no matte what Amazon claims, they are moving parts :) )

|
Embed
hjertnes
hjertnes

@jack I smell many: "it works on machine" conversations

|
Embed
eli
eli

@jack @hjertnes I totally agree. I've used a bunch of the different offerings in AWS on various projects — the biggest hiccup I see to serverless is during development. It becomes wicked complicated to develop locally when working with a serverless system, so a staging/dev. environment needs to be set up, which is fine, but I think developing locally affords folks a certain amount of flexibility/room to experiment with architecture that is sometimes nice to have. I guess AWS’ answer to this is cloud9, but…🤷‍♂️ ☁️

|
Embed
eli
eli

@hjertnes @jack more on the same topic.

|
Embed
oyam
oyam

@eli that’s true to some degree, but any networked API does that. Whether you use http, rpc, or whatever else, you’re already adding network.

|
Embed
hjertnes
hjertnes

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

|
Embed
eli
eli

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

|
Embed
oyam
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.

|
Embed
hjertnes
hjertnes

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

|
Embed
oyam
oyam

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

|
Embed
hjertnes
hjertnes

@oyam Plain Postgres or some weird ass configuration?

|
Embed
In reply to
eli
eli

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

|
Embed
hjertnes
hjertnes

@eli EC2 is really expensive...

|
Embed
eli
eli

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

|
Embed
hjertnes
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.

|
Embed
oyam
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.

|
Embed
oyam
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.

|
Embed
oyam
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.

|
Embed
hjertnes
hjertnes

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

|
Embed
oyam
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.

|
Embed
cleverdevil
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.

|
Embed
oyam
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.

|
Embed
cleverdevil
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.

|
Embed
oyam
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.

|
Embed
cleverdevil
cleverdevil

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

|
Embed