Non-Functional Requirements

NFR-001: Performance Targets

Priority: HIGH
Owner: Technical Architect

Performance Metrics

MetricTargetMeasurementTest Scenario
Monthly throughput10M invoicesApplication InsightsProduction monitoring
100K batch processing< 2 hoursTimestamp diffLoad test TC-200
API response (p50)< 200msApplication InsightsLoad test TC-201
API response (p95)< 500msApplication InsightsLoad test TC-202
API response (p99)< 1000msApplication InsightsLoad test TC-203
PDF generation (p95)< 5 seconds/invoiceCustom metricRender test TC-204
Handlebars render (p95)< 2 seconds/invoiceCustom metricRender test TC-205
Queue processing lag< 5 minutesQueue depth / throughputQueue monitoring
Database query (p95)< 100msPostgreSQL slow query logQuery analysis
ParserService (10K batch)< 2 minutesParse durationParser test TC-206

Load Testing Scenarios

Scenario 1: Steady State (Normal Month)

  • Duration: 24 hours
  • Load: 333K invoices evenly distributed
  • Concurrent batches: 5-10
  • Expected: All targets met, no errors

Scenario 2: Peak Load (Heating Season)

  • Duration: 8 hours
  • Load: 314K invoices (first week concentration)
  • Concurrent batches: 20+
  • Expected: 2-hour SLA met, >99% success

Scenario 3: Spike Test

  • Duration: 30 minutes
  • Load: 10 batches (50K invoices) uploaded simultaneously
  • Expected: Auto-scales, processes without degradation

Acceptance Criteria

#CriterionValidationTarget
1100K batch completionEnd-to-end test≤ 2 hours
2API latency under load1000 RPS testp95 ≤ 500ms
310M monthly capacityProduction monitoring≥ 10M in peak month
450-org performance50 concurrent uploadsAll SLAs met
5Worker auto-scalingMonitor queue during peaksLag ≤ 5 min
6PDF generation performance1000 PDFsp95 ≤ 5 seconds

NFR-002: Scalability & Auto-Scaling

Priority: HIGH
Owner: Technical Architect

Scaling Configuration

ComponentMinMaxTriggerThresholdScale UpScale Down
CoreApiService520CPU OR Request Rate70% OR 1000 RPS2 min10 min
ParserService210Queue Length>01 min5 min
DocumentGenerator2100Queue Length>321 min5 min
EmailService550Queue Length>501 min5 min
PostalService13Scheduled12:00, 20:00 CETN/AAfter completion

Peak Load Capacity

Normal Load (non-heating, mid-month):

  • 333K invoices/day average
  • 5-10 concurrent batches
  • Worker instances: 10-20 total

Peak Load (heating season, first/last week):

  • 2.2M invoices/week
  • 314K invoices/day
  • 20+ concurrent batches
  • Worker instances: 80-100 total

Pre-Warming Strategy (Heating Season)

Monthly Schedule:
- Day 1-7: Pre-warm to 50 instances at 00:00
- Day 8-23: Scale based on queue (2-20 instances)
- Day 24-31: Pre-warm to 50 instances at 00:00

Heating Season (Oct-Mar): Double levels
- Day 1-7: Pre-warm to 80 instances
- Day 24-31: Pre-warm to 80 instances

NFR-003: Availability & Reliability

Priority: HIGH
Owner: Technical Architect

Availability Targets

MetricTargetAllowed DowntimeMeasurement
System Uptime99.9%43 min/monthAzure Monitor
Batch Success Rate>99.5%50 failures per 10KProcessing logs
Delivery Success Rate>98%200 failures per 10KDelivery tracking
API Availability99.9%43 min/monthHealth checks
MTTR<30 minutesN/AIncident timestamps
MTBF>720 hoursN/AIncident tracking

Multi-Region Deployment

Primary Region: West Europe (Sweden, Denmark)
Secondary Region: North Europe (Norway, Finland)

Traffic Routing:

  • Azure Traffic Manager (Performance routing)
  • Health check: /health every 30 seconds
  • Auto-failover: 3 consecutive failures
  • Failover time: <2 minutes

NFR-004: Security Requirements

Priority: CRITICAL
Owner: Technical Architect

Authentication & Authorization

OAuth 2.0:

  • Grant Type: Client Credentials
  • Token Provider: Microsoft Entra ID
  • Token Lifetime: 1 hour
  • Algorithm: RS256

Roles:

  1. Super Admin (global)
  2. Organization Admin (single org)
  3. Template Admin (single org)
  4. Batch Operator (single org)
  5. Read-Only User (single org)
  6. API Client (single org)

Encryption

In Transit:

  • TLS 1.3 minimum
  • HSTS enabled

At Rest:

  • Blob Storage: AES-256
  • PostgreSQL: AES-256
  • Backups: AES-256

NFR-005: Data Retention

Priority: HIGH
Owner: Legal/Compliance

Data TypeRetentionStorage Tier Transitions
Invoices (PDF/HTML/JSON)7 yearsDay 0-365: Hot
Day 366-2555: Cool
Day 2556+: Archive
Batch Source (XML)90 daysDay 0-30: Hot
Day 31-90: Cool
Day 91+: Delete
Audit Logs7 yearsYear 0-1: PostgreSQL
Year 1-7: Blob (compressed)
Application Logs90 daysApplication Insights

Approval Section

Stakeholder Sign-Off

Stakeholder RoleNameSignatureDateStatus
Product Owner


☐ PENDING
Technical Architect


☐ PENDING

Approval Criteria

  •  All CRITICAL requirements reviewed and accepted
  •  All HIGH requirements reviewed and accepted
  •  All dependencies identified and acknowledged
  •  All risks reviewed with mitigation strategies
  •  All acceptance criteria defined and measurable
  •  Budget and timeline implications understood
  •  Resource allocation confirmed
  •  Compliance requirements validated (GDPR, Bokföringslagen)

Change Control

Any changes to approved CRITICAL or HIGH priority requirements must follow the change control process:

  1. Document proposed change in Jira (tag with egflow version)
  2. Impact assessment (scope, timeline, cost)
  3. Re-approval by Product Owner and Technical Architect
  4. Update this document with version increment
  5. Communicate changes to development team
  6. Update affected Jira issues with new fixVersion

Version History

VersionDateAuthorChangesRelease Target
1.02025-11-20Product OwnerInitial draftegflow-1.0.0
1.12025-11-21Product OwnerAdded FR-003 details, updated acceptance criteriaegflow-1.0.0
1.22025-11-27Product OwnerUpdated versioning strategy to match Gasell modelegflow-1.0.0 "Corny Flamingo"


  • No labels