Presentation: Clean Architecture for Serverless: Business Logic You Can Take Anywhere

Elena van Engelen ยท rss ยท 2026-07-27 source โ†— Reader ๐Ÿ–ฅ๏ธ

Clean Architecture (Ports & Adapters / Hexagonal Architecture)Cloud Vendor Portability & Lock-in AvoidanceEvolutionary Architecture & Fitness FunctionsModularity & Coupling
Structuring Function-as-a-Service applications with a simplified Clean Architecture โ€” a domain and application layer with zero cloud dependencies, whose separation from infrastructure is enforced not by convention but by Gradle module boundaries, wired to cloud entry points via Spring Cloud Function's dependency injection โ€” lets a team write business logic once and deploy it, materially unchanged, to multiple serverless cloud providers, eliminating vendor lock-in without giving up native cloud capabilities.

practical ยท mixed โ€” A conference talk arguing for a specific course of action (structure your FaaS code this way to get portability) โ€” practical, not theoretical. Form is mixed: expository explanation of serverless/Clean Architecture/Terraform CDK, two personal narratives (the book-editing workflow, the Dutch pension life-events domain) used as motivating examples, a live demo that functions as empirical demonstration/argument, and an argumentative Q&A where the audience pressure-tests and refines the speaker's abstraction boundaries in real time.

Structure

PartRole
Opening provocation: "Is serverless secretly locking us in?"context / motivation
What serverless/FaaS is, its resource-efficiency case, common use cases, and cold-start mitigation (AWS SnapStart, Azure Elastic Premium)context โ€” establishes that serverless is worth using on its own merits, so the lock-in objection is the only thing left to answer
Spring Cloud Function explainer, including the admission that despite being marketed as platform-independent, deploying to different clouds still requires cloud-specific adapter code and trigger definitionssets up the actual problem โ€” the framework alone does not deliver full portability
Hello World demo on AWS and Azure, showing where cloud-specific code actually lives (adapters, entry points, Infrastructure-as-Code triggers)evidence โ€” localizes the cloud-specific surface area before proposing to isolate it
The book-editing-workflow narrative (manual chapter review process) reframed as the demo application's use casenarrative motivation for the concrete example that follows
The Dutch pension life-events narrative (participants, beneficiaries, marriage/divorce/death rules)narrative โ€” argues by example that real business logic can be complex, long-lived, and jurisdiction-specific, which is precisely why it should not be entangled with any one cloud's infrastructure
The Clean Architecture layering (domain / application / infrastructure) and its enforcement via Gradle module dependency configurationthe core prescriptive mechanism โ€” this is the actual solution being proposed
Live demo: the same business logic wired into both an AWS Lambda entry point and an Azure Function entry point via dependency injection, deployed with Terraform CDK, and exercised end-to-end (upload, validate, save, review, email)evidence / proof of concept for the central claim
Key takeaways: portability is achievable; Spring Cloud Function gives runtime DI; Gradle enforces layering; Kotlin's JVM-version flexibility helps; Terraform CDK helps for multi-cloudconclusion โ€” restates the unity as a checklist of mechanisms
Q&A: storage-abstraction naming (Participant 1) and cross-cloud observability/logging (Participant 2)elaboration and correction under audience scrutiny โ€” refines where the architectural boundary actually should sit, and extends the core claim to a domain (observability) the talk itself hadn't covered

Key terms

Propositions

Arguments

You can achieve real business-logic portability across serverless cloud providers, without sacrificing native cloud capabilities, by separating business logic (domain + application) from infrastructure code via a Clean-Architecture-style dependency rule enforced at the Gradle module level.
Explicit premises:
Implicit premises:
Inferences:
Terraform CDK is the right infrastructure-as-code choice specifically when deploying the same conceptual infrastructure to multiple cloud providers.
Explicit premises:
Implicit premises:
Inferences:
The interface boundary between business logic and infrastructure should be drawn at 'requires knowing a concrete technology,' not at 'sounds technical' โ€” so an operation like 'save a document somewhere' belongs on the business-logic-facing interface even though persistence sounds like an infrastructure concern.
Explicit premises:
Implicit premises:
Inferences:

Narratives

Questions addressed

Gaps

Related documents