Skip to main content

Architecture Overview

Scottsdale Mint is a serverless WordPress e-commerce platform built on AWS infrastructure, optimized for high-concurrency precious metals transactions with real-time pricing.


System Architecture Diagramโ€‹

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ EXTERNAL SYSTEMS โ”‚
โ”‚ NFusion Pricing API โ”€โ”€โ†’ Laravel Middleware โ”€โ”€โ†’ WP REST API โ”‚
โ”‚ (spot prices) (price transform) (/suma/v1/update-prices) โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
โ”‚
โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ AWS CloudFront CDN โ”‚
โ”‚ - Static asset caching - Image processing โ”‚
โ”‚ - WooCommerce session cookies - CloudFront IP header โ”‚
โ”‚ - Bypass: /cart, /checkout, /my-account, /uploads/elementor โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
โ”‚
โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ AWS Lambda (Ymir โ€” WordPress Runtime) โ”‚
โ”‚ โ”‚
โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚
โ”‚ โ”‚ WordPress (Bedrock) โ”‚ โ”‚
โ”‚ โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ โ”‚
โ”‚ โ”‚ โ”‚ WP Core โ”‚ โ”‚ WooCommerce โ”‚ โ”‚ Elementor Pro โ”‚ โ”‚ โ”‚
โ”‚ โ”‚ โ”‚ 6.9.1 โ”‚ โ”‚ 10.5.1 โ”‚ โ”‚ 3.35.3 โ”‚ โ”‚ โ”‚
โ”‚ โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ โ”‚
โ”‚ โ”‚ โ”‚ โ”‚
โ”‚ โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ โ”‚
โ”‚ โ”‚ โ”‚ suma-elementor Theme (v2.3.0) โ”‚ โ”‚ โ”‚
โ”‚ โ”‚ โ”‚ Pricing โ€ข WooCommerce โ€ข REST API โ€ข Klaviyo โ€ข Yotpo โ”‚ โ”‚ โ”‚
โ”‚ โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ โ”‚
โ”‚ โ”‚ โ”‚ โ”‚
โ”‚ โ”‚ Custom Plugins: ACH Gateway โ€ข WooEmails โ€ข OrderTracking โ”‚ โ”‚
โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚
โ”‚ โ”‚
โ”‚ Memory: 4096MB (prod) โ”‚ Timeout: 120s โ”‚ Concurrency: 800 โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
โ”‚ โ”‚ โ”‚
โ–ผ โ–ผ โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ Amazon S3 โ”‚ โ”‚ Amazon Aurora โ”‚ โ”‚ Valkey / Redis โ”‚
โ”‚ โ”‚ โ”‚ MySQL โ”‚ โ”‚ (Object Cache Pro) โ”‚
โ”‚ - Uploads โ”‚ โ”‚ - WP database โ”‚ โ”‚ - Object cache โ”‚
โ”‚ - KYC docs โ”‚ โ”‚ - Read replica โ”‚ โ”‚ - Session data โ”‚
โ”‚ - Backups โ”‚ โ”‚ endpoint โ”‚ โ”‚ - Transients โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Key Architectural Decisionsโ€‹

Serverless Lambda (Ymir)โ€‹

WordPress runs in AWS Lambda functions via Ymir. This means:

  • No persistent processes โ€” each request spawns a fresh Lambda invocation.
  • External cron โ€” DISABLE_WP_CRON=1 is always set; scheduled tasks run via Ymir's built-in cron runner (cron: 1 in ymir.yml).
  • Ephemeral filesystem โ€” no persistent file writes. Uploads go to S3. Logs go to PHP stderr (CloudWatch).
  • Cold starts โ€” Ymir's "warmup" feature pre-warms the Lambda pool on deploy (100 requests in production).

Bedrock Frameworkโ€‹

Roots.io Bedrock provides:

  • All dependencies via Composer โ€” WordPress core, all plugins, and the theme are in composer.json.
  • Environment-based configuration โ€” secrets in .env, logic in config/environments/*.php.
  • Hardened paths โ€” WordPress core is at /web/wp/, content at /web/app/ (not publicly writable).
  • No direct file editing in production โ€” DISALLOW_FILE_EDIT=true, DISALLOW_FILE_MODS=true.

Split Aurora Endpointsโ€‹

The database uses Amazon Aurora MySQL with separate read and write endpoints:

  • DB_WRITER_HOST โ€” All write operations (INSERT, UPDATE, DELETE)
  • DB_READER_HOST โ€” All read operations (SELECT), cached queries

Multi-Layer Cacheโ€‹

See Caching Architecture for full detail.

  1. CloudFront CDN โ€” Edge caching for static assets, product pages
  2. Valkey/Redis โ€” Object cache (transients, query cache, session data)
  3. Browser cache โ€” Static assets, product images

Real-Time Pricing Architectureโ€‹

Precious metals prices update every minute:

NFusion API
โ”‚
โ–ผ
Laravel Middleware (external โ€” not in this repo)
โ”‚ (transforms spot prices, calculates premiums, applies tiers)
โ–ผ
POST /wp-json/suma/v1/product/update-prices
โ”‚ (REST endpoint in suma-elementor/inc/endpoints/class-pricing.php)
โ–ผ
WooCommerce product prices updated in Aurora
โ”‚
โ–ผ
Redis object cache invalidated for updated products
โ”‚
โ–ผ
CloudFront cache invalidated for updated product pages

This endpoint is performance-critical. Do not add blocking operations or slow DB queries to the price update path.


Request Flowโ€‹

Standard Page Load (Cached)โ€‹

Browser โ†’ CloudFront (cache hit) โ†’ Response

Standard Page Load (Cache Miss)โ€‹

Browser โ†’ CloudFront โ†’ Lambda (WordPress) โ†’ Aurora Read Replica โ†’ Redis
โ†’ Response โ†’ CloudFront caches response

Checkout and Cartโ€‹

These paths are excluded from CloudFront caching (/cart, /checkout, /my-account):

Browser โ†’ CloudFront (bypass) โ†’ Lambda (WordPress) โ†’ Aurora Write + Read โ†’ Redis

Payment Processing (e.g., ACH)โ€‹

Browser โ†’ checkout page โ†’ ACH Gateway โ†’
Plaid API (bank account auth) โ†’
iTransact API (ACH submission) โ†’
Kount (fraud pre-auth) โ†’
Kount ENS callback to /wp-json/kount/v1/ens โ†’
WC order status updated โ†’ Customer notified via Mailgun

Concurrency and Scalingโ€‹

EnvironmentLambda ConcurrencyMemoryWarmup
Production8004096 MB100 requests
Staging1002048 MB40 requests
Development802048 MB20 requests

Lambda scales horizontally โ€” at 800 concurrency, up to 800 simultaneous requests can be handled. Aurora and Redis are the scalability bottlenecks; both are managed by AWS.


Security Boundariesโ€‹

LayerMechanism
HTTPS everywhereCloudFront HTTPS only; FORCE_SSL_ADMIN=true
Admin access2FA mandatory (WP 2FA Premium + Twilio)
Payment fraudKount Pre-Auth on all payment methods
File modificationDISALLOW_FILE_EDIT=true, DISALLOW_FILE_MODS=true
SQL injectionAll queries via $wpdb->prepare() or WP Query API
XSSAll output escaped via WP functions
CSRFWP nonces on all AJAX/form submissions
IP spoofingwp-config.php handles CloudFront + Cloudflare headers correctly
HSTSheaders-security-advanced-hsts-wp plugin
Data encryptionSENSITIVE_DATA_KEY for sensitive data at rest