Using MongoDB in AWS Lambda with the mLab API
<p>Usually you cant use MongoDB in Lambdas because Lambda functions are stateless and operations on MongoDB require a connection, thus you suffer a large performance hit in setting up a DB connection each time a function is run.</p>

<p>A solution I have thought of is to use mLab's REST API (<a href="http://docs.mlab.com/data-api/" rel="nofollow">http://docs.mlab.com/data-api/</a>), that way I dont need to open a new connection each time my Lambda function is called.</p>

<p>On problem I can see if that mLab's REST service could become a bottleneck, plus im relying on it never going down. </p>

<p>Thoughts?</p>