Hey everyone, so I work for a large enterprise that is going heavily into AWS. However, we have been mainly doing ec2/beanstalks up until now: reason being, our enterprise architects want to avoid using lambdas for a lot of stuff due to “vendor lock-in”. Maybe they read this:
What I’m wondering is: how much of an actual issue is this? If I, a developer, write .net core 2.0, node js, python, or whatever code in a lambda, how much of my code is “lambda specific”? Would I not be able to take that code and throw it into an azure function or google equivalent relatively easily if we decided to switch cloud providers? What’s the lift like, anybody done it?
I’m wondering if I’m ignorant on the severity of this or we just have a bunch of fear mongerers who haven’t actually done it and don’t know wtf they are talking about. Thoughts?
There is no lock in, unless you make it so (ie, by requiring an AWS service such as SQS as a core part of your app, you’d have to refactor parts of it to use the equivalent Queue system in other environments - but properly coded this is fairly trivial to do). I read this article at the time and was astounded they’d make that claim.
All the Lambda code i’ve ever written will run on any other system that runs the same version of Python. And i’ve written a lot of Lambda code in a lot of big enterprises.
Lambda uses the same libraries everything else does - the only thing you could call ‘lock in’ is the calls to AWS specific services, but the rest of the code will work wherever can run the same language.
Behind the scenes, AFAIK, Lambda just spins up docker containers to run the language you’ve specified. Otherwise it works exactly the same as running that code on any other system.
Yeah I figured on the AWS services aspect (Sqs, dynamo, etc). But if we are using those anyway, which we are, pushing .net core 2.0 code to a beanstalk is no less locked in than a lambda it sounds like you are saying, which is what I suspected. Thanks!
I think lock in becomes an issue when your system is not coded right. For example, you really need to abstract away your core logic into their own classes or libraries and just use AWS related stubs to call that core logic. That way, theoretically if you wanted to move to say Azure, you would only have to create new Azure specific stubs that call your same core logic.
Not an issue. If you’re really worried about it, you leverage something like Serverless Framework + Event Gateway to make your back-end run seamlessly across AWS, Google Cloud, and Azure, all at the same time.
it’s not lock-in at all. It’s incredibly mobile. You execute your python (or whatever else) on lambda. Then when your super smart architects say no more AWS, you use whatever other FaaS you want. Or you can just run them from literally any instance/vm/computer on the planet that has python installed.
This sums it up pretty well in my opinion. I don’t buy into the lock-in drama because it doesn’t matter in the grand scheme. If you write your code in such a way that SQS is treated as queue any queue could be switched in if need be.
I always figured lambdas would be used as web-related workers. (Like accepting POST data.) So I always wondered how you would access the request object. You put the lambda behind an API gateway, how does your code access the client’s request body, methods, etc.?
Ah well there’s quite a few different ways to use lamdas, some event sources I’ve worked with:
s3 events or timed triggers from CloudWatch events SNS etc - passes a Json object to parse
cli / cron - you can pass whatever
api gateway as below
The format of the AWS events is unique but it’s just parsing a common format. It’s not hard to adapt that to other systems in a bit of input parser code.