How can I determine the CPU and RAM requirements based on data size?

We are developing a website using Angular and Node.js, utilizing a cluster on the free shared tier. The total storage size of the cluster is approximately 3.0 MB, spread across six collections. One collection stands out as it has a significant storage size of around 2000 KB and contains 957 documents.

Although the current sizes are relatively small, we are experiencing slowdowns in API response, particularly when making a ‘get-all’ request on the dominant collection. It takes up to 1 minute to receive a response, and we are concerned about the application’s speed as we anticipate a 10x to 20x increase in storage size, especially for the dominant collection, in the future.

We have the following questions:

  1. Which factor, CPU, RAM, or network performance, is responsible for the operation speed?
  2. What steps should we take to improve the response time?
  3. If we decide to go with a subscription plan, should we choose a serverless or dedicated option?
  4. If we opt for a dedicated server, how can we determine the CPU and RAM requirements based on the collection size and number of documents?

Hey @Rajan_Braiya,

Welcome to the MongoDB Community forums :sparkles:

To better understand the scenario, could you please share the workflow you followed to run the query, the explain output of the same, and the sample document?

It depends on various factors, including your schema design and the complexity of the query you are planning to execute.

Serverless is more suitable for workloads that are not consistent. However, if you are expecting a consistent workload, then a dedicated server would be a good choice. It depends on your preference and workload. To learn more about serverless and dedicated servers, please refer to the FAQ - Atlas Serverless Instances.

As per my knowledge, it doesn’t depend on the collection size; it depends on the working set. It could be the case that you have a huge dataset, but the working set could be small. Also, MongoDB Atlas provides an auto-scaling feature that you can configure, and MongoDB Atlas will automatically scale your cluster tier, storage capacity, or both in response to cluster usage.

Look forward to hearing from you.