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.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1bf44d4-31244.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1bf44d4-31244.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?