News for hackers. Stuff that matters.
Re:Guide to Serverless Architecture by Vinnl on Thursday December 21, 2017 @05:24AM (#15977743)
Drawbacks I experience:

- Vendor lock-in: although I try to minimise this and have a clear picture of where the lock-in lies, it is very much present.

- Cold/warm start: this is somewhat annoying. I haven't set up keepalive requests yet, but they feel like an ugly hack, so I'm not sure if I'm going to or if I will just suck it up.

- Security/monitoring: having fewer functions make this less of a worry, but it's still difficult and it's clear that there's not much of an ecosystem and best practices.

- Debugging: this can be really annoying. I can usually avoid this by having a proper local testing setup (see below), but when that doesn't cut it, this gets annoying.

Drawbacks I haven't really experienced:

- Statelessness: this is probably due to not splitting up my code in too many functions, and thus not having that much complex interactions, but this hasn't really been a problem for me.

- Execution limits: haven't run into them yet.

Drawbacks I've managed to contain:

- Local testing: I'm writing Node Lambda's. Since they're just stateless functions, it was relatively easy for me to write a really simple Express server, transform the Express requests into the API Gateway format, and convert the API Gateway response format back into Express format. This works fine for local testing, and reduces the effects of vendor lock-in. That said, I do do a lot of the request parsing in the Lambda function itself, rather than letting API Gateway do this.

- Deployment: this is actually pretty sweet. I'm using TerraForm which, although it's a bit immature and thus cumbersome to set up, has been getting the job done and allows me to easily deploy new copies of the infrastructure for every branch of my code.

- Remote testing: as mentioned above, deploying it for every branch I have allows me to see what it's going to look like in production.

Hmm, perhaps I should turn this into an article sometime...

Re:Guide to Serverless Architecture by dschep on Thursday December 21, 2017 @09:08AM (#15978809)
> - Vendor lock-in: although I try to minimise this and have a clear picture of where the lock-in lies, it is very much present.

The post isn't loading so I don't know exactly what it's in reference to (AWS lambda, the framework, the more generic idea?). But, the serverless framework[0] supports all major cloud providers (AWS, Google, & Azure) as well as self-hostable options like OpenWhisk and Kubeless.

[0] https://github.com/serverless/serverless

Re:Guide to Serverless Architecture by Vinnl on Thursday December 21, 2017 @09:55AM (#15979105)
Yes, but when I started putting this together it was very immature, as in: it crashed a lot. I didn't really want to lock myself in to an immature product either, and I also didn't really like having to run specific commands to get to a certain setup, rather than describing the layout of my desired infrastructure.
Re:Guide to Serverless Architecture by debaserab2 on Thursday December 21, 2017 @12:02PM (#15980528)
I may be naive (or just witless), but don’t you kind of end up with vendor lock-in to serverless itself?

The first step in their example is “login to your serverless account”.

Re:Guide to Serverless Architecture by dschep on Friday December 22, 2017 @11:11AM (#15988447)
You have to make a choice at some level of the stack, for me, that was serverless as the deployment framework. You could probably use terraform or ansible + some custom scripts, but then you could argue you're locked into terraform or ansible ;)

The login thing isn't actually necessary (or if it is, that's new)

Re:Guide to Serverless Architecture by dvlsg on Thursday December 21, 2017 @12:48PM (#15980988)
My most recent serverless configuration file was probably approximately 90 percent aws specific (cloudformation) syntax anyways.
Re:Guide to Serverless Architecture by icebraining on Thursday December 21, 2017 @02:08PM (#15981817)
Maybe the image is outdated? The Quick Start doesn't seem to talk about Serverless accounts.
Re:Guide to Serverless Architecture by abd12 on Thursday December 21, 2017 @08:35AM (#15978605)
* Disclosure: I work for Serverless, Inc.

> it was relatively easy for me to write a really simple Express server, transform the Express requests into the API Gateway format, and convert the API Gateway response format back into Express format.

For those interested in this route, there's a plugin[0] for the Serverless Framework that handles this conversion for you. Honestly takes 1 minute to convert an existing Express app to serverless.

Shameless plug but I wrote a blog post walkthrough for anyone interested --> https://serverless.com/blog/serverless-express-rest-api/

[0] - https://github.com/dougmoscrop/serverless-http

Re:Guide to Serverless Architecture by Vinnl on Thursday December 21, 2017 @09:59AM (#15979130)
If you want to use Serverless (the package, not the architecture) and are converting an existing Express app, that might indeed be a good idea. I was greenfielding, and neither of these conditions were true for me.
Re:Guide to Serverless Architecture by Blackstone4 on Thursday December 21, 2017 @09:57AM (#15979116)
If you need to make a disclosure, please could you do it at the start of your statement. That way the user has context on what you write :)
Re:Guide to Serverless Architecture by abd12 on Thursday December 21, 2017 @10:06AM (#15979202)
Noted and updated! Thanks for the tip.
Re:Guide to Serverless Architecture by alien_at_work on Thursday December 21, 2017 @08:16AM (#15978523)
>- Vendor lock-in: although I try to minimise this and have a clear picture of where the lock-in lies, it is very much present.

I feel like this is the most overstated draw back in cloud computing by far. I don't know how most people write their code but me and most people I've ever worked with have a natural tendency to seperate out abstractions to protect you from "likely to change" parts of your application. In fact, if you use Spring boot in Java it already abstracts away a lot of the differences for various cloud scenarios.

Further, in the worst case you have to rewrite some stuff. Before you skip a solution for fear of vendor-lock-in you should attempt a cost analysis: how much will you save on these platform-specific advantages and how does that offset your cost of rewriting when some other solution becomes more desiable? How long will it take to reach break even and how does that time compare to how often software is just rewritten or abandoned in your organization anyway?

Re:Guide to Serverless Architecture by Vinnl on Thursday December 21, 2017 @09:58AM (#15979119)
I mostly share your view, and hoped not to overstate it: it's clearly a drawback, but in all, not enough to turn me away from it. By being aware of this drawback and keeping an eye on where the lock-in is, it would not be _that_ much work to rewrite the pain points to work with another provider. That said, it's still a good idea to be aware of the drawback.

Unfortunately I can't edit my post anymore, but I should've noted that I'm overall happy with my serverless setup.

Re:Guide to Serverless Architecture by sudhirj on Thursday December 21, 2017 @09:30AM (#15978937)
> - Vendor lock-in Try something like https://github.com/apex/up - write the code as regular servers, and it'll convert your entire server into a function.

> - Cold/warm start Should be a temporary annoyance - I'm sure all the providers are already hard at work on fixing this.

> - Security/monitoring Easier to do than regular servers - most FaaS systems have monitoring built in, and collect whatever you write to STDOUT.

> - Debugging: Yeah, can't do much about that.

> - Local testing Besides Up mentioned above, should see more and more shims like https://github.com/RealImage/concave/blob/master/server.js coming up.

> - Deployment Still a mess, but give it time. Heroku like experiences for FaaS should be a matter of time.

Re:Guide to Serverless Architecture by Vinnl on Thursday December 21, 2017 @10:04AM (#15979179)
I didn't really feel like the benefits of packages like Serverless and Apex were worth it for me, as they're not solving that big of a problem, and you'd replace it with lock-in to even less mature products. That said, the current lock-in is not that bad, just good to be aware of and keep an eye on.

I hope that the annoyances are temporary indeed, but that doesn't buy me anything today :) That said, I think for almost all my drawbacks it holds true that they're likely to grow less and less significant, so if serverless is not worth it for you today, it's still worth it to keep an eye on.

Edit: I should perhaps also link the shim that I'm using. It's slightly longer, also specific to my relatively loose configuration of API Gateway, and also simulates S3's client-side file upload functionality. As you can see, it's really not that bad: https://gitlab.com/Flockademic/Flockademic/blob/dev/app.ts

Re:Guide to Serverless Architecture by sudhirj on Thursday December 21, 2017 @11:44AM (#15980331)
Up != Apex, same developer, though. Apex embraces serverless as an architecture, Up runs regular servers as functions.
Re:Guide to Serverless Architecture by Vinnl on Thursday December 21, 2017 @01:04PM (#15981179)
Oh, oops, didn't scan close enough. But in any case, I don't want to be writing "regular servers", I want to write FaaS functions. Ideally (and hopefully this is where we will end up), against the same interface regardless of provider, but not necessarily e.g. Express's interface.

Thanks for sharing though, it's surely useful to some.

Re:Guide to Serverless Architecture by nickjj on Thursday December 21, 2017 @08:57AM (#15978732)
Funny thing is, I just wrote about this the other day[0] and I shared some of your drawbacks too.

Personally I'm staying away from Serverless for now.

[0]: https://nickjanetakis.com/blog/should-your-next-project-be-b...

Re:Guide to Serverless Architecture by Vinnl on Thursday December 21, 2017 @10:01AM (#15979143)
It's too bad I can't edit my post anymore, as I should've added that overall, the drawbacks are not enough to draw me away from the advantages. I also should've noted that I'm not using Serverless (the software).
Re:Guide to Serverless Architecture by friendly_chap on Thursday December 21, 2017 @09:51AM (#15979067)
The vendor lock in and local testing is easily solved by https://github.com/1backend/1backend

No execution limits, since you can deploy and fine tune it to your environment. Can be stateless or stateful depending on configuration.

Re:Guide to Serverless Architecture by Agebor on Thursday December 21, 2017 @05:44AM (#15977818)
I think most of those drawbacks will go away in the next years after we have:

- a standard function packaging and manifest that each vendor will support

- cheaper + easier tracing, logging, graphs