8 ms·
Apex lets you build, deploy, and manage AWS Lambda functions with ease
- pmontra 10y agoI didn't try it yet but it seems very useful. I don't see a way to bind a function to a URL on the Amazon API gateway. Is it a missing feature or did I miss it in the documentation? I ask because setting up the URLs that map to functions is the most annoying task with Lambda and must be automated.
- inopinatus 10y agoIt doesn't surprise me that people want to do that, but the design intention of Lambda is to invoke it asynchronously via writes to dynamodb, s3, sqs, IoT etc. I wouldn't make any assumption that someone building tools for Lambda is going to prioritise integration with the API Gateway and its somewhat alien synchronous behaviour. The best fitted Lambda apps are going to have an event-sourced CQRS style, I think. AWS IoT is kinda the last piece of that puzzle to fall into place.
- pmontra 10y agoBut there are already tools like https://github.com/Miserlou/django-zappa https://github.com/Miserlou/django-zappa https://aws.amazon.com/blogs/compute/building-enterprise-level-web-applications-on-aws-lambda-with-deep/ https://aws.amazon.com/blogs/compute/building-enterprise-lev... plus something else that was featured on HN recently and I can't find or remember. Amazon itself has a tutorial about the integration of the API gateway with Lambda at http://docs.aws.amazon.com/apigateway/latest/developerguide/getting-started.html http://docs.aws.amazon.com/apigateway/latest/developerguide/... I saw an evangelist demoing it at an Amazon Summit a month ago. It's so time consuming and error prone that you don't want to do it manually more than once (not that he made any mistake). So I won't say it's a corner case. Maybe it's too early to know what Lambda will grow into.
- homero 10y agoWhat's the point of API Gateway? Looks like a proxy where you recreate your api and does nothing more.
- pmontra 10y agoI think I leant about it when I learnt about Lambda. In this context it's a convenient way to give a URL to a function, pass parameters to it and get back the result. You could build HN with the API gw, one Lambda function per each request and a db.
- inopinatus 10y agoThat's exactly what I'm suggesting is an anti-pattern. Yes you can do that. Yes it's hardly surprising that AWS make it possible, since synchronous RESTful CRUD is such a popular integration approach and often the first one we learn. But I'd advise you to design your LambdaNews service using an asynchronous event-driven model instead. You'll find it reduces complexity and makes for a snappier, more reliable client experience (e.g. no 429 throttling responses to handle). You'll also find that the supporting AWS services like Kinesis, Cognito, IoT, SNS, SQS, DynamoDB, S3 etc are much more in tune with that pattern. The fact is that async platforms scale much better than anything that has to block and poll. It should hardly be surprising that at AWS's massive scale, it becomes a preferred service design pattern. Pub/sub integration people have known this for decades, it is not news. obdisclosure: I am ex-AWS but all the above is derived from public statements and documentation.
- pmontra 10y agoI'm sincerely interested. The POST I use to submit this comment can be asynchronous, no problem (just do ajax). Same for votes and flags. The GET I use to get the page could be a real HTTP GET or diffs coming over a websocket (but I need a page to start with). I'm not sure how to implement that in the AWS ecosystem because I don't have much experience on it, but is it this what you mean with "asynchronous event-driven model"?
- Touche 10y ago> but the design intention of Lambda is to invoke it asynchronously via writes to dynamodb, s3, sqs, IoT etc. I wish they (they being AWS or Apex or someone in this space) said this explicitly. Every time I've read about Lambda I've thought it's interesting but am not sure how/where to invoke it in production.
- dminor 10y agoHere's their documentation on the various ways to invoke a lambda function (including the API Gateway, contrary to what was stated above): http://docs.aws.amazon.com/lambda/latest/dg/intro-core-components.html#intro-core-components-event-sources http://docs.aws.amazon.com/lambda/latest/dg/intro-core-compo...
- southpolesteve 10y agoThere is nothing wrong with using lambda to synchronously respond to user facing API requests. It actually works really well and I would highly recommend it. Were doing it in production at ~15 million calls/day.
- Touche 10y agoIsn't it expensive though?
- southpolesteve 10y agoThat is the best part! It is cheaper! We had a node service that went from $2500/mo to $400/mo just by switching form Ec2 to Lambda. That is the most apples to apples comparison I can give you. Other services were split up or rewritten, but honestly my gut feeling tells me they are costing 10x-50x less. IMO Autoscaling ec2 instances to daily traffic is not a trivial problem and you'll never get the granularity you can with Lambda
- leoalves 10y agoYou are also saving in not having someone maintaining and making sure the server is always online. Even if it was the same price, not having to worry about the server is a big plus
- skrowl 10y agoCheaper than standing up enough EC2 instances to do the same volume. That's the idea at least.
- zbjornson 10y agoStrictly looking at server uptime, yes, it's nearly 5x the cost of comparable t2 on-demand EC2 instances. That can be mitigated if you have spiky traffic where you'd need to turn on several EC2 instances for less than an hour but are stuck paying for the full hour, or if you can scale to zero for extended periods of time. You don't have the ability to serve concurrent requests from a single lambda worker, so if you're waiting for async IO then you're wasting money you wouldn't be wasting with EC2. -- For us lambda was prohibitively expensive at scale. I suspect a fair number of people reporting significant savings vs EC2 had over-provisioned instances.
- southpolesteve 10y agoI built a tool to do just that: https://github.com/bustlelabs/shep https://github.com/bustlelabs/shep It currently only supports node. If you are looking for just lambda, Apex is an awesome tool. But for us we needed end to end integration with API gateway and I wasn't happy with any of the other tools out there.
- lostcolony 10y agoLooks like they're not trying to do that yet. Serverless (serverless.com) has done that; Apex differentiates itself from Serverless in the OP.
- gfunk911 10y agoServerless (the framework) does this, FYI
- mahmud 10y agoSalesforce is not gonna like this. They already have a "cloud" programming environment called Apex. https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_intro_what_is_apex.htm https://developer.salesforce.com/docs/atlas.en-us.apexcode.m...
- hypercluster 10y agoAnd Oracle neither. They have a webapp framework called Apex as well. https://apex.oracle.com https://apex.oracle.com
- davedx 10y agoSlight difference. Salesforce's Apex is name of their programming language. They don't compete directly I don't think?
- snuxoll 10y agoIn terms of general use-case they do, they are both database-driven RAD tools at the end of the day (Salesforce is just a database at the end of the day with a lot of tooling and basic schema-design done for you). But I can't say I've ever seen someone compare them, they aren't usually used by the same customer segments.
- warfangle 10y agoAnd it's a special kind of hell. Reserved for people who talk at the movies.
- geertj 10y agoI've used Apex and I had a completely different experience. The very tight platform integration with force.com, SOSQL, resource management, builtin testing and api framework made it a very productive experience to me. And I say this with a long background in C, C++ and Python.
- warfangle 10y ago
- poyu 10y agoI'm using Serverless framework now, but given that Apex can run codes other than JS and Python, might as well give it a try! https://github.com/serverless/serverless https://github.com/serverless/serverless
- reubano 10y ago> curl https://raw.githubusercontent.com/apex/apex/master/install.sh https://raw.githubusercontent.com/apex/apex/master/install.s... | sh When did package manager go out of style?
- vertex-four 10y agoAs soon as people realised there was an easier way than building and testing packages on 8 different distros, then having people whine because they don't act "right" for each distro. Packaging takes a lot of time out of development work.
- snuxoll 10y agoIt's a single binary, there isn't much "acting right" to be done. Build, install to /usr/bin with appropriate permissions and be done with it. It's not like Go is dynamically linked and requires you deal with varying soname's between distributions.
- reubano 10y agoso does that mean there's no equivalent of `pypi` or `npm` for go? Or is the point to not impose any requirements on the user?
- detaro 10y agoEvery time I look into packaging it seems like it has become even more of an arcane art (or I just don't know what to search for). Most guides and tools seem to aim at package maintainers for individual distros, which have different needs then someone wanting to package their individual software for as many distros as possible. What are the tools to use to solve this?
- jon-wood 10y agoFPM[1] will get you most of the way there, but your packages are still going to seem a bit out of place unless you make distro specific changes. [1] https://github.com/jordansissel/fpm https://github.com/jordansissel/fpm
- davedx 10y agoNote: I stumbled across this while Github stalking TJ Holowaychuk to see what he was up to these days. :)
- franciscop 10y agoA bit of background: it's the first company from TJ [1], one of the creators of Express JS [2] and a collaborator to Node.js [3]. I've been following TJ's work for a while :) [1] https://medium.com/apex-software/announcing-apex-software-inc-5008c454002#.edoatcp56 https://medium.com/apex-software/announcing-apex-software-in... [2] https://strongloop.com/strongblog/tj-holowaychuk-sponsorship-of-express/ https://strongloop.com/strongblog/tj-holowaychuk-sponsorship... [3] https://medium.com/@tjholowaychuk/farewell-node-js-4ba9e7f3e52b#.k4lo44tdt https://medium.com/@tjholowaychuk/farewell-node-js-4ba9e7f3e...
- sotojuan 10y agoA bit more than just Express: Mocha, Jade, ejs, superagent, Koa, etc.
- southpolesteve 10y agoApex is totally awesome. Especially if you are just concerned with Lambda. But if your looking for something that integrates with both Lambda and API gateway check out the tool I wrote: https://github.com/bustlelabs/shep https://github.com/bustlelabs/shep
- sagichmal 10y agoIt's more than a little crass to hijack a post for a project with multiple advertisements for your own, competing project.
- jkahn 10y agoThat's majorly overstating it. I disagree. It's interesting and relevant.
- rajington 10y agogood stuff! added you to https://github.com/anaibol/awesome-serverless https://github.com/anaibol/awesome-serverless
- southpolesteve 10y agoThanks!
- rambos 10y agoI just started using AWS Lambda, can someone explain why this would be better than using AWS console/sdk?
- southpolesteve 10y agoThe AWS UI and console are great for <10 functions. 100 functions... not so much. It becomes necessary to automate things and Apex provides that. If you are just getting started, I'm not sure it is "better". But if your entire stack is lambda funcs its almost necessary to keep your sanity.
- bigethan 10y agoOnce you get beyond "just started" you'll see the value of these tools :-) The charm of Lambda is that it's easy to get rolling, but then the AWS complexity seeps in. This helps deal with a _lot_ of that in a pretty sane way.
- leoalves 10y agoI don't use apex. I use serverless. but it's probably the same idea. All the work of transpiling, minifing, creating lambdas, api gateway, aws resources, stages etc... are done automatically from the command line. You don't need to compile/transpile your code, create a zip, upload to s3, create a lambda import the zip from s3, create the endpoint, connect to the lambda, create the api gateway template, etc... And do this every time you change something in your code. It gets frustrating really fast when doing it manually.
- rambos 10y agoawesome thanks.
- homero 10y agoStill waiting for php
- rajington 10y agoIf you're really interested in a serverless stack, check out https://github.com/anaibol/awesome-serverless https://github.com/anaibol/awesome-serverless
- cdnsteve 10y agoIsn't this an anti-pattern? I mean, Lambda is suppose to eliminate the need for servers and server admin work. However, working with their services, like Lambda, are so tedious that solutions like Apex and Serverless have to be put on top of them. So now you have to learn to use a "Serverless Framework" to abstract the complexity of a serverless service? In my view, they got it wrong. If the service is too cumbersome to use and requires these extra frameworks to actually use them effectively, then there's a fundamental problem with the service it relies on.
- felixgallo 10y agoyou need to consider the alternative. I've been running unix boxes for 30 years, and even though it's node.js-based, even though it's amazon's usual byzantine nonsense, even I think Lambda is a total game changer in the making.
- beat 10y agoNot just from a deployment standpoint, but from a development standpoint! Lambda enforces boundaries and clarity, and strongly encourages simplicity. So, so much better than monolithic app servers.
- southpolesteve 10y agoFor the case of Apex, I think "deployment tool" is better than framework. There isn't really any magic here. At least nothing you couldn't do yourself in the AWS console or UI. It would just suck for more than a few functions. This is automating all the clicking you would have to do otherwise and giving you a sane way to manage functions that can be grouped together.
- cbsmith 10y agoThe "tedium" that Apex & Serverless manage for you are a subset of the "tedium" that you need to manage when you are using servers. You can't get rid of that, but you can avoid all the other stuff involved with managing servers.