I've been hearing a ton about"serverless" software recently and am evaluating AWS Lambda for an upcoming project. I'd be curious to know how the Hacker News community has actually been leveraging serverless architecture in production?<p>Which use cases have worked well for people? Which have not?
AWS Lambda is really cool, but there are a few quirks to keep in mind that make it not a general replacement for something like a box running nginx + uWSGI, etc.<p>There was a nice 45-minute talk given at PyOhio this year by Matt Land that covers most of the tradeoffs around running Lambda in prod.<p><i>AWS Lambda: From Curiosity to Production</i><p>Abstract - <a href="http://pyohio.org/schedule/presentation/246/" rel="nofollow">http://pyohio.org/schedule/presentation/246/</a><p>Video - <a href="https://www.youtube.com/watch?v=ZoMhFsH9k8Q" rel="nofollow">https://www.youtube.com/watch?v=ZoMhFsH9k8Q</a>
Yes. I have a high volume ecommerce site that sells Raspberry Pis in Australia[1] which is static and built using middleman[2]. The files sit on S3 + Cloudfront and are deployed using S3_website[3].<p>The contact page is powered by AWS Lambda.<p>Some old school jQuery keeps track of the commerce cart and forms "Cart Links"[4], that send the user to the checkout of a Shopify Store.<p>[1] <a href="http://raspberry.piaustralia.com.au" rel="nofollow">http://raspberry.piaustralia.com.au</a><p>[2] <a href="https://middlemanapp.com/" rel="nofollow">https://middlemanapp.com/</a><p>[3] <a href="https://github.com/laurilehmijoki/s3_website" rel="nofollow">https://github.com/laurilehmijoki/s3_website</a><p>[4] <a href="https://help.shopify.com/themes/customization/cart/use-permalinks-to-preload-cart" rel="nofollow">https://help.shopify.com/themes/customization/cart/use-perma...</a>
I'm a big fan of Google App Engine; it has support for many languages now and powers some huge apps like Pokemon Go.<p><a href="https://www.g2crowd.com/blog/platform-as-a-service-paas/platform-as-a-service-pokemon-go/" rel="nofollow">https://www.g2crowd.com/blog/platform-as-a-service-paas/plat...</a>
We use it for various small tightly contained tasks in response to events (Kinesis events, S3 writes, etc), similar to how you might use Celery tasks to do something where either don't care about the result or the result might take to long to compute for you wait.<p>As a completely made up arbitrary example say you send two types of emails to your users, a newsletter and personal notifications. You send the notifications yourself but have a third party service for the newsletter. When a user opts out of all emails you can make the required changes on your end but calling out to the other service might take longer than you are are willing to make a user wait.<p>So instead you write something to S3 or Kinesis or some other stream that Lambda can access that takes the user ID and informs your email provider to no longer send emails to this address.
I've spent the past two weeks working on architecture proposal around this. At a very high level my conclusions were basically:<p>API Gateway could be very useful but is extremely overpriced.
Lambda is a bit more reasonable but not worth the trouble for me.<p>Both of those services have easy alternatives such as Auto Scale rules, EC2, and ELB.<p>Kinesis is really nice. And for our use case, isn't very expensive. If people used it for things like a distributed task queue I could see how things could get out of hand. We will use it for more of an ingress data buffer.<p>I'm also using the KCL which uses dynamodb to handle some distributed state issues. A bit like ZooKeeper. This will allow you to handle some coordination between your consumers and meet the demands of your delivery requirements.