Under the cluster mode of nodejs, how to solve the database and other instances?

for example, if several cluster are enabled, it is impossible for each cluster to instantiate its own database.
if not, then master instantiates the database, and cluster requests master if it needs to query data.
as a result, it feels like the amount of code has increased a lot.
how did you solve it?

Jul.07,2022

is so troublesome that I later gave up this feature and opened it as a child process instead.

Menu