Trade-offs & Alternatives

📖 7 min read 📄 Part 7 of 10

Ticketmaster - Tradeoffs and Alternatives

Queue System Tradeoffs

Virtual Queue vs No Queue

Chosen: Virtual Queue System

Advantages:

  • Prevents system overload
  • Fair first-come-first-served access
  • Transparent wait times
  • Better user experience than crashes

Disadvantages:

  • Additional complexity
  • Infrastructure cost
  • User frustration (waiting)
  • Potential queue abandonment

Alternative: No Queue (Direct Access)

  • Simpler implementation
  • No wait time
  • Why not chosen: System crashes under load, unfair access, poor UX

Hybrid Approach:

Normal Events: No queue (handle with normal capacity)
Major Events: Virtual queue (protect system)
Threshold: Activate queue when traffic > 10x normal

FIFO vs Random Selection

Chosen: FIFO (First-In-First-Out)

Advantages:

  • Fair and transparent
  • Rewards early arrivals
  • Easy to understand
  • Predictable wait times

Disadvantages:

  • Bots can game by arriving early
  • No consideration for fan loyalty
  • Wealthy users can pay for faster internet

Alternative: Random Selection (Lottery)

Advantages:
- Completely fair
- Can't be gamed
- Equal chance for all

Disadvantages:
- Unpredictable
- Frustrating for users
- No reward for dedication

Why not chosen: Users prefer predictability

Alternative: Verified Fan Priority

Implementation:
- Pre-registration required
- Identity verification
- Fan history considered
- Loyalty points system

Advantages:
- Rewards real fans
- Reduces scalpers
- Better targeting

Disadvantages:
- Complex implementation
- Privacy concerns
- Potential discrimination

Use Case: Hybrid with FIFO (verified fans get earlier queue access)

Inventory Management Tradeoffs

Optimistic vs Pessimistic Locking

Chosen: Optimistic Locking

Optimistic Locking:

Process:
1. Read seat with version
2. User selects seat
3. Update with version check
4. Retry if conflict

Advantages:
- High concurrency
- No lock contention
- Better performance
- Scales horizontally

Disadvantages:
- Retry logic needed
- Potential conflicts
- Complex error handling

Pessimistic Locking:

Process:
1. Lock seat for reading
2. User selects seat
3. Update seat
4. Release lock

Advantages:
- No conflicts
- Simpler logic
- Guaranteed success

Disadvantages:
- Lock contention
- Deadlock risk
- Poor scalability
- Reduced throughput

Why not chosen: Can't handle 50K concurrent attempts

Strong vs Eventual Consistency

Chosen: Strong Consistency for Inventory

Strong Consistency:

Use Cases:
- Seat reservations (prevent double-booking)
- Payment transactions (ACID compliance)
- Order confirmation

Implementation:
- Synchronous database writes
- Optimistic locking
- Transaction isolation

Tradeoff: Lower availability, higher latency

Eventual Consistency:

Use Cases:
- Seat availability counts (30-second lag OK)
- Event popularity metrics
- Analytics data

Implementation:
- Async replication
- Cache with TTL
- Background updates

Tradeoff: Higher availability, potential stale reads

Payment Processing Tradeoffs

Sync vs Async Payments

Chosen: Hybrid (Authorize Sync, Capture Async)

Synchronous Payment:

Flow:
Checkout → Authorize → Capture → Confirm

Advantages:
- Immediate confirmation
- Simpler error handling
- Strong consistency

Disadvantages:
- Slower checkout
- Payment gateway failures block checkout
- Poor fault tolerance

Asynchronous Payment:

Flow:
Checkout → Authorize → Confirm → Capture (async)

Advantages:
- Faster checkout
- Better fault tolerance
- Load leveling
- Retry capability

Disadvantages:
- Eventual consistency
- Complex error handling
- Delayed confirmation

Implementation:
1. Authorize payment (hold funds) - Synchronous
2. Reserve seats - Synchronous
3. Confirm order - Synchronous
4. Capture payment - Asynchronous
5. Generate tickets - Asynchronous

Single vs Multiple Payment Gateways

Chosen: Multiple Gateways with Failover

Single Gateway:

Advantages:
- Simpler integration
- Lower maintenance
- Consistent behavior

Disadvantages:
- Single point of failure
- Vendor lock-in
- No negotiating leverage

Why not chosen: Too risky for critical infrastructure

Multiple Gateways:

Implementation:
- Primary: Stripe (70%)
- Secondary: Braintree (20%)
- Tertiary: Adyen (10%)

Advantages:
- High availability
- Vendor leverage
- Geographic optimization
- Risk mitigation

Disadvantages:
- Complex integration
- Higher maintenance
- Reconciliation complexity

Failover Logic:
1. Try primary
2. If error rate > 5%, circuit breaker opens
3. Route to secondary
4. Monitor and recover

Bot Detection Tradeoffs

CAPTCHA Always vs Selective

Chosen: Selective CAPTCHA

Always Show CAPTCHA:

Advantages:
- Maximum bot protection
- Simple implementation
- Consistent experience

Disadvantages:
- Poor user experience
- Slower checkout
- Accessibility issues
- Mobile friction

Why not chosen: Frustrates legitimate users

Selective CAPTCHA:

Show CAPTCHA When:
- High-risk users (new accounts, VPN)
- Rapid actions (clicking too fast)
- Failed attempts
- Random sampling (10%)

Advantages:
- Better UX for most users
- Targeted protection
- Adaptive security

Disadvantages:
- More complex
- Bots may slip through
- Inconsistent experience

Implementation:
- reCAPTCHA v3 (invisible scoring)
- Challenge only low scores
- Fallback to v2 if needed

Device Fingerprinting vs IP Blocking

Chosen: Both (Multi-Layer Defense)

Device Fingerprinting:

Collect:
- Browser fingerprint
- Screen resolution
- Timezone
- Installed fonts
- Canvas fingerprint

Advantages:
- Tracks across IPs
- Detects multiple accounts
- Hard to spoof

Disadvantages:
- Privacy concerns
- Can be bypassed
- False positives

IP Blocking:

Block:
- Known bot IPs
- Data center IPs
- Tor exit nodes
- High-velocity IPs

Advantages:
- Simple and fast
- Effective for basic bots
- Low overhead

Disadvantages:
- Easy to bypass (VPN)
- Blocks legitimate users
- Shared IPs (corporate, ISP)

Hybrid Approach:

Layer 1: IP-based rate limiting
Layer 2: Device fingerprinting
Layer 3: Behavioral analysis
Layer 4: ML-based fraud detection

Benefits: Defense in depth, harder to bypass

Database Sharding Tradeoffs

Event-Based vs User-Based Sharding

Chosen: Event-Based Sharding

Event-Based Sharding:

Shard Key: event_id

Advantages:
- All seats for event on same shard
- No distributed transactions
- Easy to scale hot events
- Isolated blast radius

Disadvantages:
- Uneven distribution (popular events)
- Cross-event queries difficult
- Hot shard problem

Mitigation:
- Dedicated shards for popular events
- Further partition large events
- Monitor and rebalance

User-Based Sharding:

Shard Key: user_id

Advantages:
- Even distribution
- User queries efficient
- Predictable sharding

Disadvantages:
- Seat queries span shards
- Distributed transactions needed
- Complex inventory management

Why not chosen: Inventory management requires event locality

Caching Tradeoffs

Cache-Aside vs Write-Through

Chosen: Cache-Aside for Most Data

Cache-Aside:

Read:
1. Check cache
2. If miss, read database
3. Write to cache
4. Return data

Write:
1. Write to database
2. Invalidate cache
3. Next read will populate cache

Advantages:
- Simple implementation
- Cache only hot data
- Resilient to cache failures

Disadvantages:
- Cache miss penalty
- Stale data possible
- Thundering herd on invalidation

Write-Through:

Write:
1. Write to cache
2. Write to database
3. Return success

Advantages:
- Cache always fresh
- No cache misses
- Consistent data

Disadvantages:
- Write latency
- Cache all data
- Wasted cache space

Use Case: Critical data (seat availability counts)

Short vs Long TTL

Chosen: Adaptive TTL

Short TTL (30 seconds):

Use Cases:
- Seat availability during major sales
- Queue statistics
- Event popularity

Advantages:
- Fresher data
- Less stale reads
- Better accuracy

Disadvantages:
- More cache misses
- Higher database load
- More network traffic

Long TTL (5 minutes):

Use Cases:
- Event details
- Venue information
- User profiles

Advantages:
- Fewer cache misses
- Lower database load
- Better performance

Disadvantages:
- Stale data
- Slower updates
- Inconsistency

Adaptive TTL:

Normal: 5-minute TTL
Major Sale: 30-second TTL
Sold Out: 1-hour TTL

Benefits: Balance freshness and performance

Monitoring Tradeoffs

Sampling vs Full Tracing

Chosen: Adaptive Sampling

Full Tracing:

Advantages:
- Complete visibility
- No missed issues
- Detailed debugging

Disadvantages:
- High cost (10 TB/day)
- Performance overhead
- Storage challenges

Why not chosen: Cost prohibitive at scale

Adaptive Sampling:

Sample Rates:
- Successful requests: 1%
- Errors: 100%
- Slow requests (>2s): 100%
- Critical paths (payment): 100%

Advantages:
- Reduced cost (100 GB/day)
- Lower overhead
- Focus on important traces

Disadvantages:
- May miss rare issues
- Statistical analysis needed
- Sampling bias

Implementation:
- Trace ID-based sampling
- Head-based sampling
- Tail-based sampling for errors

This comprehensive tradeoff analysis demonstrates the complex decision-making required to build a ticket sales platform that handles extreme traffic while ensuring fairness and preventing fraud.