Skip to content

Limits & Quotas Reference - Audit Trail Platform (ATP)

Fair, predictable, auditable — ATP enforces resource quotas per tenant/edition, rate limits to prevent abuse, and capacity guardrails to maintain SLOs while optimizing costs across all environments.


📋 Documentation Generation Plan

This document will be generated in 14 cycles. Current progress:

Cycle Topics Estimated Lines Status
Cycle 1 Limits & Quotas Philosophy (1-2) ~3,000 ⏳ Not Started
Cycle 2 API Rate Limiting (3-4) ~3,500 ⏳ Not Started
Cycle 3 Ingestion Limits & Quotas (5-6) ~4,000 ⏳ Not Started
Cycle 4 Storage Limits & Capacity (7-8) ~3,500 ⏳ Not Started
Cycle 5 Query & Export Limits (9-10) ~3,500 ⏳ Not Started
Cycle 6 Messaging Limits (11-12) ~3,000 ⏳ Not Started
Cycle 7 Compute & Memory Limits (13-14) ~3,000 ⏳ Not Started
Cycle 8 Azure Service Limits (15-16) ~4,000 ⏳ Not Started
Cycle 9 Per-Tenant Quotas by Edition (17-18) ~4,000 ⏳ Not Started
Cycle 10 Monitoring & Alerting (19-20) ~3,000 ⏳ Not Started
Cycle 11 Scaling Strategies (21-22) ~3,000 ⏳ Not Started
Cycle 12 Cost Optimization (23-24) ~3,000 ⏳ Not Started
Cycle 13 Quota Management & Governance (25-26) ~2,500 ⏳ Not Started
Cycle 14 Troubleshooting & Best Practices (27-28) ~3,000 ⏳ Not Started

Total Estimated Lines: ~47,000


Purpose & Scope

This document provides the complete reference for all limits, quotas, and resource constraints within the Audit Trail Platform (ATP), covering API rate limits, storage capacity, compute resources, messaging throughput, per-tenant quotas, and Azure service limits that govern system behavior, performance, and cost.

Why Limits & Quotas Matter for ATP

  1. Fair Resource Allocation: Prevent any single tenant from monopolizing shared resources
  2. Cost Predictability: Enforce usage boundaries aligned with subscription tiers (Free, Pro, Enterprise)
  3. SLO Protection: Maintain performance and availability targets across all tenants
  4. Capacity Planning: Understand growth trajectories and trigger scaling thresholds
  5. Abuse Prevention: Block malicious or accidental resource exhaustion attacks
  6. Compliance Boundaries: Honor data residency, retention, and export restrictions
  7. Operational Safety: Prevent cascading failures from runaway processes

Limit Categories in ATP

  • Rate Limits: Requests per second/minute (API, ingestion, export)
  • Throughput Limits: Events/messages per second, bytes per day
  • Storage Quotas: Total GB per tenant, retention period maximums
  • Compute Limits: CPU/memory per workload, concurrent jobs
  • Message Limits: Message size, batch size, queue depth
  • Concurrency Limits: Parallel operations, connections, sessions
  • Resource Limits: Database connections, cache size, network bandwidth

Detailed Cycle Plan

CYCLE 1: Limits & Quotas Philosophy (~3,000 lines)

Topic 1: ATP Limits & Quotas Philosophy

What will be covered: - Why Enforce Limits? - Fair Use: Multi-tenant fairness (noisy neighbor prevention) - Predictable Costs: Cost containment and budget adherence - System Stability: Protect service SLOs (99.9% availability) - Capacity Planning: Forecasting and scaling triggers - Compliance: Honor regulatory constraints (data residency, retention)

  • Limit Types

    1. Hard Limits (Rejections)
       - API returns 429 Too Many Requests
       - Export job fails with "Quota Exceeded"
       - Cannot exceed under any circumstances
    
    2. Soft Limits (Throttling)
       - Requests queued, not rejected
       - Gradual degradation (slower processing)
       - Burst tolerance with sustained limit
    
    3. Guidance Limits (Warnings)
       - Notifications at 80%, 90% usage
       - No enforcement, informational only
       - Helps tenants plan upgrades
    

  • Limit Enforcement Points

  • API Gateway: Rate limiting (requests/minute)
  • Ingestion Service: Event throughput (events/second)
  • Storage: Retention policies, total GB per tenant
  • Query Service: Result pagination, query complexity
  • Export Service: Export windows, bytes/day, concurrent jobs
  • Messaging: Message size, prefetch count, concurrency

  • Edition-Based Quotas | Resource | Free | Pro | Enterprise | |---------------------------|-----------|-----------|------------| | API Rate (req/min) | 60 | 600 | 3,000 | | Ingestion (events/sec) | 10 | 100 | 500 | | Storage (GB) | 10 | 500 | 5,000+ | | Query Rate (req/min) | 30 | 300 | 1,500 | | Concurrent Exports | 1 | 3 | 10 | | Export Bytes/Day (GB) | 10 | 100 | 1,000+ | | Retention (days) | 30 | 365 | 2,555+ | | Webhook Subscriptions | 1 | 5 | 20 |

  • Quota Inheritance & Overrides

  • Base quotas from edition
  • Per-tenant overrides (contract-based)
  • Temporary quota increases (support tickets)
  • Permanent upgrades (edition changes)

Code Examples: - Quota enforcement architecture - Edition-based quota matrix - Quota override mechanisms

Diagrams: - Limit enforcement points - Edition quota hierarchy - Hard vs. soft limit behavior

Deliverables: - Limits & quotas philosophy document - Edition quota matrix (complete) - Enforcement architecture


Topic 2: Quota Management Architecture

What will be covered: - Quota Storage & Resolution

public interface IQuotaService
{
    Task<TenantQuotas> GetQuotasAsync(string tenantId);
    Task<QuotaUsage> GetUsageAsync(string tenantId, QuotaType quotaType);
    Task<bool> CheckQuotaAsync(string tenantId, QuotaType quotaType, long requestedAmount);
    Task IncrementUsageAsync(string tenantId, QuotaType quotaType, long amount);
}

public class TenantQuotas
{
    public string TenantId { get; set; }
    public string Edition { get; set; }
    public long ApiRateLimit { get; set; }          // req/min
    public long IngestionRateLimit { get; set; }    // events/sec
    public long StorageQuotaGB { get; set; }
    public long ExportBytesPerDayGB { get; set; }
    public int ConcurrentExports { get; set; }
    public int RetentionDays { get; set; }
    public Dictionary<string, long> Overrides { get; set; }
}

public class QuotaUsage
{
    public string TenantId { get; set; }
    public QuotaType Type { get; set; }
    public long CurrentUsage { get; set; }
    public long Limit { get; set; }
    public double PercentageUsed => (CurrentUsage * 100.0) / Limit;
    public DateTime ResetAt { get; set; }
}

  • Quota Storage Options
  • Redis: Fast, distributed counters (rate limiting)
  • SQL: Persistent quotas and historical usage
  • Cosmos DB: Global distribution for multi-region quotas
  • In-Memory: Cache for frequently accessed quotas

  • Quota Reset Strategies

  • Time-Based: Reset every minute/hour/day (sliding window)
  • Token Bucket: Tokens replenish over time (burst tolerance)
  • Leaky Bucket: Constant output rate (smooth traffic)
  • Fixed Window: Reset at interval boundaries (simple)

  • Quota Monitoring

  • Real-time usage tracking (Application Insights metrics)
  • Threshold alerts (80%, 90%, 100%)
  • Historical usage trends
  • Anomaly detection (sudden spikes)

Code Examples: - IQuotaService implementation - Redis-based rate limiter - Token bucket algorithm - Usage tracking middleware

Diagrams: - Quota service architecture - Token bucket vs. leaky bucket - Quota resolution flow

Deliverables: - Quota service implementation - Rate limiting algorithms - Monitoring integration


CYCLE 2: API Rate Limiting (~3,500 lines)

Topic 3: API Gateway Rate Limiting

What will be covered: - ASP.NET Core Rate Limiting Middleware

services.AddRateLimiter(options =>
{
    options.RejectionStatusCode = StatusCodes.Status429TooManyRequests;

    // Global limiter (per-tenant)
    options.GlobalLimiter = PartitionedRateLimiter.Create<HttpContext, string>(context =>
    {
        var tenantId = context.GetTenantId();
        var edition = context.GetTenantEdition();

        // Get rate limit from edition
        var permitLimit = GetPermitLimit(edition);  // Free: 60/min, Pro: 600/min, Enterprise: 3000/min

        return RateLimitPartition.GetFixedWindowLimiter(tenantId, _ => new FixedWindowRateLimiterOptions
        {
            PermitLimit = permitLimit,
            Window = TimeSpan.FromMinutes(1),
            AutoReplenishment = true,
            QueueLimit = 0  // No queuing, reject immediately
        });
    });

    // Endpoint-specific policies
    options.AddFixedWindowLimiter("ingestion", options =>
    {
        options.PermitLimit = 100;
        options.Window = TimeSpan.FromSeconds(1);
    });

    options.AddTokenBucketLimiter("export", options =>
    {
        options.TokenLimit = 10;
        options.ReplenishmentPeriod = TimeSpan.FromMinutes(1);
        options.TokensPerPeriod = 1;
        options.AutoReplenishment = true;
    });
});

// Apply rate limiting
app.UseRateLimiter();

// Endpoint configuration
[EnableRateLimiting("ingestion")]
[HttpPost("events")]
public async Task<IActionResult> IngestEvent([FromBody] AuditEvent auditEvent) { ... }

  • Rate Limit Response Headers

    HTTP/1.1 429 Too Many Requests
    X-RateLimit-Limit: 600
    X-RateLimit-Remaining: 0
    X-RateLimit-Reset: 1699920000
    Retry-After: 60
    Content-Type: application/json
    
    {
      "error": "RateLimitExceeded",
      "message": "API rate limit of 600 requests/minute exceeded. Retry after 60 seconds.",
      "limit": 600,
      "remaining": 0,
      "resetAt": "2025-11-01T12:00:00Z",
      "upgradeUrl": "https://audit.connectsoft.io/pricing"
    }
    

  • Rate Limiting Strategies

  • Fixed Window: Simple, predictable (60 req/min resets at :00)
  • Sliding Window: Smoother (rolling 60-second window)
  • Token Bucket: Burst tolerance (burst 10, refill 1/sec)
  • Leaky Bucket: Constant rate (queue excess requests)

  • Per-Tenant Rate Limiting

  • Extract tenant ID from JWT claims or header
  • Lookup tenant edition (Free, Pro, Enterprise)
  • Apply edition-specific rate limits
  • Track usage per tenant in Redis

  • Rate Limit Bypass

  • Internal service-to-service calls (no rate limit)
  • Admin API keys (elevated limits)
  • Health check endpoints (exempt)
  • Webhook delivery retries (separate quota)

Code Examples: - Complete rate limiting middleware setup - All rate limiting strategies (Fixed Window, Sliding, Token Bucket) - Per-tenant rate limit configuration - Rate limit response headers

Diagrams: - Rate limiting middleware flow - Fixed vs. sliding window comparison - Token bucket visualization - Rate limit enforcement architecture

Deliverables: - Rate limiting middleware configuration - All rate limiting strategies (code + config) - Response header standards - Bypass rules


Topic 4: Rate Limit Monitoring & Alerting

What will be covered: - Telemetry for Rate Limiting

public class RateLimitTelemetryMiddleware
{
    public async Task InvokeAsync(HttpContext context, RequestDelegate next)
    {
        var tenantId = context.GetTenantId();
        var endpoint = context.Request.Path;

        // Track rate limit check
        _telemetry.TrackEvent("RateLimitCheck", new Dictionary<string, string>
        {
            ["TenantId"] = tenantId,
            ["Endpoint"] = endpoint,
            ["Edition"] = context.GetTenantEdition()
        });

        await next(context);

        if (context.Response.StatusCode == 429)
        {
            // Track rate limit exceeded
            _telemetry.TrackMetric("RateLimitExceeded", 1, new Dictionary<string, string>
            {
                ["TenantId"] = tenantId,
                ["Endpoint"] = endpoint,
                ["Edition"] = context.GetTenantEdition()
            });
        }
    }
}

  • Application Insights Queries

    // Top 10 tenants hitting rate limits
    customMetrics
    | where name == "RateLimitExceeded"
    | extend TenantId = tostring(customDimensions.TenantId)
    | extend Edition = tostring(customDimensions.Edition)
    | summarize Count = sum(value) by TenantId, Edition
    | top 10 by Count desc
    
    // Rate limit usage by edition
    customEvents
    | where name == "RateLimitCheck"
    | extend Edition = tostring(customDimensions.Edition)
    | extend IsExceeded = (customDimensions.StatusCode == "429")
    | summarize 
        TotalRequests = count(),
        Exceeded = countif(IsExceeded)
        by Edition
    | extend ExceededPercentage = (Exceeded * 100.0) / TotalRequests
    

  • Alerting Rules

  • High Rate Limit Rejection Rate: Alert if >10% of requests hit 429
  • Tenant Consistently Over Limit: Alert if same tenant exceeds 5 times in 1 hour
  • Edition Upgrade Opportunity: Notify sales if tenant hits 80% of limit frequently

  • Dashboard Metrics

  • Rate limit usage by tenant
  • 429 responses over time
  • Edition-wise rate limit distribution
  • Top rejected endpoints

Code Examples: - Rate limit telemetry middleware - Application Insights queries (complete) - Alert rule configurations - Dashboard JSON (Azure Monitor)

Diagrams: - Telemetry flow - Dashboard layout (mockup) - Alert notification flow

Deliverables: - Telemetry middleware - Monitoring query library - Alert rules - Dashboard templates


CYCLE 3: Ingestion Limits & Quotas (~4,000 lines)

Topic 5: Event Ingestion Rate Limits

What will be covered: - Ingestion Throughput Limits | Edition | Events/Second | Events/Minute | Events/Day | Burst Capacity | |------------|---------------|---------------|-------------|----------------| | Free | 10 | 600 | 864,000 | 20 (1 sec) | | Pro | 100 | 6,000 | 8,640,000 | 200 (1 sec) | | Enterprise | 500 | 30,000 | 43,200,000 | 1,000 (1 sec) |

  • Ingestion Enforcement

    [EnableRateLimiting("ingestion")]
    [HttpPost("api/v1/events")]
    public async Task<IActionResult> IngestEvent([FromBody] AuditEvent auditEvent)
    {
        var tenantId = HttpContext.GetTenantId();
    
        // Check tenant-specific ingestion quota
        if (!await _quotaService.CheckQuotaAsync(tenantId, QuotaType.IngestionRate, 1))
        {
            return StatusCode(429, new
            {
                Error = "IngestionRateLimitExceeded",
                Message = "Event ingestion rate limit exceeded. Current limit: 10 events/second.",
                RetryAfter = 1
            });
        }
    
        // Increment usage counter
        await _quotaService.IncrementUsageAsync(tenantId, QuotaType.IngestionRate, 1);
    
        // Process event
        await _ingestionService.IngestAsync(auditEvent);
    
        return Accepted();
    }
    

  • Batch Ingestion Limits

    {
      "BatchIngestion": {
        "MaxBatchSize": 1000,           // Max events per batch
        "MaxBatchSizeBytes": 10485760,  // 10 MB max payload
        "MaxEventSizeBytes": 262144,    // 256 KB max per event
        "TimeoutSeconds": 30
      }
    }
    

  • Ingestion Back-Pressure

  • Queue depth monitoring (Azure Service Bus)
  • Throttle ingestion if queue > 10,000 messages
  • Return 503 Service Unavailable (not 429)
  • Retry-After header with backoff

  • Burst Tolerance

  • Token bucket: 100 tokens, refill 10/sec
  • Allows brief spikes (e.g., 100 events in 1 second)
  • Sustained rate must average to limit (10/sec for Free)

Code Examples: - Ingestion rate limit enforcement - Batch ingestion validation - Back-pressure handling - Token bucket burst implementation

Diagrams: - Ingestion rate limit flow - Burst tolerance timeline - Back-pressure architecture

Deliverables: - Ingestion rate limiting guide - Batch ingestion limits - Back-pressure implementation


Topic 6: Event Size & Payload Limits

What will be covered: - Event Size Limits

Component                | Limit       | Enforcement
-------------------------|-------------|-------------
Single Event Size        | 256 KB      | API Gateway rejects >256KB
Batch Payload Size       | 10 MB       | API Gateway rejects >10MB
Event Field Value Size   | 64 KB       | Per-field maximum
Total Event Fields       | 1,000       | Maximum field count
Nested Depth             | 10 levels   | Max JSON nesting
String Field Length      | 32,768 chars| Individual string max
Binary Attachment Size   | 5 MB        | Per-attachment limit
Total Attachments/Event  | 10          | Maximum count

  • Payload Validation

    public class EventSizeValidator
    {
        private const int MaxEventSizeBytes = 256 * 1024;  // 256 KB
        private const int MaxFieldCount = 1000;
        private const int MaxStringLength = 32768;
    
        public ValidationResult Validate(AuditEvent auditEvent)
        {
            var errors = new List<string>();
    
            // Check total event size
            var eventSize = JsonSerializer.Serialize(auditEvent).Length;
            if (eventSize > MaxEventSizeBytes)
            {
                errors.Add($"Event size ({eventSize} bytes) exceeds maximum ({MaxEventSizeBytes} bytes)");
            }
    
            // Check field count
            var fieldCount = CountFields(auditEvent);
            if (fieldCount > MaxFieldCount)
            {
                errors.Add($"Event has {fieldCount} fields, maximum is {MaxFieldCount}");
            }
    
            // Check string lengths
            CheckStringLengths(auditEvent, errors);
    
            return errors.Any() 
                ? ValidationResult.Failure(errors) 
                : ValidationResult.Success();
        }
    }
    

  • Size Limit Error Responses

    {
      "error": "EventTooLarge",
      "message": "Event size (300KB) exceeds maximum allowed size (256KB)",
      "eventSize": 307200,
      "maxSize": 262144,
      "suggestions": [
        "Remove unnecessary fields",
        "Compress large payloads",
        "Move attachments to external storage with references",
        "Split into multiple smaller events"
      ]
    }
    

Code Examples: - Event size validation (complete) - Payload size enforcement - Error response formatting - Size optimization suggestions

Diagrams: - Event size validation flow - Nested depth checking

Deliverables: - Event size validator - Payload limits reference - Error handling guide


CYCLE 4: Storage Limits & Capacity (~3,500 lines)

Topic 7: Storage Quotas by Tier

What will be covered: - Storage Tier Limits | Tier | Storage Type | Per-Tenant Quota | Retention Max | Cost/GB/Month | |------|--------------|------------------|---------------|---------------| | HOT | Azure Blob (WORM) | Free: 10GB, Pro: 500GB, Enterprise: 5TB+ | 7-90 days | $0.018 | | WARM | Azure SQL/Cosmos DB | Free: 5GB, Pro: 250GB, Enterprise: 2.5TB+ | 30-365 days | $0.005 | | COLD | Azure Blob Archive | Free: 10GB, Pro: 1TB, Enterprise: 50TB+ | 1-7 years | $0.001 |

  • Storage Quota Enforcement

    public class StorageQuotaMiddleware
    {
        public async Task<bool> CheckStorageQuota(string tenantId, long sizeBytes)
        {
            var quota = await _quotaService.GetQuotasAsync(tenantId);
            var currentUsage = await _storageMetrics.GetCurrentStorageGB(tenantId);
            var requestedGB = sizeBytes / (1024.0 * 1024.0 * 1024.0);
    
            if (currentUsage + requestedGB > quota.StorageQuotaGB)
            {
                _logger.LogWarning("Storage quota exceeded for tenant {TenantId}. Current: {Current}GB, Quota: {Quota}GB",
                    tenantId, currentUsage, quota.StorageQuotaGB);
    
                return false;  // Reject ingestion
            }
    
            return true;
        }
    }
    

  • Retention Policy Limits

  • Minimum Retention: 7 days (compliance requirement)
  • Maximum Retention: 2,555 days (7 years for Enterprise)
  • Default Retention: 30 days (Free), 365 days (Pro), 730 days (Enterprise)
  • Lifecycle Automation: HOT → WARM (30 days), WARM → COLD (365 days)

  • Storage Growth Projections

  • Average event size: 2 KB
  • Free: 10 events/sec × 2KB × 86,400 sec = ~1.7 GB/day
  • Pro: 100 events/sec = ~17 GB/day
  • Enterprise: 500 events/sec = ~86 GB/day

  • Storage Quota Warnings

  • 80% usage: Email notification to tenant admin
  • 90% usage: Dashboard warning banner
  • 95% usage: Daily email + dashboard alert
  • 100% usage: Ingestion blocked, upgrade prompt

Code Examples: - Storage quota enforcement - Retention policy configuration - Growth projection calculator - Quota warning system

Diagrams: - Storage tier architecture - Lifecycle policy flow - Growth projection chart - Warning notification flow

Deliverables: - Storage quota enforcement - Retention policy engine - Growth calculators - Warning/alert system


Topic 8: Storage Performance & IOPS Limits

What will be covered: - Azure Blob Storage Limits

Metric                          | Free Tier        | Pro Tier         | Enterprise Tier
--------------------------------|------------------|------------------|------------------
Max Storage Account Size        | 10 TB            | 50 TB            | 500 TB
Max Blob Size                   | 5 GB (per blob)  | 5 GB             | 5 GB
Max IOPS (Premium Block Blob)   | N/A              | 100,000          | 250,000
Max Throughput (GB/sec)         | 60               | 120              | 200
Max Containers per Account      | 1,000            | 5,000            | 50,000
Max Blobs per Container         | Unlimited        | Unlimited        | Unlimited

  • Azure SQL Database Limits

    DTU Tier | Max DB Size | Max IOPS | Max Log Rate | Max Concurrent Workers
    ---------|-------------|----------|--------------|------------------------
    S0 (10)  | 250 GB      | 300      | 2.5 MB/s     | 60
    S3 (100) | 1 TB        | 2,000    | 25 MB/s      | 200
    P2 (250) | 4 TB        | 5,000    | 48 MB/s      | 400
    

  • Cosmos DB Limits

    Free: 1,000 RU/s max, 25 GB storage
    Pro: 10,000 RU/s default, 1 TB storage
    Enterprise: Autoscale 100,000 RU/s, 50 TB storage
    

Code Examples: - IOPS monitoring queries - Storage performance metrics - Autoscaling configurations

Diagrams: - Storage performance tiers - IOPS scaling strategy

Deliverables: - Storage performance guide - IOPS monitoring - Scaling triggers


CYCLE 5: Query & Export Limits (~3,500 lines)

Topic 9: Query Limits & Pagination

What will be covered: - Query Rate Limits | Edition | Queries/Minute | Concurrent Queries | Max Query Duration | |------------|----------------|--------------------|--------------------| | Free | 30 | 2 | 30 seconds | | Pro | 300 | 10 | 60 seconds | | Enterprise | 1,500 | 50 | 120 seconds |

  • Query Result Limits

    public class QueryLimits
    {
        public const int MaxResultsPerPage = 1000;
        public const int DefaultPageSize = 100;
        public const int MaxResponseSizeBytes = 25 * 1024 * 1024;  // 25 MB
        public const int MaxQueryComplexity = 100;  // Query cost units
        public const int MaxFilterFields = 50;
        public const int MaxSortFields = 10;
    }
    

  • Pagination Enforcement

    [HttpGet("api/v1/events")]
    public async Task<IActionResult> QueryEvents(
        [FromQuery] int page = 1,
        [FromQuery] int pageSize = 100)
    {
        // Enforce page size limit
        if (pageSize > QueryLimits.MaxResultsPerPage)
        {
            return BadRequest(new
            {
                Error = "PageSizeExceeded",
                Message = $"Page size ({pageSize}) exceeds maximum ({QueryLimits.MaxResultsPerPage})",
                MaxPageSize = QueryLimits.MaxResultsPerPage
            });
        }
    
        var results = await _queryService.QueryEventsAsync(page, pageSize);
    
        return Ok(new
        {
            Data = results.Items,
            Page = page,
            PageSize = pageSize,
            TotalResults = results.Total,
            TotalPages = (int)Math.Ceiling(results.Total / (double)pageSize)
        });
    }
    

  • Query Complexity Scoring

  • Base cost: 1 unit
  • Filter per field: +1 unit
  • Sort per field: +2 units
  • Full-text search: +10 units
  • Date range filter: +5 units
  • Aggregation: +20 units
  • Reject if total > MaxQueryComplexity

Code Examples: - Query rate limiting - Pagination implementation - Query complexity calculator - Response size enforcement

Diagrams: - Query rate limit flow - Pagination architecture - Complexity scoring algorithm

Deliverables: - Query limits enforcement - Pagination standards - Complexity scoring engine


Topic 10: Export Limits & Windows

What will be covered: - Export Quotas | Edition | Concurrent Exports | Export Bytes/Day | Max Export Size | Export Window | |------------|--------------------|------------------|-----------------|------------------| | Free | 1 | 10 GB | 5 GB | 24/7 (throttled) | | Pro | 3 | 100 GB | 50 GB | 24/7 | | Enterprise | 10 | 1 TB | 500 GB | 24/7 (priority) |

  • Export Window Enforcement

    public class ExportScheduler
    {
        private readonly ExportWindowConfig _config;
    
        public async Task<ExportJobResult> ScheduleExportAsync(ExportRequest request)
        {
            var tenantId = request.TenantId;
    
            // Check concurrent export limit
            var activeExports = await _exportRepo.GetActiveExportsAsync(tenantId);
            if (activeExports.Count >= GetConcurrentExportLimit(tenantId))
            {
                return ExportJobResult.Rejected("Concurrent export limit reached");
            }
    
            // Check daily export quota
            var todayUsage = await _exportMetrics.GetTodayExportBytesAsync(tenantId);
            var quota = await _quotaService.GetQuotasAsync(tenantId);
    
            if (todayUsage + request.EstimatedSizeBytes > quota.ExportBytesPerDayGB * 1024 * 1024 * 1024)
            {
                return ExportJobResult.Deferred("Daily export quota exceeded, try tomorrow");
            }
    
            // Check if in export window (2-6 AM local time for cost optimization)
            if (!IsInExportWindow() && !IsPriorityTenant(tenantId))
            {
                var nextWindow = GetNextExportWindowStart();
                return ExportJobResult.Deferred($"Export scheduled for next window at {nextWindow}");
            }
    
            // Schedule export
            var job = await _exportService.CreateExportJobAsync(request);
            return ExportJobResult.Scheduled(job);
        }
    }
    

  • Export Compression & Optimization

  • Compress exports with gzip (70-80% size reduction)
  • Delta exports (only changed records)
  • Filtered exports (specific date ranges, classifications)
  • Streaming exports (avoid full-file buffering)

Code Examples: - Export quota enforcement - Export window scheduling - Concurrent export management - Compression strategies

Diagrams: - Export scheduling flow - Export window timeline - Quota management

Deliverables: - Export scheduler - Quota enforcement - Optimization guide


CYCLE 6: Messaging Limits (~3,000 lines)

Topic 11: Azure Service Bus Limits

What will be covered: - Service Bus Quotas

Tier               | Max Message Size | Max Queue Size | Max Throughput | Max Connections
-------------------|------------------|----------------|----------------|------------------
Standard           | 256 KB           | 80 GB          | Limited        | 1,000
Premium (1 MU)     | 1 MB             | 1 TB           | High           | 10,000
Premium (4 MU)     | 1 MB             | 4 TB           | Very High      | 40,000

  • MassTransit Configuration

    {
      "MassTransit": {
        "AzureServiceBusTransport": {
          "AzureServiceBusHost": {
            "FullyQualifiedNamespace": "atp-prod.servicebus.windows.net",
            "UseManagedIdentity": true,
            "OperationTimeoutSeconds": 60,
            "RetryMinBackoff": 1,
            "RetryMaxBackoff": 30
          },
          "AzureServiceBusReceiveEndpoint": {
            "PrefetchCount": 256,           // Free: 8, Pro: 64, Enterprise: 256
            "ConcurrentMessageLimit": 512,  // Free: 16, Pro: 128, Enterprise: 512
            "MaxAutoLockRenewalDuration": "00:05:00",
            "LockDuration": "00:05:00"
          },
          "MaxMessageSize": 262144,         // 256 KB Standard, 1 MB Premium
          "RetryLimit": 5
        }
      }
    }
    

  • Message Size Limits

  • Standard Tier: 256 KB max (header + body)
  • Premium Tier: 1 MB max (header + body)
  • Batched messages: Sum of all messages < tier limit
  • Large payloads: Use claim-check pattern (store in Blob, reference in message)

Code Examples: - Service Bus configuration (all tiers) - Message size validation - Claim-check pattern implementation - Prefetch tuning

Diagrams: - Service Bus tiers comparison - Claim-check pattern flow - Message processing limits

Deliverables: - Service Bus configuration guide - Message size enforcement - Claim-check implementation


Topic 12: Message Throughput & Concurrency

What will be covered: - Throughput Limits

Tenant Edition | Messages/Second (Publish) | Messages/Second (Consume) | Queue Depth Warning
---------------|---------------------------|---------------------------|---------------------
Free           | 100                       | 50                        | 1,000
Pro            | 1,000                     | 500                       | 10,000
Enterprise     | 10,000                    | 5,000                     | 100,000

  • Concurrency Configuration
  • PrefetchCount: Messages fetched from broker ahead of consumption
  • ConcurrentMessageLimit: Max parallel message handlers
  • KEDA Autoscaling: Scale pods based on queue depth

  • Back-Pressure Handling

    public class MessageBackPressureHandler
    {
        public async Task<bool> CanPublishAsync(string tenantId)
        {
            var queueDepth = await _serviceBusMetrics.GetQueueDepthAsync(tenantId);
            var threshold = GetQueueDepthThreshold(tenantId);  // Free: 1K, Pro: 10K, Enterprise: 100K
    
            if (queueDepth > threshold)
            {
                _logger.LogWarning("Queue depth ({Depth}) exceeds threshold ({Threshold}) for tenant {TenantId}",
                    queueDepth, threshold, tenantId);
    
                // Throttle publisher
                return false;
            }
    
            return true;
        }
    }
    

Code Examples: - Throughput monitoring - Concurrency tuning - Back-pressure implementation - KEDA autoscaling configuration

Diagrams: - Message throughput flow - Concurrency vs. throughput - KEDA scaling behavior

Deliverables: - Throughput limits guide - Concurrency tuning - Back-pressure handling - Autoscaling config


CYCLE 7: Compute & Memory Limits (~3,000 lines)

Topic 13: Kubernetes Resource Limits

What will be covered: - Pod Resource Requests & Limits

apiVersion: v1
kind: Pod
metadata:
  name: atp-ingestion
spec:
  containers:
  - name: ingestion
    image: acr-atp-prod.azurecr.io/ingestion:1.0.0
    resources:
      requests:
        memory: "512Mi"
        cpu: "500m"
      limits:
        memory: "2Gi"
        cpu: "2000m"

  • Resource Quotas by Edition | Service | Free (requests/limits) | Pro (requests/limits) | Enterprise (requests/limits) | |-------------|------------------------|-----------------------|------------------------------| | Ingestion | 256Mi/1Gi, 250m/1 | 512Mi/2Gi, 500m/2 | 1Gi/4Gi, ¼ | | Query | 256Mi/1Gi, 250m/1 | 512Mi/2Gi, 500m/2 | 1Gi/4Gi, ¼ | | Projection | 512Mi/2Gi, 500m/2 | 1Gi/4Gi, ½ | 2Gi/8Gi, 2/8 | | Export | 1Gi/4Gi, 500m/2 | 2Gi/8Gi, ¼ | 4Gi/16Gi, 2/8 | | Integrity | 256Mi/1Gi, 250m/1 | 512Mi/2Gi, 500m/2 | 1Gi/4Gi, ¼ |

  • Namespace Resource Quotas

    apiVersion: v1
    kind: ResourceQuota
    metadata:
      name: tenant-quota
      namespace: atp-tenant-acme
    spec:
      hard:
        requests.cpu: "10"
        requests.memory: "20Gi"
        limits.cpu: "20"
        limits.memory: "40Gi"
        pods: "50"
        services: "10"
    

Code Examples: - Pod resource specifications - Namespace quotas - Resource monitoring - OOMKilled handling

Diagrams: - Resource request/limit hierarchy - Namespace quota enforcement - Pod eviction flow

Deliverables: - Resource specifications (all services) - Namespace quota templates - Monitoring dashboards


Topic 14: Concurrency & Connection Limits

What will be covered: - Database Connection Pools

{
  "ConnectionStrings": {
    "AuditDb": "Server=...;Max Pool Size=100;Min Pool Size=10;Connect Timeout=30;"
  }
}

Edition Max DB Connections Connection Timeout Command Timeout
Free 10 30 sec 30 sec
Pro 50 60 sec 60 sec
Enterprise 200 90 sec 120 sec
  • HTTP Client Limits
  • Max connections per endpoint: 100 (Free), 500 (Pro), 2000 (Enterprise)
  • Connection timeout: 30 seconds
  • Request timeout: 60 seconds
  • Retry policy: 3 retries with exponential backoff

Code Examples: - Connection pool configuration - HTTP client setup - Timeout handling - Retry policies

Diagrams: - Connection pool architecture - Timeout cascade prevention

Deliverables: - Connection pool guide - HTTP client configuration - Timeout strategies


CYCLE 8: Azure Service Limits (~4,000 lines)

Topic 15: Azure SQL & Cosmos DB Limits

What will be covered: - Azure SQL Database Limits

Service Tier    | Max DB Size | Max DTU/vCore | Max IOPS | Max Log Rate | Max Sessions
----------------|-------------|---------------|----------|--------------|---------------
Basic           | 2 GB        | 5 DTU         | 300      | 2.5 MB/s     | 30
Standard S3     | 1 TB        | 100 DTU       | 2,000    | 25 MB/s      | 200
Premium P2      | 4 TB        | 250 DTU       | 5,000    | 48 MB/s      | 400
Hyperscale      | 100 TB      | Variable      | Variable | Variable     | 1,600

  • Cosmos DB Limits
    Metric                     | Limit
    ---------------------------|------------------
    Max RU/s per container     | 1,000,000 (manual), unlimited (autoscale)
    Max storage per container  | Unlimited
    Max item size              | 2 MB
    Max items per query        | Unlimited (paginated)
    Max query complexity       | No hard limit (timeout-based)
    Max indexing paths         | 500
    

Code Examples: - DTU monitoring - RU consumption tracking - Autoscaling configuration - Partition key design

Diagrams: - SQL DTU tiers - Cosmos DB RU model - Autoscaling behavior

Deliverables: - Azure SQL limits reference - Cosmos DB limits reference - Monitoring queries


Topic 16: Azure Storage & Networking Limits

What will be covered: - Blob Storage Limits

Metric                          | Standard | Premium
--------------------------------|----------|----------
Max storage account size        | 5 PB     | 35 TB
Max blob size (block blob)      | ~4.75 TB | ~4.75 TB
Max block size                  | 4,000 MB | 4,000 MB
Max IOPS per blob               | 500      | 100,000
Max throughput per blob         | 60 MB/s  | 200 GB/s
Max request rate (per account)  | 20,000   | 100,000

  • Azure Front Door Limits
    Resource                    | Limit
    ----------------------------|----------
    Max rules per Front Door    | 100
    Max origins per origin group| 100
    Max routes                  | 100
    Max requests/second         | 250,000 (Standard), 1,000,000 (Premium)
    Max bandwidth               | 100 Gbps
    

Code Examples: - Storage performance monitoring - AFD configuration - Throttling detection

Diagrams: - Storage tier comparison - AFD architecture

Deliverables: - Complete Azure service limits catalog - Monitoring dashboards - Throttling handlers


CYCLE 9: Per-Tenant Quotas by Edition (~4,000 lines)

Topic 17: Complete Edition Quota Matrix

What will be covered: - Comprehensive Quota Table | Resource Category | Metric | Free | Pro | Enterprise | |--------------------------|----------------------------|------------|------------|-------------| | API Access | Requests/minute | 60 | 600 | 3,000 | | | Concurrent requests | 5 | 50 | 200 | | | Request timeout | 30 sec | 60 sec | 120 sec | | Ingestion | Events/second | 10 | 100 | 500 | | | Events/day | 864,000 | 8,640,000 | 43,200,000 | | | Batch size (events) | 100 | 1,000 | 10,000 | | | Event size | 256 KB | 256 KB | 1 MB | | Storage | Total storage (GB) | 10 | 500 | 5,000+ | | | HOT retention (days) | 7-30 | 7-90 | 7-365 | | | WARM retention (days) | 30 | 365 | 730 | | | COLD retention (days) | N/A | 365-730 | 730-2,555 | | Query | Queries/minute | 30 | 300 | 1,500 | | | Result page size | 100 | 1,000 | 10,000 | | | Max query duration | 30 sec | 60 sec | 120 sec | | | Concurrent queries | 2 | 10 | 50 | | Export | Concurrent exports | 1 | 3 | 10 | | | Export bytes/day (GB) | 10 | 100 | 1,000+ | | | Max export size (GB) | 5 | 50 | 500 | | | Export compression | gzip | gzip | gzip/brotli | | Webhooks | Active subscriptions | 1 | 5 | 20 | | | Delivery attempts | 3 | 5 | 10 | | | Webhook log retention | 7 days | 30 days | 90 days | | | Webhooks/hour | 60 | 600 | 3,000 | | Search | Full-text search | ❌ | ✅ | ✅ | | | Advanced search | ❌ | ✅ | ✅ | | | Semantic search | ❌ | ❌ | ✅ | | Integrity | Integrity verification | ❌ | ❌ | ✅ | | | Merkle tree proofs | ❌ | ❌ | ✅ | | | Timestamp anchoring | ❌ | ❌ | ✅ | | Observability | Log retention | 7 days | 30 days | 90 days | | | Metrics retention | 30 days | 90 days | 365 days | | | Trace sampling | 0% | 10% | 100% | | Support | Support tier | Community | Business | Premium | | | SLA | Best-effort| 99.5% | 99.9% | | | Response time | 48 hours | 8 hours | 1 hour |

Code Examples: - Quota resolution by edition - Quota override mechanism - Quota enforcement middleware

Diagrams: - Edition comparison matrix - Quota inheritance hierarchy

Deliverables: - Complete quota matrix - Edition comparison tool - Quota calculator


Topic 18: Quota Management & Overrides

What will be covered: - Quota Override System

public class TenantQuotaOverride
{
    public string TenantId { get; set; }
    public string QuotaKey { get; set; }  // e.g., "ApiRateLimit", "StorageQuotaGB"
    public long OverrideValue { get; set; }
    public string Reason { get; set; }
    public DateTime EffectiveFrom { get; set; }
    public DateTime? ExpiresAt { get; set; }
    public string ApprovedBy { get; set; }
}

public async Task<TenantQuotas> GetEffectiveQuotasAsync(string tenantId)
{
    // 1. Get base quotas from edition
    var edition = await _tenantService.GetEditionAsync(tenantId);
    var baseQuotas = GetEditionBaseQuotas(edition);

    // 2. Apply tenant-specific overrides
    var overrides = await _quotaOverrideRepo.GetActiveOverridesAsync(tenantId);
    foreach (var override in overrides)
    {
        ApplyOverride(baseQuotas, override);
    }

    return baseQuotas;
}

  • Temporary Quota Increases
  • Request via support ticket
  • Approval from customer success manager
  • Time-bound (e.g., 7-30 days)
  • Automatic expiration and rollback

  • Permanent Quota Changes

  • Edition upgrade (Free → Pro → Enterprise)
  • Custom contract (Enterprise+)
  • Configuration deployment (Pulumi update)

Code Examples: - Quota override system - Temporary increase management - Edition upgrade flow

Diagrams: - Quota override workflow - Approval process

Deliverables: - Quota override system - Management UI/API - Approval workflow


CYCLE 10: Monitoring & Alerting (~3,000 lines)

Topic 19: Quota Usage Monitoring

What will be covered: - Real-Time Usage Tracking

// Current storage usage per tenant
AuditStorageMetrics
| where TimeGenerated > ago(5m)
| extend TenantId = tostring(customDimensions.TenantId)
| extend StorageGB = todouble(customDimensions.StorageGB)
| summarize CurrentStorage = max(StorageGB) by TenantId
| join kind=inner (TenantQuotas | project TenantId, StorageQuota = StorageQuotaGB) on TenantId
| extend PercentageUsed = (CurrentStorage * 100.0) / StorageQuota
| where PercentageUsed > 80
| order by PercentageUsed desc

  • Usage Dashboards
  • Per-tenant quota usage (API, storage, export)
  • Usage trends over time
  • Quota utilization heat map
  • Top consumers by resource type

  • Predictive Alerting

  • Linear regression on usage trends
  • Predict quota exhaustion date
  • Alert when estimated exhaustion < 7 days
  • Proactive upgrade recommendations

Code Examples: - Usage tracking queries (all quota types) - Dashboard JSON templates - Predictive analytics - Trend analysis

Diagrams: - Usage dashboard layout - Predictive alerting flow

Deliverables: - Monitoring query library - Dashboard templates - Predictive alerting


Topic 20: Alert Rules & Notifications

What will be covered: - Alert Thresholds

Threshold | Action                  | Recipient
----------|-------------------------|------------
80%       | Warning email           | Tenant admin
90%       | Critical email + banner | Tenant admin + CSM
95%       | Urgent email            | Tenant admin + CSM + Support
100%      | Service degradation     | All stakeholders

  • Alert Configuration
    alerts:
      - name: StorageQuotaWarning
        condition: storage_usage_percent > 80
        severity: Warning
        frequency: 1h
        recipients:
          - tenant_admin
        actions:
          - send_email
          - log_to_telemetry
    
      - name: StorageQuotaExceeded
        condition: storage_usage_percent >= 100
        severity: Critical
        frequency: 5m
        recipients:
          - tenant_admin
          - customer_success_manager
          - support_team
        actions:
          - send_email
          - send_sms
          - create_incident
          - block_ingestion
    

Code Examples: - Alert rule configurations (all quota types) - Notification templates - Escalation workflows

Diagrams: - Alert escalation flow - Notification channels

Deliverables: - Alert rule library - Notification templates - Escalation procedures


CYCLE 11: Scaling Strategies (~3,000 lines)

Topic 21: Horizontal & Vertical Scaling

What will be covered: - Horizontal Scaling (Scale Out) - Add more pods/instances - KEDA autoscaling based on metrics - Kubernetes HPA (Horizontal Pod Autoscaler) - Azure App Service scaling plans

  • Vertical Scaling (Scale Up)
  • Increase CPU/memory per pod
  • Upgrade Azure service tiers (DTU, RU/s)
  • Premium storage tiers
  • Requires downtime or rolling update

  • Autoscaling Triggers

    apiVersion: keda.sh/v1alpha1
    kind: ScaledObject
    metadata:
      name: ingestion-scaler
    spec:
      scaleTargetRef:
        name: ingestion
      minReplicaCount: 2
      maxReplicaCount: 50
      triggers:
      - type: azure-servicebus
        metadata:
          queueName: ingestion-queue
          messageCount: "100"
          namespace: atp-prod
      - type: cpu
        metadataRef:
          name: cpu-trigger
          threshold: "80"
    

Code Examples: - KEDA autoscaling configuration - HPA setup - Scaling strategies per service

Diagrams: - Horizontal vs. vertical scaling - KEDA autoscaling flow

Deliverables: - Scaling strategy guide - Autoscaling configurations - Capacity planning


Topic 22: Capacity Planning & Forecasting

What will be covered: - Growth Projections - Historical usage trends - Seasonality patterns - Customer acquisition forecasts - Feature adoption rates

  • Capacity Thresholds

    Resource            | Current Capacity | Utilization Target | Scale Trigger
    --------------------|------------------|--------------------|--------------
    Ingestion Pods      | 10               | 70%                | CPU > 70%
    Query Replicas      | 5                | 60%                | Queue > 1000
    Storage (TB)        | 50               | 80%                | Usage > 40 TB
    Service Bus MUs     | 4                | 75%                | Throughput > 3 MU
    SQL DTUs            | 1000             | 70%                | DTU% > 70%
    

  • Cost-Aware Scaling

  • Prefer horizontal scaling (cheaper)
  • Scale down during off-peak
  • Reserved instances for baseline
  • Spot instances for burst capacity

Code Examples: - Capacity forecasting models - Cost optimization scripts - Scaling automation

Diagrams: - Capacity growth timeline - Cost-aware scaling strategy

Deliverables: - Capacity planning templates - Forecasting models - Cost optimization guide


CYCLE 12: Cost Optimization (~3,000 lines)

Topic 23: Cost-Aware Quota Design

What will be covered: - Cost Drivers by Resource | Resource | Cost Driver | Optimization Strategy | |-----------------------|----------------------|--------------------------------------| | Blob Storage (HOT) | GB stored × days | Lifecycle to WARM/COLD | | Azure SQL | DTU-hours | Right-size DTUs, autoscale | | Service Bus Premium | Messaging Units | Consolidate topics, tune prefetch | | Export Egress | GB transferred | Export windows, compression | | Azure Monitor | GB ingested | Sampling, field filtering | | Cosmos DB | RU/s provisioned | Autoscale, optimize queries |

  • Quota-Based Cost Control
  • Enforce export windows (2-6 AM local) to avoid peak egress costs
  • Limit trace sampling (Free: 0%, Pro: 10%, Enterprise: 100%)
  • Storage lifecycle automation (HOT → WARM → COLD)
  • Cap concurrent operations (reduce DTU/RU spikes)

  • Cost Allocation Tags

    tags:
      environment: production
      product: audit-trail
      tenantId: acme-corp
      edition: enterprise
      costCenter: engineering
    

Code Examples: - Cost tracking queries - Budget alert configuration - Cost allocation tagging

Diagrams: - Cost breakdown by resource - Cost optimization workflow

Deliverables: - Cost optimization playbook - Budget alert templates - Cost allocation strategy


Topic 24: Edition Pricing & Cost Recovery

What will be covered: - Cost-Based Pricing Model | Edition | Base Cost/Month | Included Quotas | Overage Costs | |------------|-----------------|------------------------|------------------------| | Free | $0 | As per quota matrix | Not available | | Pro | $299/month | As per quota matrix | $0.10/GB storage | | Enterprise | $2,999/month | As per quota matrix | $0.05/GB storage |

  • Overage Billing
  • Storage: $0.10/GB/month (Pro), $0.05/GB/month (Enterprise)
  • API calls: $5 per 1M requests (Pro), $2 per 1M (Enterprise)
  • Export egress: $0.15/GB (Pro), $0.10/GB (Enterprise)

  • Cost Transparency

  • Monthly usage reports per tenant
  • Real-time cost estimator in dashboard
  • Projected month-end costs

Code Examples: - Cost calculator - Overage billing system - Usage report generator

Diagrams: - Pricing tier comparison - Overage billing flow

Deliverables: - Pricing model - Billing system - Usage reports


CYCLE 13: Quota Management & Governance (~2,500 lines)

Topic 25: Quota Governance Framework

What will be covered: - Quota Change Approval Process 1. Tenant requests quota increase (support ticket) 2. Customer Success Manager reviews usage patterns 3. Engineering validates capacity impact 4. Finance approves cost implications 5. Platform Engineer applies override 6. Tenant notified of approval/rejection

  • Exception Handling
  • Emergency quota increases (on-call approval)
  • Time-bound exceptions (7-30 days)
  • Compliance-driven exceptions (regulatory requirements)
  • Performance testing exceptions (temporary unlimited)

  • Quota Audit Trail

    public class QuotaAuditLog
    {
        public DateTime Timestamp { get; set; }
        public string TenantId { get; set; }
        public string QuotaKey { get; set; }
        public long PreviousValue { get; set; }
        public long NewValue { get; set; }
        public string Reason { get; set; }
        public string ApprovedBy { get; set; }
        public string ChangeType { get; set; }  // Increase, Decrease, Override, Reset
    }
    

Code Examples: - Approval workflow - Exception handling - Audit trail implementation

Diagrams: - Quota change approval flow - Exception handling process

Deliverables: - Governance framework - Approval workflows - Audit trail system


Topic 26: Quota Review & Evolution

What will be covered: - Quarterly Quota Review - Analyze quota utilization trends - Identify under-utilized quotas (increase) - Identify over-utilized quotas (review pricing) - Customer feedback on quota pain points

  • Quota Evolution Roadmap
  • Phase 1 (Q1 2026): Baseline quotas (current)
  • Phase 2 (Q2 2026): Introduce burst quotas (+20% temporary)
  • Phase 3 (Q3 2026): Dynamic quotas based on usage patterns
  • Phase 4 (Q4 2026): AI-driven quota optimization

  • Competitive Benchmarking

  • Compare ATP quotas with competitors
  • Adjust to market standards
  • Differentiate on high-value features

Code Examples: - Quota analysis queries - Evolution tracking - Competitive comparison

Diagrams: - Quota evolution timeline - Competitive benchmarking

Deliverables: - Quarterly review process - Evolution roadmap - Benchmarking reports


CYCLE 14: Troubleshooting & Best Practices (~3,000 lines)

Topic 27: Troubleshooting Quota Issues

What will be covered: - Common Quota Problems - Problem: 429 Too Many Requests - Cause: API rate limit exceeded - Solution: Implement exponential backoff, request quota increase - Debug: Check X-RateLimit headers, review usage patterns

  • Problem: Storage quota exceeded

    • Cause: Retention policy too long, no lifecycle automation
    • Solution: Enable lifecycle policies, archive old data
    • Debug: Query storage metrics, identify large tenants
  • Problem: Export quota exhausted

    • Cause: Too many large exports
    • Solution: Schedule exports in off-peak, enable compression
    • Debug: Review export sizes, optimize queries
  • Problem: Message queue depth growing

    • Cause: Consumers not keeping up with producers
    • Solution: Scale consumers (KEDA), optimize processing
    • Debug: Monitor queue metrics, check consumer errors
  • Quota Debugging Tools

    # Check current quota usage
    curl -H "Authorization: Bearer $TOKEN" \
      https://api.audit.connectsoft.io/v1/tenants/{tenantId}/quotas
    
    # Get quota history
    curl -H "Authorization: Bearer $TOKEN" \
      https://api.audit.connectsoft.io/v1/tenants/{tenantId}/quotas/history
    
    # Request quota increase
    curl -X POST -H "Authorization: Bearer $TOKEN" \
      -d '{"quotaKey": "ApiRateLimit", "requestedValue": 1200, "reason": "Black Friday traffic"}' \
      https://api.audit.connectsoft.io/v1/tenants/{tenantId}/quotas/increase-request
    

Code Examples: - Troubleshooting utilities - Quota debugging API - Common fixes

Diagrams: - Troubleshooting decision tree - Debug workflow

Deliverables: - Troubleshooting guide - Debug tools - Common problems catalog


Topic 28: Quota Best Practices

What will be covered: - Design Best Practices - ✅ Monitor Early: Track usage at 80%, not 100% - ✅ Fail Gracefully: Return 429 with Retry-After, not 500 - ✅ Burst Tolerance: Allow brief spikes (token bucket) - ✅ Cost-Aware: Design quotas aligned with cost drivers - ✅ Edition Alignment: Higher editions = higher quotas - ✅ Transparent: Show usage and limits in dashboard - ✅ Predictable: Time-based resets (minute, hour, day) - ✅ Auditable: Log all quota changes and exceptions

  • Implementation Best Practices
  • ✅ Use distributed rate limiting (Redis)
  • ✅ Cache quota lookups (reduce database load)
  • ✅ Implement circuit breakers (prevent cascading failures)
  • ✅ Test quota enforcement (chaos testing)
  • ✅ Document quota limits (OpenAPI, SDKs)
  • ✅ Provide upgrade paths (in-app prompts)

  • Operational Best Practices

  • ✅ Review quotas quarterly
  • ✅ Automate overage billing
  • ✅ Track quota-related support tickets
  • ✅ Benchmark against competitors
  • ✅ Collect customer feedback
  • ✅ Plan for growth (capacity planning)

Code Examples: - Best practice implementations - Testing strategies - Automation scripts

Diagrams: - Best practices checklist - Implementation patterns

Deliverables: - Best practices handbook - Implementation templates - Review checklists


Summary of Deliverables

Across all 14 cycles, this documentation will provide:

  1. Philosophy & Architecture
  2. Limits & quotas philosophy
  3. Quota management architecture
  4. Enforcement mechanisms

  5. Rate Limiting

  6. API rate limiting (all strategies)
  7. Ingestion rate limits
  8. Monitoring and alerting

  9. Resource Limits

  10. Storage quotas and capacity
  11. Query and export limits
  12. Messaging throughput limits
  13. Compute and memory constraints

  14. Azure Services

  15. Complete Azure service limits catalog
  16. SQL, Cosmos DB, Storage, Networking limits
  17. Performance and IOPS limits

  18. Edition Quotas

  19. Complete per-tenant quota matrix
  20. Quota override system
  21. Edition comparison tools

  22. Operations

  23. Real-time monitoring and alerting
  24. Scaling strategies and autoscaling
  25. Cost optimization playbooks

  26. Governance & Troubleshooting

  27. Quota governance framework
  28. Troubleshooting guides
  29. Best practices and patterns


This documentation plan covers complete limits, quotas, and resource constraints for ATP, from API rate limiting and storage capacity to Azure service limits, per-tenant quotas by edition, monitoring, scaling strategies, cost optimization, governance, and troubleshooting, ensuring fair resource allocation, cost predictability, and system stability across all environments.