Overview

Smart optimizations can reduce your monthly costs by 30-60% while maintaining excellent customer service.

WhatsApp Cost Optimization

Respond Within 24h

Save: $0.0075/conversation (North America)User-initiated conversations are FREE for 24 hours. Respond quickly to avoid paid template messages.

Batch Notifications

Save: 50% of business-initiated messagesSend one update instead of multiple:
  • Bad: “Order confirmed” + “Order shipped” + “Out for delivery”
  • Good: “Order shipped and out for delivery”

Smart Templates

Save: 30-40% on templatesUse interactive templates instead of multiple follow-ups:
  • Include action buttons
  • Provide complete information
  • Reduce back-and-forth

Avoid Spam

Save: Quality rating penaltiesPoor quality = rate limits = lost revenue
  • Only message engaged customers
  • Honor opt-outs immediately
  • Provide value in every message

WhatsApp Savings Calculator

Your Monthly WhatsApp Costs
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Current:
• User-initiated: 1,500 (FREE)
• Business-initiated: 500 × $0.016 = $8.00
• Total: $8.00/month

Optimized (respond faster, batch messages):
• User-initiated: 1,800 (FREE)
• Business-initiated: 200 × $0.016 = $3.20
• Total: $3.20/month

Monthly Savings: $4.80 (60% reduction)
Annual Savings: $57.60

Infrastructure Optimization

Server Costs

  • Right-Size Instances
  • Use Spot Instances
  • Schedule Resources
Current: t3.medium ($30/month)
  • CPU usage: 35%
  • Memory usage: 45%
  • Conclusion: Over-provisioned
Optimized: t3.small ($15/month)
  • CPU usage: 60-70%
  • Memory usage: 75-80%
  • Savings: $15/month
Monitor for 1 week before downgrading.

Database Optimization

Move old conversations to cheaper storage:
-- Move conversations >6 months old
INSERT INTO conversations_archive
SELECT * FROM conversations
WHERE updated_at < NOW() - INTERVAL '6 months';

DELETE FROM conversations
WHERE updated_at < NOW() - INTERVAL '6 months';
Impact:
  • Database size: -30-50%
  • Cost: -30-50% on database
  • Storage cost: 0.023/GB/month(S3)vs0.023/GB/month (S3) vs 0.115/GB/month (RDS)
Reduce database compute costs:Before: Full table scan
SELECT * FROM conversations 
WHERE assigned_to = 'user-id';
-- 450ms, full scan
After: Indexed query
SELECT id, status, last_message_at 
FROM conversations 
WHERE assigned_to = 'user-id';
-- 12ms, index scan
-- Only fetch needed columns
Impact: 97% faster, 90% less CPU
Reduce database instance size:Without pooling:
  • Need: db.t3.medium (100 connections)
  • Cost: $56/month
With PgBouncer:
  • Need: db.t3.small (25 actual connections)
  • Cost: $28/month
  • Savings: $28/month
PgBouncer: Free, <1GB RAM

Email Optimization

  • Use Free Tiers
  • Switch to AWS SES
SendGrid Free: 100 emails/day = 3,000/monthOptimize to stay under limit:
  • Batch notifications (5 messages → 1 email)
  • Daily digest instead of real-time
  • SMS only for critical alerts
Savings: $20/month (vs Essentials plan)

Smart Caching

Implement Redis caching to reduce database load:
{
  "cache": {
    "enabled": true,
    "ttl": {
      "conversations": 300, // 5 minutes
      "contacts": 3600, // 1 hour
      "user_profile": 1800 // 30 minutes
    }
  }
}
Impact:
  • Database queries: -60-80%
  • Response time: -40%
  • Database instance: Can downgrade
  • Redis cost: $10-25/month
  • Database savings: $30-50/month
  • Net savings: $5-40/month

Monitoring Optimization

  • Use Free Tiers
  • Sample, Don't Log Everything
Free monitoring tools:
  • Uptime Robot: Free for 50 monitors
  • Sentry: 5K errors/month free
  • LogDNA/BetterStack: 1GB/month free
vs Paid:
  • Datadog: $31+/month
  • New Relic: $99+/month
Savings: $31-99/month

Bandwidth Optimization

Compress Images

{
  "media": {
    "compress": true,
    "quality": 80,
    "maxWidth": 1920
  }
}
Savings: 60-80% bandwidth

Use CDN

CloudFront free tier: 1TB/monthSavings: Faster delivery + reduced server bandwidth

Monthly Savings Summary

OptimizationMonthly SavingsEffort
Respond within 24h to WhatsApp$5-20Low
Right-size server instances$15-30Medium
Archive old data$10-20Medium
Switch to AWS SES$19-89Medium
Use free monitoring tools$31-99Low
Enable Redis caching$5-40High
Connection pooling$28Medium
Total Potential Savings$113-318/month

Automation Scripts

Automated cost optimization:
#!/bin/bash
# Daily optimization script

# 1. Archive old conversations
psql $DATABASE_URL -c "
  INSERT INTO conversations_archive
  SELECT * FROM conversations
  WHERE updated_at < NOW() - INTERVAL '180 days'
  ON CONFLICT DO NOTHING;
"

# 2. Vacuum database
psql $DATABASE_URL -c "VACUUM ANALYZE;"

# 3. Clear old logs
find /var/log/app -type f -mtime +30 -delete

# 4. Optimize images
find /storage/media -name "*.jpg" -mtime -1 \
  -exec jpegoptim --max=80 {} \;

echo "Optimization complete"
Run daily via cron:
0 2 * * * /path/to/optimize.sh

Next Steps