
Build a Serverless Web Applicaion - munns
https://aws.amazon.com/serverless/build-a-web-app/
======
Sephr
Is anyone else slightly peeved by the popularity of this misnomer?

If you are _paying for servers_ , your app isn't _serverless_. Real serverless
to me means decentralized p2p and offline apps. I also consider p2p-routed
apps with centralized control serverless as long as they continue to function
in a read-only state when the control server is down.

~~~
Herald_MJ
No, I'm not peeved by the "misnomer". What is getting a bit annoying is every
conversation about serverless being dominated by snarky comments about there
being no such thing. As software professionals, we all know there is a server
involved in responding to requests for our applications. But 'serverless' does
accurately describe services like AWS Lambda, because the experience of
development is such that you don't really have to think about servers, along
with all the complexity of provisioning, configuring and managing them.

TL;DR: It's just a name. Get over it.

~~~
voidr
> But 'serverless' does accurately describe services like AWS Lambda,

Serverless means no server, which is false, because there is a server that
runs your code.

> because the experience of development is such that you don't really have to
> think about servers, along with all the complexity of provisioning,
> configuring and managing them.

That sounds like you are talking about 'web hosting' or 'application hosting',
which existed decades ago, don't see any point in inventing a confusing
buzzword when we have perfectly fine terminologies already.

> TL;DR: It's just a name. Get over it.

It's a useless and confusing marketing buzzword that makes having intelligent
conversations harder. I would love to understand your rationale for defending
this confusing buzzword.

~~~
Herald_MJ
> It's a useless and confusing marketing buzzword

A marketing buzzword is something like "web scale", which might be used by a
non-technical person to describe a technology, but has no real technical
meaning. Serverless is not a buzzword because it is the name used for a
collection of technologies, even if it isn't a specific product. "Software
containers" also falls into this category.

Yes, serverless architectures involve servers. Well done for recognising this,
you are very smart. In fact, you are smart enough to realise that the
architectures we are talking about here are very distinct from traditional web
hosting services. So, it's convenient to use a different name for them.

Finally, it doesn't really matter whether you like the term or not. It is the
accepted term and it is here to stay. If you want to engage in conversations
on the topic you will need to move past your misgivings.

~~~
voidr
> A marketing buzzword is something like "web scale", which might be used by a
> non-technical person to describe a technology, but has no real technical
> meaning. Serverless is not a buzzword because it is the name used for a
> collection of technologies, even if it isn't a specific product.

What collection of technologies does it name? And how is that different from
"web scale" technologies that is also a group of technologies?

> Yes, serverless architectures involve servers. Well done for recognising
> this, you are very smart.

If you would have strong arguments, you wouldn't need snarkiness.

> In fact, you are smart enough to realise that the architectures we are
> talking about here are very distinct from traditional web hosting services.

That's the exact opposite of what I've said, if you look at it from a server
management point of view, traditional web hosting and "serverless" are one and
the same, both are used to run the code you upload and both are managed by
someone else.

> So, it's convenient to use a different name for them.

It's not convenient, it's confusing.

> Finally, it doesn't really matter whether you like the term or not. It is
> the accepted term and it is here to stay.

Accepted by who?

> If you want to engage in conversations on the topic you will need to move
> past your misgivings.

If you want to engage in conversations on any topic with anyone, you should
read what's on this website
[https://yourlogicalfallacyis.com/](https://yourlogicalfallacyis.com/) and
stop doing them.

------
xahrepap
I am a believer in "Serverless" and that it will play a primary role in a
large portion of developers' lives... _in the future_

My experience with servless is that while this may be true at a certain level:

> No server management

I feel like in Amazon's current toolset, you are MORE aware of "servers" than
you ever have been before. It's just abstracted into a different layer
(cloudformations, etc). The boilerplate for severless projects it's a complete
mess, imo.

Besides that, the Develop/Test/Deploy/Manage lifecycle is really difficult to
reason about. I would hate to be the one on call when a serverless service
goes down and I have to figure out what's going on!

I look forward to Amazon releasing more tools (or cleaning up the ones they
have) to make Serverless a breeze to work in.

[EDIT] clarification of a couple minor things

~~~
keithwhor
That future is being created, you're probably just less aware of it than you
think.

Serverlessconf just announced their NYC conference, expected to be the largest
yet. If Austin is any indicator, it will be huge. [1] Tim Wagner at AWS likes
to spout the stat that billions of financial trades are already being
processed per day on AWS Lambda. The "serverless" market is gigantic and
growing rapidly.

And then there's companies like StdLib [2], where we've built an abstraction
layer on top of serverless architecture that turns remote procedure calls (and
APIs) into first-class citizens of your development environment with a single
package and allows you to ship applications without ever worrying about
infrastructure. We just closed a $2M seed [3] and are announcing some
transformative partnerships shortly. We're tackling some of the exact issues
you have problems with, and we're not the only ones.

The future is already here. It's just not evenly distributed. ;)

Disclaimer: I am the founder of StdLib. :)

[1] [https://nyc.serverlessconf.io/](https://nyc.serverlessconf.io/)

[2] [https://github.com/stdlib/lib/](https://github.com/stdlib/lib/)

[3] [https://techcrunch.com/2017/06/27/stdlib-just-
raised-2-milli...](https://techcrunch.com/2017/06/27/stdlib-just-
raised-2-million-to-connect-businesses-via-apis/)

~~~
xahrepap
Oh, I know it exists, and I know tons of people are using it.

But like I said, I don't think that the tooling is there right now for mass
migration (or anything like it). It's really difficult to test/debug. It's
difficult to dianose issues. It's difficult to even set up a "Hello World" API
Gateway that uses lambdas. It's painful... as are all new technoligies.

I guess what I mean to say is: I look forward when I just jump on AWS and
start using it for a production app, and the boilerplate and amount of config
files I have to maintain drops.

I'm also aware of the tool called "serverless" (
[https://serverless.com/](https://serverless.com/) ) which is also a step in
the right direction.

~~~
adjohn
Not trying to be spammy here, but I want there to be awareness that there are
startups working on tools to address these gaps. Our startup, IOpipe[1] is
working on one set of tools to ease development, debugging, and
instrumentation for serverless applications. Aside from Stdlib and ourselves,
there are others working in areas like security and CI/CD as well. These are
early days, and tools will soon become abundant, but at least there are a
handful to try out today.

[1] - [https://iopipe.com](https://iopipe.com)

------
kirillzubovsky
In principle I really like this way of developing, and especially prototyping,
but as it stands right now Google is doing a significantly better job with
their tools than Amazon.

Amazon got the same guts, but their presentation of these tools is horrendous.
It's aimed at the highly skilled developers who would get the concepts in a
blink, with the only problem that these are the same people who can spin out
servers with more pleasure and probably in the same amount of time.

Google meanwhile, with their purchase of Firebase, makes some really appealing
tools that are not just easy to use, but also easy to understand. Besides,
their dev outreach is quite stunning, and so is the email support.

Would love to see Amazon compete, but they have a long road ahead.</2c>

~~~
ranman
> It's aimed at the highly skilled developers who would get the concepts in a
> blink,

Do you have any advice on how we could make this stuff more accessible to new
developers?

When you say the presentation do you mean the overall marketing, the UX, or
just the CSS?

~~~
kirillzubovsky
All of the above. AWS is the Google Cloud right now, but it's missing the
"Firebase" equivalent.

I know a ton of people who have no problem spinning out an EC2 instance to
scrape the web for all their needs in a heart beat, and yet I don't know many
who just want to make software for people, without all the complexity of
setting things up.

Look at Firebase, they have "Authentication", "Database", "Storage", and
"Functions". If I want to Auth users into my app, it's quite literally a one
line of code. Meanwhile Amazon has "Cognito," which requires setting up
identities, rules, connecting it to other AWS services ... _head explodes._

That's a small example, but AWS is built for some serious enterprise business,
and if you want to make something like Firebase, you need to repackage it all,
and dumb it down to a simple use case. Run whatever 265 services are necessary
in the background, but give the user 1 thing to worry about.

I fully understand that would be really hard to do, but that's the point.
Gotta do the hard thing for the user, and they will come.

As far as UX/css/visual, it's all of it. Like another commenter mentioned, in
order to make things pleasant you gotta move away from the AWS style guide and
towards something unique and friendly. Right now the entire AWS website look
like it's been built in a spare time by a sys admin (because it probably has
been).

IMO it's okay to make "AWS Light" a stand-alone offering, like Heroku, but
that means you need to commit to maintaining such a service, and from what I
hear through the grapevine Amazon is quite happy to be the piping for the
internet, without having to run the consumer side of things.

~~~
ranman
Thanks for all the insight!

Have you seen lightsail or codestar?

------
isuckatcoding
Sorry what's new about this? Aren't all the pieces existing AWS services?
They've just put it in a nice graphic with the architecture drawn out.

Not saying I don't like the architecture (actually think it's quite useful for
many scenarios). Not sold on using DynamoDB (I'd rather use a traditional SQL
store).

~~~
gamesbrainiac
I really agree with you on this one, my acquaintances that have actually used
this, use it for running bulk jobs that are triggered by S3 changes.

~~~
jupiter90000
I wanted lambda for a bulk data processing task that would have been a nice
use of it, but the 5 minute max on a process wasn't going to work for my use
case. Maybe someday I'll find a use for it

~~~
isuckatcoding
Is the task not splittable?

I had to use lambda at work to import files from s3 ranging anywhere from a
few megs up to 10-20gb. Ended up using two lambdas (one for creating byte
ranges and another for processing those ranges).

------
jondubois
Amazon Lambda is like Microsoft Windows was in its early stages. It's a fast-
growing, closed/proprietary system for running apps.

I wouldn't be surprised if it achieves a near-monopoly for a while... But I
think that eventually more flexible open source solutions will take over. Open
platforms like Docker and Kubernetes will likely replace Lambda just as Linux
replaced Windows on the server-side.

~~~
techno_modus
> Open platforms like Docker and Kubernetes will likely replace Lambda

I am not sure if Docker/Kubernetes are comparable with Lambda. But currently
there are some attempts to develop an open source alternative to Lambda and
other proprietary FaaS (Function as a Service) platforms like OpenWhisk for
Cloud Foundry: [http://openwhisk.org/](http://openwhisk.org/)

~~~
jondubois
True, not directly. So it's not as clean a comparison as Windows vs Linux so I
meant it more in terms of the ability of one to replace/supersede the other.

------
gamesbrainiac
Is there any evidence other that actually backs the notion that you save money
on a serverless architecture? As far as I can tell, it feels like once you use
this kind of mechanism, you're tied to AWS for the foreseeable future.

~~~
ranman
I did this analysis in my (admittedly crappy and rushed) pycon web talk - in
some cases you can save a lot of money. In other cases you'll pay more. Skip
to the 20 minute mark. Also I work for AWS so general disclaimer that I'm
biased.

[https://m.youtube.com/watch?v=F8-y_d7l-2c](https://m.youtube.com/watch?v=F8-y_d7l-2c)

An interesting thing to note is that efficiencies in this space only increase.
Which theoretically lowers prices. You also get some pretty rapid and massive
parralellization when you need it. The pywren project has some insightful
examples and benchmarks of teraflops of compute and 10s gigabits/s of data
arriving as part of a single function call. It's a different paradigm that
will transform a lot of workloads but not all.

It's hard not to get swept up in the frenzy around it.

~~~
gamesbrainiac
Good talk! But how would you go about creating something like graphql on AWS
lambda? Are you aware of any tutorials?

------
sriram_iyengar
\- watchout for latencies (multi-zones apps) time of your lambda functions.

\- keep your lambda functions warmed up

\- node has better warmup time than java lambdas (not sure of python)

\- memory size impact of lambda functions (negligible in most cases)

\- manage lambda timeouts

\- dynamodb latencies are negligible

\- api gateway typically does not introduce latencies

\- multitenancy challenges with single store of dynamodb

~~~
kagx
> api gateway typically does not introduce latencies

I haven't checked my function thoroughly yet, but I think API gateway
introduce quite a bit of latency (at least in my case). My maximum invocation
time is 600ms, according to AWS Lambda monitoring tool, but network request
takes around 1s (checked in chrome dev tools).

Also, worht noting is that my code is hosted in the us-east region and I'm
based in Europe. I'm not sure how much latency this introduce.

~~~
watter
Probably about 100ms or more on each request (to and from). Slower depending
on location and network conditions.

~~~
sriram_iyengar
Yes very much possible if you are requesting across zones. I did extensive
testing within zone and couldn't notice anything more than 2-3ms.

------
williamle8300
Amazon wants to control markets by leading in with "convenience" factor but
they will sheist you.

Buy stuff from Amazon... but for Pete's sake don't make them a core project
dependency for your software projects. You only have yourself to blame when
they start ratcheting up their prices.

~~~
keithwhor
AWS is the system architecture of the web, full-stop. Well, a system
architecture, alongside Microsoft Azure and Google Cloud.

Avoid them at your own peril and detriment to your ability to execute as a
business.

With the exception of a few masochists, we don't write software in machine
code anymore. Same will be said for cloud infrastructure (actually, it's
already there). Breathe and accept the future, focus on building what's next
and / or adding value to your business.

~~~
kyledrake
Right now I spend $240-600/mo for 192TB of bandwidth. I just used AWS's
calculator and they charge $38,876.48/mo for the same thing.

I don't subscribe to the theory that this is "the future".

~~~
staofbur
Indeed. It's a big cost escalator. We have split architecture across two DCs
we own and AWS. AWS is a bad deal when you get to our size. If we moved our
DCs entirely into AWS we would literally triple costs overnight. On top of
that, once it's in AWS, a lot of the services that they provide aren't
portable. You're stuck and it's expensive to unstick these. The tooling isn't
very mature either. You'd be surprised how difficult it is moving 22TiB of
file storage to S3.

The future is bare metal IaaS with something non-provider specific that sits
on that as that is 100% portable between Cloud/in house. Docker/openstack that
sort of thing.

~~~
ranman
>You'd be surprised how difficult it is moving 22TiB of file storage to S3.

Really? I deal with this daily. Can you email randhunt@amazon.com - if you're
genuinely having or had issues moving 22TiB to S3 please LMK as that's
abnormal for our customers and I want to fix it for you and others.

~~~
staofbur
Thanks have passed your details on to our expert in this space.

For the public record this was mainly down to the problem of client
reliability and migrating data live when there are 8,000 people hammering it
with reads and writes. We went for a read/write through system and background
synchronisation. The latter we had real reliability problems with and the
upload performance wasn't great.

Also ROI didn't stack up in the end versus our SAN so we canned it.

~~~
ranman
Ok, if you guys pursue something like this again definitely check out
something like storage gateway. It can help reduce the load in a live
migration scenario like this.

------
justrossthings
Mostly stoked about serverless because I won't have to deal with grumpy
backend devs anymore

~~~
sumedh
Care to elaborate?

~~~
AbstractCache
Typical front end dev drivel.

------
nerflad
Isn't serverless just the present-day incarnation of timesharing?

~~~
collyw
There is very little "true innovation" in software these days, its usually a
rehash of something from years ago, plus some fancy marketing.

------
vizzah
Amazon has invalid 404 links to the tutorial sections on the main page.

"This workshop is broken up into five modules."

And most of those module links are broken too ;-)

Can only be viewed in a step-by-step mode.

~~~
ranman
Where are the 404s? I'll notify some folks to fix them. I'm not finding any
but I'm also on mobile.

~~~
parkersweb
Modules in the list at the bottom of this page:

[https://aws.amazon.com/getting-started/serverless-web-
app/](https://aws.amazon.com/getting-started/serverless-web-app/)

are broken - but the links to the modules at the top of the page work OK.

~~~
ranman
This should be fixed now (shift + refresh)! The links went out missing the
"modules" in the path. I think we're going to write a quick lambda function to
test for broken links in any post. Anyway, I want to apologize for the poor
user experience. We should have caught this!

------
jayair
It's great that AWS has a tutorial for serverless. Their docs can be a bit
hard to get through.

If somebody is looking for an even more comprehensive guide to building full-
stack apps with Serverless and React.js, I created [http://Serverless-
Stack.com](http://Serverless-Stack.com).

It's open source and up to date with detailed screenshots and code samples.

------
meow_mix
I'm a little confused as to what the point of cognito is. Wouldn't users
typically be managed by the application and data regarding the users typically
be stored in the db? Why do we need another service for this?

~~~
rockostrich
In a microservice architecture, there's usually a users/authorization service.
It makes it easier to have multiple services serve a single user pool. If you
only have one public service then there's probably no point in having a
separate service for users/authorization.

------
skyisblue
Has anyone used Zappa in production? What has your experience been like?

~~~
ranman
I have and I had no issues. Website had peak load of only a few hundred
requests per second and was Zappa running flask. Not sure if you consider that
production or not.

Disclaimer: I work for aws

------
talkingtab
Can I absolutely control my cost with AWS? I've read several horror stories
about runaway costs for various reasons. Certainly the complexity of AWS, the
fragmented nature of the service each of which seems a world unto itself make
it hard to understand. Then there was a story about AWS changing a policy that
ended up costing users $1000's. ????

~~~
noway421
AWS has pricing alerts so you can set limits to specific resources and it will
notify you when it tips over. Not that it cuts off the service, you'll still
be incurring charges, but at least you can know straight away that something
happened.

There's free tier as well if you want to just try out without commitment

------
buckbova
Has anyone used RDS from lambda? Don't want to use Dynamo but perhaps for some
key Val store.

~~~
jaxondu
Hopefully we will see AWS release a managed serverless SQL db solution at
re:Invent 2017. Like DynamoDB but for SQL.

~~~
davnicwil
> Like DynamoDB but for SQL

This would basically be the game-changer for building backends on lambda.

The absolute key and most valuable piece in most backends is the persistent
datastore. I absolutely want to build functional stateless business logic on
lambda, but I absolutely will not, no matter the gain from not having to
manage servers, have my database be dynamodb or any other non-RDBMS, for any
serious application in 2017.

~~~
ranman
Why not? Plenty of serious companies use DDB or MongoDb or plenty of other
databases for their "serious applications"... this seems like a rule based on
a bad experience. Would love to hear about it.

~~~
davnicwil
Why not? Well, a caveat: I will always use an RDBMS _when the data is
inherently relational_. In a "serious application" (I realise the term serious
is hyperbolic here and I shouldn't have used it) this is true most of the
time.

If it weren't true, then of course I might consider using DynamoDB or similar.
But I think these situations are few and far between.

I'm often wrong though and happy to learn about some counter examples if you
have any / have my assumptions corrected.

------
isatty

        > With serverless computing, your application still runs on servers,
    

...

