Spotlight
AWS Lambda Functions: Return Response and Continue Executing
A how-to guide using the Node.js Lambda runtime.
Wed, 05 Apr 2017
One question we often face at Trek10 as we design Serverless AWS architectures is, what is the most cost-effective and efficient AWS platform service for a new system to use for ingesting data? Of course you could always just spin up some EC2 servers and pump your data into them, but at Trek10 we push hard to design new systems as “serverless-ly” as possible, using AWS platform services such as Lambda, DynamoDB, and S3 to their fullest extent.
A variety of use-cases face this kind of a challenge: IOT is one of the most obvious (getting data from “things” into the cloud), but there are many others: branch offices pushing data to a central system, a slow or “lazy load” migration from your data center, or even an always-on integration between legacy environments and a new AWS environment.
So back to the challenge. There are multiple AWS services that are tailor-made for data ingestion, and it turns out that all of them can be the most cost-effective and well-suited in the right situation. We’ll try to break down the story for you here.
(Two brief caveats: This is not intended to be comprehensive; there are a huge number of possibilities, we just think these are the top few. Also, all pricing is for us-east-1.)
A real-time streaming data queuing service. Kinesis Streams producer apps push data in, and consumer apps pull the data to process it. AWS Lambda functions can be a consumer, so there is no need to run a server to process and store the data out of Kinesis Streams.
Firehose simplifies the consumer side of Streams… your data is automatically pushed into S3, Redshift, or Elasticsearch by the Firehose service.
The grandaddy of AWS services: object storage at scale. Because there is read-after-write consistency, you can use S3 as an “in transit” part of your ingestion pipeline, not just a final resting place for your data. We described an architecture like this in a previous post.
A newer AWS service for enabling IOT applications. At its core, it is an MQTT broker and rules engine which you can use to publish, process, and store data.
We’ve run the numbers on all these options to compare costs at various ingestion profiles, in terms of frequency and size of data. Below are a couple general conclusions to help you make sense of all of this:
I hope this is useful. Hit us up on Twitter @trek10inc if you have any questions or ideas of your own about AWS data ingestion options!
And while you’re here, check out AWS Lambda Pricing in Context - A Comparison to EC2.
A how-to guide using the Node.js Lambda runtime.