4 ms·
The code for Lambda and API Gateway can be moved to servers easily enough, yes. Switching away from using DynamoDB as a backend store, though, not so much. That
by joecot 9y ago
The code for Lambda and API Gateway can be moved to servers easily enough, yes. Switching away from using DynamoDB as a backend store, though, not so much. That would be quite a migration.
As a compromise I'd look to using MySQL or Postgres as a backend, and that being the only server I'm running, so that it's easier to move later (and so I still have access to a relational database). Except Lambda cold starts in a VPC are horrid, with no sign of change.
If you haven't looked into Lambda cold start problems, you're in for a treat. The main pitch for Lambda is for little utilized services, or services that need to scale fast, right? And in this example, you're using it to power an API? Imagine if the service is lightly used, whenever a user goes to hit the API for the first time, it takes 15 seconds to respond. Or worse, imagine if the service is getting popular, users get subjected to 15+ second response times every time Lambda has to start a new instance.
- throwaway2016a 9y agoDynamoDB does have its drawbacks and I agree it is far from perfect. But you also don't have to use Dynamo. Lambda can connect to other databases too. Although I did try to address some of your concerns in a reply to your other post.
- throwaway2016a 9y ago> If you haven't looked into Lambda cold start problems, you're in for a treat. What the heck are you doing for 15 second cold starts? I haven't seen more than a 1s overhead for cold starts with Node.js apps packed with webpack (more like 2 or 3s without webpack) But yes, if the cold start time is unacceptable to you. Lambda is a terrible fit. But you have to ask yourself what is and is not acceptable. Especially in a mobile or single page app where you can eager load or do background requests. It is not for everyone. Another trick is to group similar functions together in the same code and have different API gateway endpoints go to the same Lambda. Using that method most apps I've made have less than 1% of requests hit a cold start situation. Edit: for many apps 1% sold starts is unacceptable. And that's OK. Lambda isn't for you.
- joecot 9y agoIf you're cold starting in the public cloud, Lambda can start in 1s. If you're cold starting Lambda functions with a VPC NIC (which you would need to do if you're trying to connect to a MySQL server), it can take 10-15+ seconds. The issue is provisioning the network interface, not any manner of packing the code.
- throwaway2016a 9y agoThank you for clarifying. I up voted you. I have not experience that since I run most of my Lambdas in the public cloud so I have not experienced that. That is good to know and sounds like something they really need to address.