re: Getting Started with AWS Lambda and Node.js VIEW POST

FULL DISCUSSION
 

Nice one, Adnan. I'm bookmarking this article.
It would be interesting to know about a couple more things:

  • Reading/writing to disk: is it allowed/slow/limited/expensive?
  • Using a DB like MySQL or Redis or whatever: how to?
  • How reliable are the free tiers? Do they take long to start up?
  • Nice if you happen to know: how does AWS Lambda compare to other lambda services, e.g. Google Functions?
 

Thanks! Glad you're interested in learning more.

  • Read/Write to Disk: There are a few things to wrap your head around regarding serverless architectures in general. There's no persistent storage because it is essentially a container. You have a tiny /tmp dir where you can write to disk, but you seriously do not want to.
  • DB: You have to use a database which is hosted separately. You can, of course, spin up a server and host it yourself, but that's too painful for me so I just use DBaaS solutions such as MongoDB Atlas or AWS RDS. But you can use whatever you like here pretty much. I explained hooking up Atlas to Lambda here.
  • Free tiers: AWS Lambda's free tier is only about invocations and compute time. The performance and start-up speeds are the same nevertheless. Lambda cold starts are usually between 1 and 3 seconds. Which is manageable if you use warm-up scripts and proper tooling. I'd suggest you do use the Serverless Framework and some monitoring solution like Dashbird if you want to create production apps. Take a look at the articles covering all things tagged #serverless on my profile
  • Other FaaS solutions: AWS Lambda is by far the most used and covers most languages. But Google Cloud Functions (Firebase Functions) are great as well. Of course Azure has their Functions too. All of those get the job done the same way. Even the pricing is literally the same. It all boils down to which provider you use and you pick your FaaS solution based on that.

Hope this clears things up. :)

 
code of conduct - report abuse