|
|
|
Ask HN: How to avoid cloud lock-in?
|
|
3 points
by IceandFire
2831 days ago
|
|
AWS is really great, but I don’t want to be locked into a single cloud. I am heavily using the AWS compute resources i.e. EC2 and Lambda. What are you doing to keep your business “cloud-neutral” at the technical level? Are you writing cloud abstraction layers in your code? Writing Terraform for various clouds? Any good ideas, assuming a containerized application? What about portability of your serverless code? |
|
Typically, I organize my layers of code as such:
Business Logic, Core < Handlers < Front (HTTP routing, sessions/token stuff, ...).
The dependency can only go from the right to the left, so the BL code never gets touched when I decide to add/replace a handler or a frontend.
When you are on AWS Lambda, you code the Front: a glue between your Handlers and the AWS Lambda platform. So the rest of the project can be updated as-is in an ideal case. When you change your cloud provider, you have to rewrite the Front part again. But the layers underneath will be unchanged.
Of course, this is pure theory. In practice, some cases may require you to break this one-way chain for performance or scalability reasons...