Serverless vs. Server-Based: A Contact Form Backend Journey

A technical comparison of two solutions implemented to send form data from jasoncv.click directly to my email address.

The Goal: Reliable Form-to-Email Delivery 📧

I successfully implemented two distinct backend solutions to capture user input from a small website form and deliver the data to my email. The ultimate choice came down to **cost efficiency** and **operational overhead**.

Comparison of Architectures

Feature Option 1: EC2 + n8n + Nginx (Server-Based) Option 2: Lambda + SES (Serverless)
Primary Technology Stack AWS **EC2** instance, **n8n** (workflow tool), **Route 53** subdomain, **Nginx Proxy Manager**. AWS **Lambda** (compute function), **API Gateway** (endpoint), AWS **SES** (email sending).
Architecture Model **Server-Based / IaaS.** Requires ongoing server maintenance, patching, and monitoring. **Serverless / FaaS.** Fully managed by AWS—no operating system or server management required.
Cost Model **Higher/Fixed:** Incurring cost for the EC2 instance uptime, even during idle periods. **Lower/Usage-Based:** Near-zero cost for low traffic (saving approximately **£0.50 – £1.00** per month) by paying only for function execution time.
Operational Overhead **High:** Manual setup and management of a full Linux environment, proxy rules, and n8n updates. **Low:** Code focus only. AWS automatically handles infrastructure, scaling, and patching.
Email Deliverability (Spam Risk) Good, using a well-configured sender service within n8n. Initially problematic (spam folder) but fixed by configuring **DKIM and SPF** records for SES.

Conclusion: The Value of Serverless for Small Projects 💡

For a simple, sporadic task like a website contact form, the **Serverless solution (Option 2)** was the clear winner. It offered a significant reduction in **operational overhead** and a much lower, usage-based **cost model**.

The key technical takeaway was ensuring proper **DomainKeys Identified Mail (DKIM)** verification in AWS SES. This step ensures that the email provider (like Gmail) trusts the sender, solving the initial problem of messages being flagged as junk mail and confirming the long-term reliability of the serverless architecture.