Architecture
Understanding the technical architecture of PriveTag B2A Platform.System Overview
Component Details
API Gateway
The entry point for all AI agent requests:| Feature | Technology | Description |
|---|---|---|
| Load Balancing | AWS ALB | Distributes traffic across instances |
| SSL Termination | CloudFront | Handles HTTPS |
| Rate Limiting | Redis | Per-key rate limiting |
| Authentication | Custom | API key validation |
Recommendation Engine
Processes recommendation requests: Key Technologies:- Language: TypeScript (Node.js)
- ML Model: Custom scoring algorithm
- Cache: Redis for hot data
Booking Service
Handles booking creation and voucher delivery:| Step | Description | SLA |
|---|---|---|
| Validation | Check availability | < 100ms |
| Reservation | Lock inventory | < 200ms |
| Payment | Process if required | < 2s |
| Voucher | Generate QR + PDF | < 500ms |
| Send to user | < 30s |
Inventory Hub
Aggregates availability from multiple sources: Inventory Priority:- Direct venue partnerships (highest margin)
- Klook (good coverage, fast API)
- Viator (extensive catalog)
- GetYourGuide / KKday (backup)
Ground Truth Engine
Processes and stores verified visit data:Data Flow
Recommendation Flow
Booking Flow
Database Schema
Core Tables
Caching Strategy
Cache Layers
| Layer | TTL | Data |
|---|---|---|
| L1: Request | 1 min | API responses |
| L2: Context | 15 min | Weather, enrichment |
| L3: GT Aggregates | 1 hour | Ground truth scores |
| L4: Static | 24 hours | Activity metadata |
Cache Keys
Scalability
Horizontal Scaling
Performance Targets
| Metric | Target | Current |
|---|---|---|
| API Latency (p50) | < 100ms | 85ms |
| API Latency (p99) | < 500ms | 350ms |
| Booking Success Rate | > 99% | 99.2% |
| Uptime | 99.9% | 99.95% |
| Ground Truth Rate | > 80% | 85% |
Security
API Security
- Authentication: API key in
x-api-keyheader - Rate Limiting: Per-key limits
- IP Allowlisting: Optional for enterprise
- Encryption: TLS 1.3 for all connections
Data Security
- At Rest: AES-256 encryption
- In Transit: TLS 1.3
- PII Handling: Anonymization for ML
- Retention: Configurable per client
Monitoring
Key Metrics
Alerting
| Alert | Threshold | Action |
|---|---|---|
| Error Rate | > 1% | Page on-call |
| Latency p99 | > 1s | Investigate |
| Booking Failures | > 5/min | Escalate |
| Database CPU | > 80% | Scale up |