java - Creating threads vs process for better maintainence - Design approach -
i have scenario , want query employee information of organization , using third party rest apis. done different organizations, given list of employees, expecting around 500 50k users per organization.
i in poc stage, want decide best approach handle this. 1 option create 1 single java process, , generate single thread per user. create single process per user , write shell script provide details of each employee.
my question better solution , form maintenance point of view. might happen , users might have issues, due depending on 3rd party apis. might better approach support point , debugging point. might open question . know , if had encountered scenario before , , approach.
if have number of tasks needs run concurrently want use thread pools. thread pool owns number of threads , handed units of work need done. pool passes each unit of work first idle thread, managing actual executions you.
exactly how many threads pool should contain depends on exact requirements, assuming you'll polling these apis frequently, thread per api reasonable.
there's no need separate processes given you've described.
Comments
Post a Comment