In Part 1 – Understanding Client Requirements and Load Patterns for a High-Volume B2C Warehouse Operation, we covered the client profile, the discovery process, and the load analysis — order volumes, background job schedules, concurrent user patterns, and database transaction load. Now, in this blog, we cover how those findings translate into the actual deployment architecture: the distributed server setup, instance sizing, database configuration, network and security design, monitoring, and scalability planning.
For this deployment handling 11,500 orders per day during peak seasons with batch processing running throughout operational hours, a distributed architecture separating user-facing operations from batch processing is the appropriate infrastructure approach.
Batch Processing During Operational Hours:
Unlike the B2B manufacturing case study where batch jobs ran during dedicated midnight–4 AM windows, this B2C operation runs resource-intensive batch processing throughout the 9-hour operational window:
Resource Contention Without Separation:
Running batch jobs on the same server as user-facing operations creates these problems:
Traffic Pattern Analysis:
Primary Application Server:
Batch Processing Server:
Apache Solr Search:
Without distributed architecture at this volume, a monolithic server would see user request response times degrade to 800–1,500ms during batch windows, database connection pool exhaustion, and inability to scale workloads independently.
Based on load analysis and the distributed architecture strategy, we propose the following production environment. This architecture separates user-facing operations onto a primary application server while isolating resource-intensive batch processing on a dedicated batch server.
Fig – Proposed Deployment Architecture
| Server | Instance | vCPU | RAM | Storage | Workload | Peak Load | Notes |
|---|---|---|---|---|---|---|---|
| Primary App Server | c5.2xlarge | 8 | 16 GB | 100 GB EBS (gp3) | User-facing ops only | ~710 req/min | Compute-optimized. Serves 70+ warehouse & 20+ admin users. Target: 200–400ms response. Normal utilization 20–40%, providing 2–3x headroom for growth. |
| Batch Processing Server | c5.2xlarge | 8 | 16 GB | 100 GB EBS (gp3) | Background jobs only | 13–18 hrs batch/day | Handles order import, routing, pick waving, replenishment, inventory sync. Processes large datasets without impacting user ops. Tolerates 4–10 min execution windows. |
| Apache Solr | c5.xlarge | 4 | 8 GB | 100 GB EBS (gp3) | Product catalog search | 50–100 searches/min | Search for ~3,000 SKUs. 8 GB RAM for in-memory indexes. Sub-100ms query response. Serves both primary and batch servers. |
| Jenkins CI/CD | t3.medium | 2 | 4 GB | 30 GB EBS (gp3) | Deployment builds | 5–10 builds/week | Burstable instance for CI/CD pipelines. Runs occasionally during release cycles. |
| Database | Instance | vCPU | RAM | Storage | Purpose | Notes |
|---|---|---|---|---|---|---|
| Primary Database | db.r5.2xlarge (Multi-AZ) | 8 | 64 GB | 250 GB SSD (gp3) | Production workload | 64 GB enables ~22 GB InnoDB buffer pool caching full hot dataset. Multi-AZ: <60s failover. ~1.2M ops/day peak. CPU: 40–50% peak, 25–35% normal. |
| Read Replica | db.r5.2xlarge | 8 | 64 GB | 250 GB SSD (gp3) | Internal reporting, backup testing | Offloads internal reporting queries. Mirrors primary specs for failover consistency. Lag typically <5s. External BI connects to data hub, not OFBiz DB directly. |
Why 8 vCPUs Are Necessary: Peak load generates 2,280 database operations per minute across order processing (50–70 ops/order), fulfillment (34–54 ops/order), lot tracking, background jobs, and concurrent user sessions (70+ warehouse + 20+ admin users).
Backup and Recovery Policy:
All infrastructure resides within a single AWS VPC in the us-east-1 region. The primary application server accepts HTTPS traffic (port 443) from warehouse users, while the batch processing server and Apache Solr remain in private subnets accessible only within the VPC.
Key Security Controls:
The network design prioritizes security without sacrificing operational efficiency — warehouse users access systems securely via HTTPS while internal components communicate over the AWS private network backbone.
AWS CloudWatch tracks infrastructure health and application performance. Key metrics include CPU utilization (alert at >70% sustained), memory usage (alert at >85%), database connection count (alert at >250), and replication lag (alert at >30 seconds).
| Severity | Response Time | Trigger Conditions | Routing |
|---|---|---|---|
| P1 Critical | Immediate | Database failures, primary server down, pick waving failures during operational hours | PagerDuty – immediate response |
| P2 High | 15 minutes | CPU >70% sustained, memory >85%, order import failures >5% | PagerDuty |
| P3 Medium | 1 hour | Batch job delays >30 min, disk space >80% | Email + Slack |
| P4 Low | Next day | Non-critical warnings, off-hours performance issues | Email + Slack |
Application-level monitoring tracks order import success rates (from GCP Pub/Sub), pick waving completion times, routing failures, and warehouse user response times.
Current infrastructure operates at 40–50% capacity during peak operations and 15–20% during normal operations, providing a comfortable runway for 50–75% order volume growth without architectural changes.
| Metric | Vertical Scaling Trigger | Action |
|---|---|---|
| CPU Utilization | >70% consistently during business hours | Upgrade to m5.4xlarge (primary) / c5.4xlarge (batch) |
| Response Time | >500ms under normal load | Upgrade primary application server |
| Concurrent Users | Regularly >100 simultaneously | Upgrade primary or add load balancer |
| Order Volume | Consistently >15,000 orders/day | Review full architecture for horizontal scaling |
Horizontal Scaling Strategy:
When vertical scaling becomes cost-ineffective or peak loads require redundancy, deploy an Elastic Load Balancer with a second primary application server. This enables zero-downtime deployments, geographic redundancy, and seasonal scaling for holiday peaks.
Cost Optimization:
The distributed deployment architecture proposed for this B2C warehouse operation demonstrates how requirements fundamentally shape infrastructure decisions. Unlike the B2B manufacturing case study where monolithic architecture efficiently served batch-processing-during-off-hours patterns, this deployment requires workload separation because batch processing runs continuously throughout the 9-hour operational window.
This case study reinforces the core methodology: structured discovery translates operational patterns into infrastructure decisions. The same discovery process produces different architectures - monolithic with off-hours batch processing for B2B e-commerce with order processing, and distributed for warehouse-heavy B2C operations with continuous operational overlap - because the underlying business models and operational patterns differ fundamentally.