
Building Serverless Apps with Webtask.io - edtechdev
https://auth0.com/blog/2016/06/28/building-serverless-apps-with-webtask/
======
crisopolis
Thing I find odd with Auth0's Webtask.io is... -30 days webtask lifetime- for
the free to play plan.

I've had a webtask running since February when I made it to interview for
Auth0 (ironic). It's still running, firing off events and contactable via
HTTP. So when exactly does it get turned off since it's obviously past its
_lifetime_?

I still prefer not to trust a blackbox such as Webtask to run my code. Luckily
this webtask I'm referencing does nothing more than fire off push
notifications. However, I'm waiting for the code that relies on it to fail
when Auth0 does end its life.

------
sea6ear
I'm still trying to figure out the benefit that "serverless" architecture
offers over a simple Apache + PHP + Sqlite setup. PHP isn't my favorite
language, but it's deployment story seems as good as a lot of these
"serverless" solutions once set up (which takes 5-10 minutes on Ubuntu).

Unless you _need_ the scaling potential of the "serverless" platform, or are
completely unwilling to setup/maintain a simple $5 a month VPS, I don't see
much benefit to the platform lockin of a specialized service, when there is a
boring but predictable way to achieve the same thing, with the same (or
possibly less effort).

Once PHP is set up the process seems like it would be:

1\. write your page to accept the query parameters or post data and return the
results (the page is the function essentially).

2\. Use SQLite for storage (either per user or per "function" maybe?). Other
storage options are also fine, but SQLite is pretty simple and flexible.

3\. Deploy the .php file using scp or sftp to your /var/www/whatever
directory.

At this point you're done and can call your "function" via http.

~~~
niftich
The draw is another buzzword: "NoOps" \-- in that you spend no time managing
the actual environment.

Instead, there is just code and nothing but the code.

~~~
sea6ear
Maybe I'm stuck in the "sunk costs" fallacy (that is, I've already invested
the time to learn how to do this, so it seems trivial to me), but to me once
I've done the 15 minutes "setup", I can basically ignore the server, and at
that point basically the code is the only thing to deal with.

I don't spend much time "maintaining" my server for this kind of setup. Once
it's setup I basically ignore it, accept for uploading new code.

I suppose I do _occassionally_ run the system update command. I don't run any
other kinds of PHP applications (WordPress, Drupal, etc) on an environment
that I use this way, so I don't feel the constant need to check for security
vulnerabilities.

~~~
niftich
You can basically ignore that server, until your basically ignored server goes
down or breaks for some silly reason unknown to you in advance.

At that point, you have to intervene, troubleshoot, and fix the problem.

But if you had gone the Functions-as-a-Service route, you'd avoid such
occurrences altogether. For some people, that's an appealing trade-off.

~~~
sea6ear
Ok, that's a fair point.

I feel like I have the skills to handle that, or to create redundancy if
necessary for reliability, so that doesn't bother me, but I can see the appeal
of ignoring all of that.

I still like the idea that I'm not trusting a "black box" to run my code. I
know how it's set up and what it's doing. And if I add replication or load
balancing, I also understand what's actually happening there. But you're
right, once you get to that level, you're out of the realm of "simple".

Maybe I can still hide behind my earlier comment "unless you _need_ the
scalability..." to say that covered your caveats, but I'll admit I wasn't
explicit about the considerations that guide the optimal use cases.

------
justinwi
Pro/con vs Lambda?

~~~
KukicAdnan
Ease of use is a big one. You can write your Webtask, run wt create and you'll
get an endpoint to access your function vs Lambda's fairly complex system -
especially if you just want to expose an endpoint to handle a particular use
case.

The authentication/authorization is another big one. Auth0 is a lot easier to
work with compared to Amazon IAM and Cognito.

Lambda does have it's strengths in the AWS ecosystem though and also supports
multiple languages while Webtasks are mainly written in Node (and C# if you
use a wrapper).

Disclaimer: I work at Auth0 as a Tech Writer and wrote the above article.

