Infrastructure · 2025
Retail Audit Query Optimization
Tracked down PostgreSQL bottlenecks across millions of audit records on a retail merchandising platform used in store operations across Brazil.
- Query latency
- ~10s → <100ms
- Latency improvement
- 99%+
Engineering Challenge
The Mob2Con platform manages millions of audited store visits across thousands of points of sale, and queries over audit records were taking around 10 seconds.
Production Solution
Used Elastic APM to find the bottlenecks and optimized the PostgreSQL queries behind them. On the same platform, designed the sync APIs for the offline-first mobile app, with caching, SolidQueue jobs and feature toggles keeping store operations running during releases.
System Topology Layers
Observability
Elastic APMPinpoints the slow queries behind store-operation flows.
Database
PostgreSQLQuery optimization across millions of audit records.
Offline-First Sync
Rails APIs + caching + SolidQueueKeeps the mobile app and store operations running during releases, with feature toggles.