What are the intermediate schemes between online scripts and mongodb?

  mongodb, question

I deployed python scripts on more than 1,000 online servers, calculated and stored the values in mongo replica sets on the other three servers.
It is not safe to write directly now. The account password database ip is directly exposed online.
Is there any solution to this problem?

The problem has been solved.
Because the amount of data is relatively large, a layer of kafka is added in the middle.