Skip to main content

QR Code Generation: Technology Decision

Research & Decision Required

This document outlines the decision between QR Tiger API (cloud service) vs QRCoder (open-source library) for QR code generation in Epic 2.

Status: Pending decision before Epic 2 implementation


Options Overview

Option 1: QR Tiger API (Cloud Service)

What it is: Third-party cloud API for QR code generation

Pros:

  • ✅ Managed service (no maintenance)
  • ✅ Highly reliable and tested
  • ✅ Professional support
  • ✅ Guaranteed uptime and SLA
  • ✅ Scalable without server resources

Cons:

  • ❌ Ongoing API costs
  • ❌ Rate limits based on plan
  • ❌ External dependency (service could go down)
  • ❌ Privacy concerns (sending data to third party)
  • ❌ Requires API key management
  • ❌ Network latency for API calls

Cost: Varies by plan (see QR Tiger pricing)

Documentation: QR Tiger API (Option 1)


Option 2: QRCoder (Open Source Library)

What it is: Open-source .NET library for generating QR codes

GitHub: https://github.com/Shane32/QRCoder

Pros:

  • Zero cost (MIT license)
  • No rate limits
  • No external dependencies (self-hosted)
  • Fast (no network calls)
  • Privacy (data never leaves our servers)
  • ✅ PNG format support (our required format)
  • ✅ Full control over implementation
  • ✅ Cross-platform (.NET 5+, .NET Framework 3.5+)
  • ✅ Supports all error correction levels (L, M, Q, H)
  • ✅ Active maintenance and community support

Cons:

  • Community-maintained (not a commercial product)
  • ❌ We're responsible for maintenance/updates
  • ❌ No professional support or SLA
  • ❌ Uses server CPU/memory resources
  • ❌ Need to handle our own error scenarios

Cost: Free (MIT license)

Technical Specs:

  • Format: PNG only (our requirement)
  • Error Correction: L (7%), M (15%), Q (25%), H (30%)
  • .NET Support: .NET 5+, .NET Framework 3.5+, .NET Core 1.0+
  • Dependencies: Zero (beyond framework)
  • Cross-platform: Yes

Evaluation Questions

1. Technical Requirements

Q1.1: What QR code format do we need?

  • PNG only (for web display, download, and printing)

Current Answer: PNG only (500x500px) - No other formats needed

QRCoder Support: ✅ Yes - PngByteQRCode


Q1.2: What error correction level do we need?

  • L (7% damage tolerance)
  • M (15% damage tolerance)
  • Q (25% damage tolerance)
  • H (30% damage tolerance) - Recommended for printing

Current Answer: H (30%) for printing use cases

QRCoder Support: ✅ Yes - All levels (L, M, Q, H)


Q1.3: What QR code size do we need?

  • Fixed size (e.g., 500x500px)
  • Multiple sizes (responsive)
  • Custom sizes per use case

Current Answer: 500x500px minimum for printing

QRCoder Support: ✅ Yes - Configurable pixel size


Q1.4: Do we need any special QR features?

  • Custom colors/branding
  • Logo overlay
  • Custom shapes
  • Analytics/scan tracking
  • Dynamic QR codes (changeable destination)

Current Answer: None for MVP

QRCoder Support: ⚠️ Partial - Basic generation only, no branding/analytics


2. Cost & Scale

Q2.1: What is our expected QR code generation volume?

PeriodEstimated VolumeQR Tiger CostQRCoder Cost
Month 1_____ QR codes$_____$0
Month 6_____ QR codes$_____$0
Year 1_____ QR codes$_____$0

Notes: Consider API tier limits and overage costs for QR Tiger


Q2.2: What is our budget for QR code generation?

  • Unlimited budget (cost not a concern)
  • Limited budget (need to minimize costs)
  • No budget (must be free)

Current Answer: _________________


Q2.3: Are we willing to pay for guaranteed uptime and SLA?

  • Yes - reliability is critical
  • No - we can handle occasional issues
  • Depends on cost vs risk

Current Answer: _________________


3. Performance & Reliability

Q3.1: What is acceptable QR generation time?

  • Less than 100ms (instant)
  • Less than 500ms (fast)
  • Less than 2 seconds (acceptable)
  • More than 2 seconds is ok

Performance Comparison:

  • QRCoder: ~10-50ms (local generation, no network)
  • QR Tiger API: ~1-2 seconds (includes network call + API processing)

Q3.2: How critical is QR code generation to our user flow?

  • Critical - Users can't proceed without QR code
  • Important - Users should get QR code but can work without it
  • Optional - Nice to have feature

Current Answer: Important (audio still works if QR fails)

Impact:

  • If critical → QRCoder (no external dependency)
  • If important/optional → Either option viable

Q3.3: Can we handle QR generation failures gracefully?

  • Yes - we can show audio without QR code
  • No - QR code is mandatory

Current Answer: Yes (Epic 1 works without QR codes)


4. Maintenance & Operations

Q4.1: Do we have .NET development expertise to maintain QRCoder?

  • Yes - we can update/debug library issues
  • No - prefer managed service

Current Answer: _________________


Q4.2: Are we comfortable with community-maintained libraries?

  • Yes - MIT license, active community is sufficient
  • No - prefer commercial support
  • Depends on library maturity

QRCoder Stats (as of 2025):

  • ⭐ GitHub Stars: Check current count
  • 🔧 Last Updated: Active (2025)
  • 📦 NuGet Downloads: Check current count
  • 📝 License: MIT
  • 👥 Maintenance: Community + Shane32 (active maintainer)

Q4.3: What happens if QRCoder is abandoned?

  • We fork and maintain it ourselves
  • We migrate to another library
  • We switch to cloud service
  • This is acceptable risk

Current Answer: _________________


Q4.4: Can our servers handle QR generation load?

  • Yes - we have sufficient CPU/memory
  • No - prefer offloading to external service
  • Need to measure

Resource Requirements (QRCoder):

  • CPU: ~5-10ms per QR code
  • Memory: Minimal (less than 1MB per generation)
  • Disk: None (generated in memory)

5. Privacy & Security

Q5.1: Are we comfortable sending playback URLs to third-party API?

  • Yes - URLs are public anyway
  • No - prefer keeping all data in-house
  • Depends on data sensitivity

Data Shared with QR Tiger:

  • Playback URL (e.g., https://micdots.com/play/slug-123)
  • Generation timestamp (implicit)
  • API key (for authentication)

Q5.2: Do we have data residency or compliance requirements?

  • Yes - data must stay in our infrastructure
  • No - third-party services are acceptable
  • Unsure - need legal review

Current Answer: _________________


6. Future Requirements

Q6.1: Will we need QR code analytics in the future?

  • Yes - tracking scans is important
  • No - basic generation is sufficient
  • Maybe - not sure yet

Notes:

  • QR Tiger offers scan analytics (paid feature)
  • QRCoder has no built-in analytics (need custom tracking)

Q6.2: Will we need dynamic QR codes (changeable destinations)?

  • Yes - need to update where QR codes point
  • No - QR codes are permanent
  • Maybe - not sure yet

Notes:

  • QR Tiger supports dynamic QR codes
  • QRCoder generates static QR codes only

Q6.3: Will we need custom branding (colors, logos)?

  • Yes - brand consistency is important
  • No - standard black/white QR codes are fine
  • Maybe - future enhancement

Notes:

  • QR Tiger offers branded QR codes (paid feature)
  • QRCoder basic generation only (would need custom implementation)

Decision Matrix

CriteriaWeightQR TigerQRCoderNotes
CostHigh⚠️ 3/10 (ongoing costs)✅ 10/10 (free)Budget impact
PerformanceHigh⚠️ 6/10 (1-2s latency)✅ 10/10 (under 50ms)User experience
ReliabilityHigh✅ 9/10 (SLA backed)⚠️ 7/10 (self-managed)Service quality
PrivacyMedium⚠️ 6/10 (third party)✅ 10/10 (in-house)Data control
MaintenanceMedium✅ 9/10 (managed)⚠️ 6/10 (self-maintained)Operational burden
FeaturesLow✅ 8/10 (analytics, dynamic)⚠️ 6/10 (basic only)Future needs
ScalabilityMedium✅ 9/10 (automatic)✅ 8/10 (server-dependent)Growth handling

Scoring Guide: 1 (Poor) - 10 (Excellent)


Choose QR Tiger API if:

  1. ✅ Budget allows for ongoing API costs
  2. ✅ Need guaranteed uptime with SLA
  3. ✅ Want professional support
  4. ✅ Need analytics or dynamic QR codes
  5. ✅ Prefer minimal maintenance burden
  6. ✅ Don't want to manage library updates

Choose QRCoder if:

  1. Zero cost is priority (no budget for API)
  2. Need fastest possible generation (under 50ms)
  3. ✅ Privacy/data residency is important
  4. ✅ Have .NET development expertise
  5. ✅ Comfortable with community libraries
  6. ✅ Only need basic QR code generation
  7. ✅ Want no external dependencies/rate limits

Implementation Comparison

QR Tiger Implementation Effort

Complexity: Medium

Steps:

  1. Sign up for QR Tiger account
  2. Configure API key in environment
  3. Implement API client with retry logic
  4. Download QR image from API
  5. Upload to S3
  6. Handle API errors and rate limits

Estimated Time: 2-3 days


QRCoder Implementation Effort

Complexity: Low-Medium

Steps:

  1. Install QRCoder NuGet package
  2. Generate QR code in memory (PngByteQRCode)
  3. Upload byte array directly to S3
  4. Handle generation errors

Estimated Time: 1-2 days

Sample Code:

using QRCoder;

// Generate QR code
var qrGenerator = new QRCodeGenerator();
var qrCodeData = qrGenerator.CreateQrCode(
playbackUrl,
QRCodeGenerator.ECCLevel.H
);

var qrCode = new PngByteQRCode(qrCodeData);
byte[] qrCodeBytes = qrCode.GetGraphic(20); // 20 pixels per module

// Upload directly to S3
await s3Client.PutObjectAsync(new PutObjectRequest
{
BucketName = "micdots-qr",
Key = $"{slug}.png",
InputStream = new MemoryStream(qrCodeBytes),
ContentType = "image/png"
});

Testing Considerations

QR Tiger Testing

  • API key validity
  • Rate limit handling
  • Network timeout handling
  • API downtime scenario
  • Cost monitoring

QRCoder Testing

  • QR code scannability (iOS/Android)
  • Error correction effectiveness
  • Image quality at various sizes
  • Memory usage under load
  • Concurrent generation performance

Risk Analysis

QR Tiger Risks

RiskLikelihoodImpactMitigation
Service downtimeLowMediumGraceful degradation (show audio without QR)
Cost overrunsMediumHighMonitor usage, set alerts
Rate limit hitMediumMediumImplement queuing/retry
API deprecationLowHighHave backup plan
Vendor lock-inMediumMediumAbstract QR generation interface

QRCoder Risks

RiskLikelihoodImpactMitigation
Library abandonmentLowMediumFork repo, maintain ourselves
Bugs/vulnerabilitiesLowMediumMonitor GitHub issues, test thoroughly
Performance issues at scaleLowMediumLoad testing, caching
Missing featuresMediumLowCustom implementation or switch later
.NET compatibilityVery LowHighTest across target frameworks

Hybrid Approach

Option 3: Start with QRCoder, fallback to QR Tiger

Strategy:

  1. Implement QRCoder for Epic 2 (fast, free)
  2. Abstract QR generation behind interface
  3. If issues arise, swap to QR Tiger without code changes
  4. Monitor performance and reliability in production

Benefits:

  • ✅ Start with zero cost
  • ✅ Easy to switch if needed
  • ✅ Best of both worlds

Implementation:

public interface IQRCodeGenerator
{
Task<byte[]> GenerateQRCodeAsync(string url);
}

public class QRCoderGenerator : IQRCodeGenerator { }
public class QRTigerGenerator : IQRCodeGenerator { }

// Easy to swap in DI container
services.AddSingleton<IQRCodeGenerator, QRCoderGenerator>();

Next Steps

  1. Answer evaluation questions above
  2. Fill in decision matrix with weighted scores
  3. Discuss with team - development, product, finance
  4. Make decision and document rationale
  5. Update Epic 2 documentation with chosen approach
  6. Implement POC with selected option
  7. Test thoroughly before Epic 2 launch

Decision Record

Date: _________________

Decision:

  • Use QR Tiger API
  • Use QRCoder
  • Use Hybrid Approach (QRCoder with QR Tiger fallback)

Rationale:




Decided By: _________________

Stakeholders: _________________