← Back to the deskJeevan’s field notes / Engineering casebook
Engineering casebookNo. 01.3
← All case studies

Data access · Asynchronous workloads

Keeping expensive work out of the request path.

Reducing unnecessary data work and separating background jobs from latency-sensitive APIs.

My contribution
Platform architecture lead
Context
Professional work · 2025–2026
Node.jsMongoDBMongooseRabbitMQRedis
My responsibility
Reviewed data access and execution patterns across platform workflows.
The key decision
Use lighter reads and bounded concurrency; make background processing an explicit boundary.
What changed
Reusable practices for data reads, asynchronous jobs and evidence-based cache sizing.

The problem & my responsibilities

As workflows evolved, routine reads accumulated framework overhead, independent operations ran serially, and report generation competed with user requests. Infrastructure growth alone could not fix that workload shape.

I reviewed data access and execution patterns across workflows, identified where batching or concurrency was safe, and made asynchronous processing a deliberate platform boundary.

Constraints that shaped the work

  • Existing APIs and correctness expectations
  • Independent versus dependent database operations
  • Memory and database connection limits
  • Background reports sharing application capacity

How the system fits together

Architecture / system overview
  1. 01
    RequestValidate input · identify required data
  2. 02
    ReadProjection · lean results where suitable
  3. 03
    SeparateInteractive response / queued work
  4. 04
    OperateWorker capacity · failures · cache demand
Open architecture diagram ↗

The consequential decisions

Choices, alternatives and the costs that come with each decision.
DecisionChoiceAlternativeTrade-off
Read resultsMongoose lean reads where suitableHydrated documents for every readAvoid document machinery when getters, setters and document methods are unnecessary. Keep hydration when behavior depends on it.
Independent I/OBatching or controlled concurrencySerial round-tripsReduce waiting between independent operations. Unbounded Promise.all can overload the connection pool; concurrency is a capacity decision.
Report generationAsynchronous workersWork inside API handlersKeep expensive generation away from interactive requests. Job state and failure handling must remain visible to callers.
Cache capacitySize from observed demandKeep the inherited instance sizeUse memory and traffic evidence over a representative window. Include burst behavior, eviction and recovery headroom.

Where the work got difficult

Avoid universal performance rules

A lean read is useful only when the caller does not require document behavior. I treated query shape and correctness as part of the same review.

Expose hidden contention

Independent work can run concurrently, but it still competes for finite resources. Pool size, worker capacity and request demand belong in the decision.

Operating considerations

Reliability

Background workers need bounded retries and duplicate-safe side effects. Moving code into a queue does not by itself make the operation reliable.

Data & security

Read projections should select only what the caller needs. Lean results do not replace authorization checks or change which data may be returned.

Performance & cost

Measure CPU, pool waiting, queue delay and cache behavior under a representative workload. A faster isolated query does not establish whole-system improvement.

Outcomes & lessons

The work established reusable practices for lighter reads, intentional concurrency, background processing and evidence-based cache sizing.

Performance defaults should make the safe path easier without hiding the conditions under which that default stops being correct.

Jeevan Jyoti SrivastavaThink → build → understand