Traffic Estimate
To estimate your cloud infrastructure costs using e-commerce metrics, you must translate business traffic and user activity into computing resources like compute instances, database storage, and network bandwidth. [1] The core bridge between these two worlds is your peak traffic volume and your compute-to-db resource consumption per user action.
Before calculating technical resource requirements, map your core conversion funnel to determine the total volume of different user interactions. Using your known e-commerce metrics, map out:
- Total Monthly Sessions: Your baseline traffic volume.
- Add-to-Cart Volume: $\text{Sessions} \times \text{Add-to-Cart Rate}$.
- Total Checkout Actions: $\text{Sessions} \times \text{Conversion Rate}$. [2]
Traffic numbers alone are insufficient for cloud capacity planning because different user actions place vastly different loads on your servers. You need to assign an infrastructure cost weight to different activity states:
| E-commerce Metric | User Action State | Infrastructure Resource Impact | Cost Multiplier |
|---|---|---|---|
| Browsing Sessions | Low-impact Read / Cache Hits | High CDN usage; low application server load; minimal database queries. | Low ($) |
| Cart Activity | Mid-impact Write | Modest memory usage (session caching); frequent database reads/writes. | Medium ($$) |
| Actual Purchases | High-impact Transaction | High CPU utilization; heavy database locking; secure external API calls; zero caching allowed. | High ($$$) |
Cloud infrastructure is priced based on provisioning for peak demands, not averages. Use your web traffic and activity metrics to find your Peak Concurrency.
- Find Peak Hourly Traffic: Identify your busiest hour of the year (e.g., Black Friday or marketing drops). Typically, peak hourly traffic can be $5\times$ to $10\times$ your average hourly traffic. [8]
- Calculate Concurrent Users ($CU$): Use the equation: $$CU = \frac{\text{Peak Hourly Sessions} \times \text{Average Session Duration (in seconds)}}{3600}$$
- Determine Server Capacity: If your target application server instance (e.g., an AWS t3.medium or Google Cloud e2-medium) can safely handle 150 concurrent browsing users, your baseline server requirement is:
$$\text{Required Instances} = \frac{CU}{150}$$
Data transfer out (egress) from your cloud provider to the public internet is a major variable expense. Use your traffic and page weight metrics to calculate this cost.
- Determine Average Page Weight: Look up your average site page size (e.g., 3 MB due to high-res product images).
- Track Pages per Session: Use your analytics tool to find the average number of pages viewed per visit (e.g., 5 pages).
- Calculate Total Monthly Egress Data:
$$\text{Total Data (GB)} = \frac{\text{Monthly Sessions} \times \text{Pages per Session} \times \text{Page Weight (MB)}}{1024}$$
- Apply Provider Rates: Multiply the total gigabytes by your cloud provider’s egress rates (typically around $0.08 per GB on major clouds like AWS).
Unlike application servers that can dynamically scale down to zero when traffic stops, your transactional databases must store data permanently and require high performance for write actions.
- Database Sizing: Calculate total monthly transactions ($\text{Sessions} \times \text{Conversion Rate}$). Multiplied by the metadata payload size per order (usually around 10 KB to 50 KB), this determines your storage growth rate.
- Database IOPS (Input/Output Operations Per Second): High conversion periods trigger massive concurrent database writes. To prevent checkout bottlenecks during high-volume spikes, provision database IOPS based on your peak purchase transactions per second, rather than average monthly sales. [19, 20]
To estimate your monthly cloud bill based on e-commerce metrics, combine the cost segments:
$$\text{Estimated Cloud Cost} = \text{Compute Costs (Peak Concurrency)} + \text{Database Costs (Transaction Volume)} + \text{Network Egress Costs (Traffic } \times \text{ Page Weight)}$$