Getting Started
New to Stock Sentry? Start here.
Configuration
Customize alerts and notifications.
Features
Learn what Stock Sentry can do.
Troubleshooting
Resolve common issues quickly.
Need More Help?
Can't find what you're looking for?
Contact Support →Cloudflare Infrastructure Guide
Stock Sentry runs on Cloudflare's serverless platform for exceptional performance and reliability.
Key Benefits
- Global Performance: <50ms latency worldwide via edge computing
- Enterprise Security: DDoS protection, SSL/TLS, secure auth
- Auto-Scaling: Handles traffic spikes automatically
- High Availability: 99.99%+ uptime with failover
Core Components
Cloudflare Workers (Compute)
Runs backend code on 300+ edge locations.
| Metric | Value |
|---|---|
| Cold Start | <1ms |
| Avg Response | 15-30ms |
| P95 Response | <100ms |
| Scaling | Unlimited |
Handles: API requests, webhooks, OAuth, real-time alerts, cron jobs.
D1 Database (SQLite)
Global distributed database with edge reads.
| Metric | Value |
|---|---|
| Read Latency | <5ms (edge) |
| Write Latency | <50ms |
| Throughput | 1000+ queries/sec |
Stores: Shops, settings, velocity data, alerts, seasonal patterns, inventory levels.
Retention: Velocity 90 days, Alerts 365 days, Settings indefinite.
KV Namespace (Cache)
Ultra-fast key-value store for sessions and caching.
| Metric | Value |
|---|---|
| Read Latency | <1ms |
| Write Propagation | <60 seconds |
| Distribution | 300+ locations |
Uses: OAuth sessions (1hr TTL), API cache (5min TTL), log deduplication.
Cron Triggers (Scheduled Tasks)
Reliable scheduled execution without infrastructure.
| Schedule | Task | Duration |
|---|---|---|
| Daily 2am UTC | Alert recalculation | ~30s per 1000 variants |
| Hourly | Digest email delivery | ~5s per shop |
| Sunday 3am | Seasonal pattern update | ~2min per shop |
| Sunday 4am | Data cleanup | ~5min |
Data Flow
- Shopify Webhooks: Real-time inventory and order updates
- Workers: Process requests, calculate velocity, generate alerts
- D1 Database: Persistent storage for all shop data
- KV Cache: Session storage and API response caching
- Cron Jobs: Scheduled recalculations and maintenance
Security Features
- mTLS: End-to-end encryption for all communications
- Rate Limiting: Protection against API abuse
- HMAC Validation: Webhook signature verification
- Session Tokens: 1-hour expiry with secure storage
- DDoS Protection: Automatic mitigation at edge
Monitoring
- Logs:
wrangler tail --env production - Tail Worker: Forwards logs to Axiom for analysis
- Error Tracking: Automatic alerts for failures
- Retry Policy: 3 attempts with exponential backoff
Performance Tips
- Edge Caching: API responses cached at nearest location
- Batched Writes: Multiple updates combined for efficiency
- Indexed Queries: All frequent queries use database indexes
- Lazy Loading: Data fetched only when needed
Related: Getting Started | Data Sync | FAQ