12 ms·
Build a Serverless Web Applicaion
- xahrepap 9y agoI 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 9y agoThat 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-million-to-connect-businesses-via-apis/ https://techcrunch.com/2017/06/27/stdlib-just-raised-2-milli...
- EGreg 9y agoWhy are posts like this being downvoted? Is t because it contains self promotional links? I think the post is informative and adds value. dang, I think there should be a feature to add an optional anonymous and private comment to the person when you downvote something, to let them know why (but with no arguments).
- keithwhor 9y agoAs developers we're allergic to marketing. Well, most of it. So when I make comments like this every once in a while I anticipate a bit of blowback. This is also a really competitive space with a lot of new players that check HN frequently - so keep that in mind. I can tell you it's pretty difficult as a founder to draw the line around self-promotion; on one hand, you don't want to be an ass, and on the other, you're genuinely excited and passionate about the future you're helping to create and have personally poured your blood and sweat into for thousands of hours. I hope that "real recognizes real" at some point in the communication chain and we're able to maintain that with our developers. I appreciate your post here, definitely.
- fpgaminer 9y agoI don't know about other readers here, but personally I would _encourage_ self promotion. This is a YCombinator site after all. As long as it remains on topic (which your comment most certainly was).
- xahrepap 9y agoOh, 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.
- l5870uoo9y 9y agoI think the ease at which a VPS is configured (and scaled) is underrated. I mean you can literally install your tech stack with a few commands that you can copy-paste into the terminal and upgrade it with a few clicks. Plus working with a command line just seems more "right" than clicking around in AWS backend.
- isuckatcoding 9y agoSorry 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 9y agoI 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 9y agoI 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 9y agoIs 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).
- williamle8300 9y agoAmazon 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 9y agoAWS 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.
- EGreg 9y agoThat's just silly. The internet was supposed to have no single point of failure. Now the Big Five have centralized everything. Why do you need to build centralized services on giant AWS server farms?
- keithwhor 9y agoUnfortunately life and economics have no concern about the initial intent of anything, only the current utility. Systems, at scale, especially when run by biological processes (read: all man-made systems), have a tendency to centralize. Economies of scale dictate that this is just more efficient. We don't have to do anything. The "evolutionary reward" (i.e. your business thrives and moves quickly) of building on AWS far exceeds SPOF issues for small, medium, and most large players. Yes, we get fun references when S3 goes down [1], but it's not as bad as literal water pipes taking down your webservers like what happened with Stats Canada [2]. The fact that Azure and Google Cloud exist maintains a competitive market. I liken it to Darwin vs Linux vs Windows. Optionality, but fundamental components of the cloud. [1] http://funender.com/wp-content/uploads/2017/03/amazon-aws-is-down.jpg http://funender.com/wp-content/uploads/2017/03/amazon-aws-is... [2] https://twitter.com/StatCan_eng/status/873285710094233603 https://twitter.com/StatCan_eng/status/873285710094233603
- buckbova 9y agoHas anyone used RDS from lambda? Don't want to use Dynamo but perhaps for some key Val store.
- cyberferret 9y agoNot RDS, but we've had good results with KeyVal stores using RethinkDB running on a Micro EC2 instance from Lambda...
- djhworld 9y agoYep, very easy with JDBC + APIs like JOOQ. The "interesting" part is how to secure user credentials to login to the RDS instance, and manage connection pools etc, but it's not that difficult
- jedberg 9y ago> The "interesting" part is how to secure user credentials to login to the RDS instance, and manage connection pools etc, but it's not that difficult You can run your RDS instances and your Lambda's in the same private VPC. It doesn't secure your credentials per se, but it does prevent anyone else from accessing your database with Lambda.
- defen 9y agoThe "problem" with putting Lambdas into a private VPC is that then you need to do NAT, which means permanent infrastructure (NAT gateways, failover, scaling...). It can be done but there are more headaches than with a pure serverless solution. Unless things have changed since the last time I looked at this stuff.
- mnm1 9y agoYou just need a private subnet, not a whole separate VPC. You still need NAT to get outbound access, but instead of running a random EC2 instance for the NAT, AWS now has a NAT you can deploy with a click or API call. You still pay for it, but it's at least much easier to set up and there's no maintenance. I assume they have redundancy and failover and such built in also.
- justrossthings 9y agoMostly stoked about serverless because I won't have to deal with grumpy backend devs anymore
- sumedh 9y agoCare to elaborate?
- AbstractCache 9y agoTypical front end dev drivel.
- hobolord 9y agothey're still going to be grumpy about how to test and set up development
- zepolen 9y agoI'm stoked too, as it means frontend devs will finally understand why backend is grumpy about frontend.
- staofbur 9y agoWe're not all grumpy :)
- nickthemagicman 9y agoAm a backend dev. Feel the same way.
- kirillzubovsky 9y agoIn 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>
- jedberg 9y agoThe value in serverless is not the serverless itself, but the ecosystem. If you've already got petabytes of data in AWS, you're gonna use Lambda. It's true that Google will win the truly greenfield serverless applications, but I suspect those are few and far between. In most cases people are trying to enhance what they already have which means needing access to what is already there.
- ramblerman 9y ago> Would love to see Amazon compete, but they have a long road ahead Amazon is absolutely dominating this space
- factsaresacred 9y agoFirebase is fantastic and that's because they built their toolset and UI before being acquired by Google. They recently Google-ified their website but it's still less of a mess than Google cloud console (which feels like navigating a helicopter's dashboard). First impressions matter and I think Firebase nailed it. The website presents the value clearly while also allowing you to get into the weeds if you need to. They ought to put their design team in charge of the rest of Google's cloud platform.
- kirillzubovsky 9y agoAgreed. Google cloud console is a mess. In 5 years Firebase acquisition cost would be considered peanuts for the value they've added to Google.
- sriram_iyengar 9y ago- 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
- jedberg 9y ago> node has better warmup time than java lambdas (not sure of python) Python and node are both sub-second, compared to Java's 10+ seconds.
- kagx 9y ago> 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.
- sriram_iyengar 9y ago>> 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. Very much possible, if your regions are different.
- watter 9y agoProbably about 100ms or more on each request (to and from). Slower depending on location and network conditions.
- sriram_iyengar 9y agoYes very much possible if you are requesting across zones. I did extensive testing within zone and couldn't notice anything more than 2-3ms.
- jondubois 9y agoAmazon 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 9y ago> 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/
- brianzelip 9y agoThanks much for linking openwhisk, good to know about it.
- jondubois 9y agoTrue, 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.
- _pmf_ 9y ago> I wouldn't be surprised if it achieves a near-monopoly for a while. I wonder why Google is so passive in this regard; sometimes I think they have an aversion to honest money and real products.
- lucian1900 9y agoThey've had App Engine for many years. They're the pioneers in this field, if anything.
- melvinram 9y ago
- skyisblue 9y agoHas anyone used Zappa in production? What has your experience been like?
- ranman 9y agoI 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
- Sephr 9y agoIs 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.
- superplussed 9y agoIt actually has lead to confusion before when I assumed that someone I was talking to knew what this usage of "serverless" meant. And it was only 15 minutes of talking that we realized our conversation had wildly diverged and neither side knew it.
- perilunar 9y agoNot just peeved, but confused. "With serverless computing, your application still runs on servers" So it's not serverless? Why are you calling it serverless?
- virtualized 9y agoBecause server has become a synonym for "Ubuntu pet machine that developers SSH into to paste random commands from Stack Overflow". People who do that are the target audience of "serverless".
- IanCal 9y agoAlso people with different requirements. I like being able to drop a load of files on s3 and have a few hundred processes start automatically, run and store the results elsewhere without having to ever worry about disk space or managing a fleet of servers which I want running for no more than a couple of minutes.
- eriknstr 9y agoThe very first time I heard "serverless" I thought P2P, but even though I agree somewhat with what you said, think of it as serverless because you don't have to manage the servers yourself.
- nerflad 9y agoIsn't serverless just the present-day incarnation of timesharing?
- collyw 9y agoThere is very little "true innovation" in software these days, its usually a rehash of something from years ago, plus some fancy marketing.
- gamesbrainiac 9y agoIs 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 9y agoI 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 9y agoGood talk! But how would you go about creating something like graphql on AWS lambda? Are you aware of any tutorials?
- isatty 9y ago> With serverless computing, your application still runs on servers, ...
- vizzah 9y agoAmazon 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 9y agoWhere are the 404s? I'll notify some folks to fix them. I'm not finding any but I'm also on mobile.
- parkersweb 9y agoModules 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 9y agoThis 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 9y agoIt'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.
- talkingtab 9y agoCan 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 9y agoAWS 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
- meow_mix 9y agoI'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 9y agoIn 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.