
From $30/mo SaaS to $0 Serverless E-Commerce on AWS
A practical case study on Build vs. Buy, reducing PCI scope to zero, and running an e-commerce storefront within the AWS Free Tier.
The Dilemma: The Hidden Tax of Turnkey SaaS
When launching an e-commerce storefront for a boutique brand with a curated catalog—in our case, Onaxale, a niche skincare brand with 11 SKUs and guided daily routines—the default industry advice is straightforward: “Don't reinvent the wheel; use a SaaS platform.”
In Latin America, the undisputed standard for this is Tiendanube (the regional equivalent of Shopify, powering over 120,000 active stores across Argentina, Brazil, and Mexico). Paired with Mercado Pago (the dominant fintech and payment processing gateway in the region, analogous to Stripe / PayPal), it offers a store set up in an afternoon.
However, for early-stage products, low-inventory boutiques, and developers who care about performance and unit economics, turnkey platforms come with non-trivial trade-offs:
- Fixed Overhead vs. Variable Revenue: SaaS platforms charge fixed monthly subscription fees ($20 to $50+/month) plus transaction commissions on top of the payment gateway’s cut. When your catalog is 11 items and order volume is growing organically, recurring fixed SaaS fees eat your margins before you even make a sale.
- Performance Bloat & Vendor Lock-in: Third-party themes and app plugins inject megabytes of unoptimized JavaScript, external trackers, and render-blocking CSS, dragging down Core Web Vitals and conversions.
- The Engineering Itch: When you look closely at what an 11-product catalog actually requires, paying for a monolithic multi-tenant web application running dynamic database queries for every page load is massive overkill.
We asked ourselves: Can we design an ultra-lean, production-grade e-commerce architecture on AWS that runs at $0/month in the Free Tier, delivers sub-50ms static load times globally, and keeps our operational surface close to zero?
Here is how we architected and built it.
Architectural Principles: Doing Less on AWS
The most cost-effective AWS resource is the one you never execute.
To achieve a true $0/month footprint while maintaining high availability and security, we followed three strict constraints:
- Zero compute on browsing: Catalog navigation, search, routine builders, and cart state must never hit a server.
- Zero PCI scope: Cardholder data must never touch our infrastructure or transit through our API.
- Event-driven execution: Lambda runs strictly twice per successful purchase—once to generate a trusted payment preference, and once when the payment processor notifies us via webhook. No background polling, no cron workers, no EC2 instances.
Architecture Overview
Deep Dive into the AWS Stack
1. Frontend & Edge: S3 + Amazon CloudFront
Rather than spinning up an SSR server (such as Next.js on a container or EC2), the storefront is compiled into static, semantic HTML, CSS, and vanilla JavaScript:
- Hosting: Stored in a private Amazon S3 bucket, fronted by an Amazon CloudFront distribution with Origin Access Control (OAC).
- Global Latency: Assets are cached at AWS edge locations. Time-to-First-Byte (TTFB) hovers around 30–50ms.
- Client-Side Cart: Cart state is synchronized in browser
localStorage. Browsing, adjusting quantities, and routine-building happen instantaneously without a single backend call.
2. Ingress & Routing: Amazon API Gateway HTTP API
Instead of standard REST APIs, we chose API Gateway HTTP APIs:
- 70% Cheaper: At $1.00 per million requests (vs. $3.50 for REST APIs), it drastically slashes costs once out of the free tier.
- Lower Latency: Stripped-down protocol overhead without legacy mapping templates.
- Native CORS: Streamlined cross-origin configuration directly in the AWS console or SAM template.
- Surface Area: Only three routes exist in the entire application:
-
POST /checkout/preferences
-
POST /webhooks/mercadopago
-
POST /newsletter
3. Compute: Single-Router Lambda on Graviton (ARM64)
We run a single lightweight router inside AWS Lambda using Node.js:
- Architecture: Compiled for
arm64(AWS Graviton2/Graviton3), which provides up to 20% better price-performance than x86_64.
- Memory Allocation: Sized at 128 MB. The cold start is negligible (~150ms), and warm execution takes ~20–35ms.
- Secrets Management: Sensitive payment processor keys (
MERCADO_PAGO_ACCESS_TOKEN) are securely injected via encrypted environment variables or fetched via AWS Systems Manager Parameter Store.
4. Data Layer: Amazon DynamoDB (On-Demand Mode)
We deliberately chose not to provision an RDS instance or serverless relational cluster. Relational databases carry baseline costs, idle connection overhead, and VPC networking requirements that complicate simple serverless setups.
Instead, we use a single DynamoDB table in Pay-Per-Request (On-Demand) mode:
- Partition Key (
PK): Entity type and identifier, e.g.,ORDER#ext_ref_12345orLEAD#user@example.com.
- Sort Key (
SK): Metadata timestamp, e.g.,METADATA#2026-11-10.
- Zero Baseline: If no one buys today, DynamoDB costs $0.00. No idle capacity reservations, no cluster management.
- Storage: Storing order states and newsletter leads for thousands of transactions takes less than a few megabytes—well within DynamoDB’s permanent 25 GB free tier.
Solving Payments and PCI Compliance: The Checkout Pro Pattern
Handling credit cards requires strict adherence to PCI-DSS standards. For an independent developer or small business, self-hosting card inputs is an operational and liability nightmare.
We solved this using Mercado Pago Checkout Pro (and its embedded Wallet Brick):
- Server-Side Price Authority: The frontend never sends prices to the payment provider. When the user clicks "Checkout", the frontend sends only product SKUs and quantities to
POST /checkout/preferences. Lambda recalculates the canonical total against our backend catalog definitions.
- Delegated Card Capture: Mercado Pago returns a
preferenceId. The customer completes the transaction either on an encrypted hosted checkout page or through an iframe modal.
- No Card Data Touches AWS: Sensitive credit card numbers, CVVs, and tokens flow directly from the client to Mercado Pago's PCI-certified infrastructure. Our AWS backend receives only an opaque
payment_id.
- Idempotent Webhooks: Payment confirmation does not rely on browser redirect URLs (which can fail if the user closes the tab). Instead, Mercado Pago posts an asynchronous webhook event. The Lambda handler checks the
payment_id, ensures the order hasn't already been processed, and atomically marks the order asPAIDin DynamoDB.
The Cost Reality: SaaS vs. AWS Free Tier
Let's look at the financial math for a boutique store doing ~50 to 200 orders per month with ~5,000 visitors:
Component | Turnkey SaaS (Tiendanube + Plugins) | Custom Serverless (AWS Stack) |
|---|---|---|
Base Platform Subscription | $25.00 – $40.00 / month | $0.00 |
Transaction Fee Surcharge | 1.0% to 2.0% per sale | $0.00 (0% platform tax) |
Edge & CDN (CloudFront) | Included in theme | $0.00 (1 TB free transfer/mo) |
Compute (AWS Lambda) | Managed | $0.00 (1M free requests/mo) |
API Gateway (HTTP API) | Managed | $0.00 (1M free calls in Year 1; $0.005 after) |
Database (DynamoDB) | Managed | $0.00 (25 GB free storage permanent) |
SSL Certificate | Included | $0.00 (AWS Certificate Manager) |
Total Monthly Operating Cost | ~$35.00 – $60.00 / month | $0.00 / month |
Note: Gateway transaction fees (Mercado Pago’s card processing rate of ~3.5% + fee) apply equally in both scenarios and are excluded.
By saving ~$500/year in fixed SaaS costs, that capital is reinvested directly into domain acquisition, product formulation, and targeted marketing.
The Unvarnished Truth: The Trade-offs (What You Give Up)
Every architecture is an exercise in trade-offs. Building custom is not free—it trades software subscription costs for developer time and operational discipline.
1. Manual Operations at Low Volume
Tiendanube provides pre-built plugins for regional shipping logistics (Correo Argentino, Andreani, Envíopack) that automatically generate shipping labels and tracking codes.
In our v1 MVP, we intentionally deferred logistics API integrations:
- When a payment is confirmed via webhook, our system notifies the owner via email/WhatsApp with the customer's shipping address.
- Shipping is processed manually at the local courier.
- The Verdict: At 20–50 orders a month, packaging and dispatching manually takes 10 minutes a day. Automated logistics APIs only become cost-effective once order volume creates an operational bottleneck.
2. No Visual CMS for Non-Engineers
If a marketing manager wants to change a banner or alter product descriptions on Tiendanube, they log into a GUI. In our stack, product data lives in a structured
products.json file, and pages are generated via build scripts.- The Verdict: For our team, Git-backed content is a feature, not a bug: version control, atomic rollbacks, and zero CMS security vulnerabilities. But if you have non-technical stakeholders updating catalog items daily, a headless CMS (like Sanity or Contentful) would need to be integrated.
3. Monitoring Is Your Responsibility
On a SaaS platform, downtime is their problem. On AWS, you own your alerts.
We set up:
- AWS Budgets: Alert triggers at $1.00 USD to prevent any billing surprises.
- CloudWatch Alarms: Monitoring Lambda 5xx error metrics and API Gateway 4xx spikes.
Key Takeaways for AWS Builders
- Match Architecture to Business Scale: You don't need Kubernetes, Aurora Serverless v2, or complex microservices to sell 11 products. A static frontend paired with a single Graviton Lambda and on-demand DynamoDB is extraordinarily resilient, lightning fast, and essentially free.
- Leverage the Edge First: Treating your frontend as static assets on S3 and CloudFront eliminates 95% of your backend traffic before it ever touches compute.
- Outsource Liability: By utilizing Mercado Pago Checkout Pro, we minimized our PCI compliance scope to zero. Never collect or store what you don't want to defend in an audit.
- Build vs. Buy is not all or nothing: We "bought" payments (Mercado Pago) and "built" the storefront, routing, and persistence (AWS Serverless). Pick the components where custom engineering gives you a distinct advantage in performance, user experience, and cost.
Are you running serverless e-commerce on AWS or considering migrating away from SaaS platforms? Let's discuss in the comments below!
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article