← All Case Studies
Architecture Case Study 01 · Pricing Flow
💲 How Dynamic Pricing Works
A complete trace of the pricing request lifecycle — from Akamai CDN through Nginx proxy, price resolution, incentive evaluation, and subscription check, to bulk response assembly.
dynamic-pricing-nginxdynamic_pricingincentive-servicepricing-control-center-jtiermachine-learning-toolkit
📖
Overview
dynamic_pricing is a Tier-1 Core Platform service providing real-time and scheduled pricing for all Groupon channels. The request path crosses 5 services and involves synchronous Cassandra, MySQL, and incentive-service calls — making latency at each hop critical.
⚙️
Request Lifecycle — 8 Stages
P99 risk at stages 4 & 6End-to-end flow from consumer API call through price resolution to response delivery.
1
Akamai CDN
Client request · mTLS validation · certificate check
<2ms
→
2
Hybrid Boundary
Envoy proxy · HBU route lookup · ELB forward
<3ms
→
3
Nginx Proxy
dynamic-pricing-nginx · TLS termination · rate limit
<3ms
→
4
ProgramPriceServlet
Java Servlet · Client-ID auth · request parse · RPO feature flags
<5ms
→
5
CurrentPriceService
Rule eval · established price · BoneCP MySQL pool · P99 risk
8–80ms ⚠
→
6
incentive-service
EligibilityEval · CTAOrchestrator · discount rules · sync call
10–40ms 🔴
→
7
ML min-price
Offline feed · Bayesian floor guard · -1 = no discount allowed
offline
→
8
Response
Price + discount + CTA · JSON serialize · bulk assembly
<5ms
🔴
BoneCP connection pool exhaustion causes P99 spikes to 80ms under burst load
Under concurrent TPIS + VIS requests, the BoneCP pool (unmaintained library) exhausts before new connections are provisioned. SEVERE Grafana alert fires in us-central1. Fix: migrate to HikariCP (2–4× faster pool acquisition).
⚡
Bidirectional coupling with PCC JTier creates circular failure risk
dynamic_pricing → PCC JTier (ILS scheduling) AND PCC JTier → dynamic_pricing (price resolution). Coordinated deployment required — neither service can be updated independently without risk.
📊
ML Toolkit is an implicit upstream — invisible in standard dependency graphs
machine-learning-toolkit feeds min-price floors via Airflow DAG → Pricing Service API. No Grafana alert for DAG failures. A missed run silently miscalculates price floors for all downstream consumers.
✅
Clean layer separation: HTTP → DAO → Service → Publish
Graph analysis confirms strong layer boundaries in dynamic_pricing. ExceptionFilterChain is the only cross-cutting concern — a known and acceptable architectural pattern.
⚠️
dynamic_pricing has the highest dependency fanout of all 10 repositories
6,204 nodes, 13,521 edges, and 5+ upstream callers. Blast radius covers TPIS, VIS, PCC JTier, incentive-service, and message-service simultaneously. Any deployment must coordinate across 3+ teams.
🔴
P99 latency risk: MySQL pool starvation under concurrent TPIS + VIS burst
BoneCP pool exhaustion causes 80ms P99 spikes. SEVERE Grafana alert active in us-central1. Priority fix: BoneCP → HikariCP migration (low effort, critical impact).
🎯
Key Takeaway
dynamic_pricing is the platform's central pricing oracle — but its bidirectional PCC JTier dependency, BoneCP pool exhaustion, and implicit ML Toolkit dependency make it fragile under concurrent load. The 3 highest-ROI fixes are: (1) BoneCP → HikariCP, (2) add ILSCoordinatorService anti-corruption layer, (3) add Airflow DAG SLA alert for min-price feed.