Initially, our backend was connected to a local MongoDB instance where we used timeseries and common collections, and everything was working great. However, now that we have transferred the data to Atlas, the microservice that works with timeseries is unable to retrieve any data from Atlas after a few requests (it starts working again after a restart, but eventually reaches a “limit” of requests). On the other hand, the microservice that works with common collections does not have any problems. Are there any restrictions from Atlas regarding request frequencies or any other issues that could be causing these data gathering problems?
Unexpected behaviour with nestjs and Atlas data gathering
MongoDB Atlas, the cloud-hosted version of MongoDB, places certain limitations on usage to ensure that all customers have a fair and consistent experience. These limitations include a maximum number of operations per second (OPS) that can be performed on a cluster, as well as a maximum number of connections that can be open at one time. If your microservice is making a large number of requests in a short period of time, it could be hitting these limits, which would cause the requests to fail.
Additionally, if your microservice is using a lot of connections, it could be running out of available connections, which would also cause requests to fail. To avoid these issues, you may want to consider implementing connection pooling, which allows a limited number of connections to be reused for multiple requests, rather than opening a new connection for each request.
Other possible issues that could cause the data gathering problem you’re experiencing include network latency, poor performance of the MongoDB cluster, or issues with the specific query or index used by the microservice.
It’s recommended to investigate the performance metrics on your cluster, check the logs, and work with MongoDB support team, to help you troubleshoot the issue.
Thank you, but I haven’t encountered any limitations and the issue occurs randomly. Additionally, as I mentioned earlier, another microservice works perfectly fine with the same cluster, and the problem only seems to occur with the time series collection.