Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[question] Is it advisable to have nested worker pools in Node.js for handling heavy data operations? #78

Open
wojtekKrol opened this issue Aug 28, 2024 · 0 comments

Comments

@wojtekKrol
Copy link

Description

I am developing a Node.js application that involves heavy data processing with three distinct services, each managed by a separate worker pool. Here's the breakdown of the setup:

  • ServiceX and ServiceY: Each runs with a single worker (serviceX.js and serviceY.js).
  • ServiceZ: This is the core of my application, handling extensive data structures (like an array of 10k objects) and data processing, running with N workers (serviceZ.js).

Current Architecture

In ServiceZ, a task involves checking for duplicates in a database where a specific column is not null. Additionally, I need to handle duplicates where the column is null in returned data to optimize processing and database updates. Given the intensity of these operations, I am considering using a nested worker pool within ServiceZ.

Question

Is it practical to initiate a new worker pool within an existing worker's task in ServiceZ? This new pool would potentially launch single worker instances dynamically to handle specific heavy operations like duplicate checking.

Concerns

  • Performance: Could nesting worker pools lead to significant performance hits due to overhead or complex resource management?
  • Best Practices: Is this approach advisable in terms of architectural best practices, or are there more efficient methods to manage such heavy operations without risking call stack blocks?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant