Skip to content

[FEAT]: Batch PDF Processing for Multiple Concurrent Forms #255

@ishansurdi

Description

@ishansurdi

name: 🚀 Feature Request
about: Suggest an idea or a new capability for FireForm.
title: "[FEAT]: Batch PDF Processing for Multiple Concurrent Forms"
labels: feature
assignees: ''


📝 Description

Batch endpoint for submitting multiple forms at once instead of one-by-one. Right now each form takes 20-30 seconds so if you got 10 people submitting reports it's like 3-5 minutes total. Batching them would cut that down to under a minute.

💡 Rationale

Shift change scenario - night shift ends at 7am after a busy night (couple structure fires, medical calls, etc). You got 8 firefighters who need to submit reports before going home but they're waiting in line while each form processes. Last person waits 10+ minutes just standing there.

Server also gets hammered when everyone hits the same endpoint repeatedly. With batching you control parallelism (maybe 4 threads) so performance is way better without overloading anything.

🛠️ Proposed Solution

Add a batch endpoint that accepts multiple form submissions and processes them in parallel using background workers. Returns a batch job ID immediately so users can check status later instead of waiting.

Tested locally with ThreadPoolExecutor (4 workers) - processed 10 forms in 60 seconds vs 200 seconds sequential. About 3x faster.

Each form runs independently so failures don't crash the whole batch. Track everything in database with BatchJob and BatchFormSubmission tables.

✅ Acceptance Criteria

  • POST endpoint accepts multiple FormFill objects
  • Returns batch ID right away
  • GET endpoint shows batch status (completed/failed/processing counts)
  • Individual form failures are isolated
  • Existing single-form endpoint still works
  • Measurable performance improvement over sequential

📌 Additional Context

Numbers from local testing:

  • 10 forms one-by-one: 3+ minutes
  • Same 10 batched: under 1 minute
  • ~3.3x speedup

Got it working on my machine with tests passing if you want a PR. I'm open to discussion and inputs!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions