TrueProfit · infrastructure cost plan
Save $4.9–7.6K a month in two phases
The short-term plan needs only DevOps time and does not slow releases. The long-term plan needs code work and runs after the guardrails are in place.
AWS prod $11.0K · MongoDB ~$6.1K · lab $0.4K · small lines ~$0.7K
10–15% · ~4–7 DevOps days · no product code
17–27% · MongoDB downsize + code work (21–38 eng-days)
27–42% · $59–91K a year · top of range needs every estimate to land high
Where the money goes
MongoDB is a third of the bill; the rest is spread over many AWS lines
| Line | $/month (Sep) | Note |
|---|---|---|
| MongoDB Atlas (M50 NVMe, billed via FireGroup account) | ~6,100 | May bill; Sep/Oct bill not seen. Primary CPU avg 12%, p95 18%. |
| NAT gateway data (15.3 TB/mo through one NAT) | 842 | 1,014 Lambdas send traffic through it |
| EBS storage (StarRocks cache disks 5.6 TB of 11.1 TB) | 769 | |
| S3 write requests (133M PUT/mo, mostly StarRocks) | 665 | compaction churn |
| AWS Backup of the StarRocks bucket | 647 | Oct run-rate 1,185 |
| SQS requests (standard + FIFO) | 1,107 | 224 queues, 294M empty receives |
| EventBridge events (447M/mo) | 447 | 364M of them from one backup rule |
| Lambda compute + requests | 768 | 1.78B invocations/mo |
| CloudWatch Lambda logs (623 GB) | 402 | top 10 functions ≈ 450 GB |
Short-term · Nov–Dec
Six DevOps-only changes save $1.75–2.7K a month
| # | Change | Saves /mo | Effort | Risk | When | Confidence |
|---|---|---|---|---|---|---|
| S1 | StarRocks backup: keep 2-day point-in-time, cut daily snapshots 30 → 7 days, turn off the S3 → EventBridge notification if unusedOnly after the restore drill passes. See next section. | $1.0–1.4K | 0.5–1 day | shorter history | Nov | MEDIUM |
| S2 | Top up the Compute Savings Plan ($900/mo still on-demand)Decision for the payer account, 1-year commitment. | $0.13–0.25K | 0 days | none | Nov | MEDIUM |
| S3 | Delete leftovers: stopped migration-data, vuhv-test, an unattached volume, Dagster queues and ruleSnapshot first. | $0.03–0.06K | 0.5 day | none | Nov | HIGH |
| S4 | Lower log level on the 10 noisiest Lambdas (env var) | $0.15–0.22K | 1 day | less debug info | before 23 Nov | MEDIUM |
| S5 | Scale msk-sync back down from m5.large | $0.25–0.3K | 0.5 day | wait for backfill | after backfill | MEDIUM |
| S6 | VPC endpoints (DynamoDB gateway free; SQS, SNS, EventBridge, Logs, STS, ECR)Run NAT flow logs for half a day first. | $0.2–0.45K | 1–2 days | network change | Dec, after BFCM | LOW–MEDIUM |
| Short-term total | $1.75–2.7K | 4–7 days | 10–15% of $18.2K · $21–32K a year · no product engineer time | |||
Freeze 23 Nov – 2 Dec (Black Friday): no changes to network, databases or backfill settings. S1–S4 land before it; S5 and S6 after.
S1 · StarRocks
Keep the 2-day restore window and cut the 30-day history
2-day point-in-time + 30 daily snapshots
~0.5 TB of data held as ~10.8 TB-months of backups. Compaction rewrites files, so each daily snapshot keeps a day of churn for 30 days.
Rewinding the bucket undoes too much, too slowly
Files live in S3 but table metadata lives in the FE nodes, so the two can end up out of step. A rewind also throws away every correct write since that moment, and it takes hours. The Dec 2025 restore took 7 jobs, 2 failed.
Undo per table or per shop
- Dropped table: recycle bin,
RECOVER TABLE; keep 3–7 days. - Bad migration/backfill: automatic table snapshot before the change, keep 7 days.
- Wrong shop numbers: re-run backfill from the source.
- Prevent: no DROP/TRUNCATE for app and AI users; prod DDL only via reviewed migration.
Long-term · 2027 H1
MongoDB is the biggest saving, and code work comes last
| # | Change | Saves /mo | Effort | Depends on | When | Confidence |
|---|---|---|---|---|---|---|
| L1 | Finish ADR-023: retire the legacy reportfns → MongoDB read path, stop running two enginesAlready on the roadmap, so no extra roadmap cost. | enables L2 | 3 steps / 3 call sites | 30 clean days of reconciliation | Q1 | HIGH (plan) |
| L2 | Downsize MongoDB Atlas one tier (CPU avg 12%, p95 18%) | $2–3K | 2–3 days + full sync | L1 · working-set check · Atlas bill | Q1 | LOW until bill seen |
| L3 | Move ad-insights from MongoDB to a StarRocks primary-key tableFixes duplicate docs by design (TPCS-5375). Saves money only if it lets L2 drop a tier; adds StarRocks compaction churn. | $0 alone · part of L2 | code + dual write | measure its share of MongoDB first | Q1–Q2 | MEDIUM |
| L4 | Merge the pixel StarRocks cluster into the main one (6 on-demand nodes, disks, MSK, Redis) | $0.5–0.7K | 10–15 days | alerts + tests on pixel ingest | Q2 | LOW |
| L5 | Tune StarRocks load batching and compaction (S3 requests) | $0.3–0.5K | 3–8 days | freshness check | Q2 | LOW |
| L6 | SQS: batch send/receive, FIFO → standard where order does not matter | $0.25–0.45K | 5–10 days | tests per queue | Q2 | LOW |
| L7 | Cache the two busiest sync Lambdas (shops-prod-details, flags-prod-canUser) | $0.1–0.25K | 3–5 days | stale-data rules | Q2 | LOW |
| Long-term total | $3.15–4.9K | 21–38 eng-days + L1 | 17–27% of $18.2K · $38–59K a year | |||
L4–L7 cost product engineer time and slow releases. Schedule each one for when the team is already working on that service.
Guardrails
Each cut waits for a check that can catch and undo its mistakes
Restore drill
Restore point-in-time to a test bucket, start a dev StarRocks on it, count rows. If it fails, fix backup before cutting it.
Reconciliation and alerts
30 clean days after the legacy path is gone, and alerts on billing, sync and onboarding flows.
Tests that bite
Regression tests that fail when a fix is reverted, in a blocking CI job. Today no pipeline runs tests.
How big the saving is
Both phases together equal about 2–4% of net revenue (~$200K/mo). That is worth doing where it is cheap, and too small to justify slowing releases.
Open checks
Seven facts to confirm before the numbers firm up
- MongoDB Atlas invoice for Sep/Oct: the biggest line, still estimated from May.
- ad-insights share of MongoDB storage and working set (decides whether L3 saves money).
- Split the AWS Backup cost between the point-in-time rule and the daily snapshots.
- StarRocks mode, version,
BACKUP/RESTOREsupport,catalog_trash_expire_second, FE metadata backup. - Did the Dec 2025 restore into
starrock-data-v2actually run StarRocks? - Is Atlas continuous backup on? MongoDB is the source of truth.
- Cloudflare, GCP and SaaS bills, and how allocated FireGroup lines are split.
Sources
AWS Cost Explorer prod and lab, Jun–Oct 2026 · AWS Backup plan and recovery points, read 2026-10-23 · vault product-knowledge/04-operations/cost/trueprofit-infra-cost-2026.md, product-knowledge/03-engineering/decisions/2026-10-21-sales-engine-default-read-path.md, product-knowledge/03-engineering/investigations/2026-10-23-technical-research-starrocks-fast-undo-backup.md · Atlas cluster config. Ranges are estimates; mid values used in Fig. 2.