by enz · 8y ago · 0 comments
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...