i'm working on MindMup, and we're moving almost all our APIs gradually to lambda and api gateway. we have two APIs running there in production at the moment. the benefit is being able to interact with the rest of the AWS stack easily (we use S3 to upload documents for exporting and heroku to process them at the moment, and dynamodb for storing user accounts and license information). ideally, at the end of the migration, we'll just kill all the heroku exporting and licensing services. should be cheaper as well, because we will be able to kick off lambda functions on s3 events instead of polling for s3 changes from heroku.
everything is versioned (so different api endpoints for staging, prod and development can talk to different versions of the lambda function), which is a big plus.
the api gateway stack is highly opinionated, as in it's good for JSON data parsed using Java on the back end (API gateway uses velocity). our strategy is to use it as a nodejs backend, so there was a lot of magic involved in the setup. it's not well documented and it discovering things like "$input.json('$') means entire body" is not easy. also we wanted to return errors as HTTP codes, not just in the JSON message body.
the setup initially was horrible and magic, but it's luckily automatable. I got it working well so that a single lambda function can receive calls from multiple api paths (so we can deploy an entire API at once, and manage dependencies simply), and that all the environment configuration is in the api gateway, not lambda (so a single function can be invoked with production/staging/development environment parameters).
it took me a while to figure out exactly how to pass things up and down the stack, and we ended up building something similar to apex (but significantly simpler due to a limited use case). a single command-line request packs up everything, uploads lambda, creates and configures the API gateway functions, manages versions and permissions, so it's relatively easy to create a new JS function tied to a URL in the API gateway now. It kind of looks like sinatra. we might end up opensourcing that if I get a chance to clean it up.
Comments
i'm working on MindMup, and we're moving almost all our APIs gradually to lambda and api gateway. we have two APIs running there in production at the moment. the benefit is being able to interact with the rest of the AWS stack easily (we use S3 to upload documents for exporting and heroku to process them at the moment, and dynamodb for storing user accounts and license information). ideally, at the end of the migration, we'll just kill all the heroku exporting and licensing services. should be cheaper as well, because we will be able to kick off lambda functions on s3 events instead of polling for s3 changes from heroku.
everything is versioned (so different api endpoints for staging, prod and development can talk to different versions of the lambda function), which is a big plus.
the api gateway stack is highly opinionated, as in it's good for JSON data parsed using Java on the back end (API gateway uses velocity). our strategy is to use it as a nodejs backend, so there was a lot of magic involved in the setup. it's not well documented and it discovering things like "$input.json('$') means entire body" is not easy. also we wanted to return errors as HTTP codes, not just in the JSON message body.
the setup initially was horrible and magic, but it's luckily automatable. I got it working well so that a single lambda function can receive calls from multiple api paths (so we can deploy an entire API at once, and manage dependencies simply), and that all the environment configuration is in the api gateway, not lambda (so a single function can be invoked with production/staging/development environment parameters).
it took me a while to figure out exactly how to pass things up and down the stack, and we ended up building something similar to apex (but significantly simpler due to a limited use case). a single command-line request packs up everything, uploads lambda, creates and configures the API gateway functions, manages versions and permissions, so it's relatively easy to create a new JS function tied to a URL in the API gateway now. It kind of looks like sinatra. we might end up opensourcing that if I get a chance to clean it up.