Mobile Bytes #4: Understanding Cluster Tier Configuration and Metrics

Hello Realm Enthusiasts,

Let’s go back to basics this week :smiley:

Choosing a cluster tier, cloud provider, region, and deployment environment is very important for the performance of your Realm Application

Atlas Cluster Tier

A Cluster Tier can be shared or dedicated. It depends a lot on your use-case, which tier will give better throughput and performance.

M0/M2/M5 - Shared Tiers should only be chosen for development and testing environments

M10/M20 - Dedicated Tiers for development environments and low traffic applications

M30 and above - Dedicated Tiers for high-traffic applications and large datasets

Check Shared-Tier limitations to learn more.

Please Note - If you move from shared tier to dedicated tier, you will be required to terminate and re-enable sync.

Updating NVMe clusters will also require termination/re-enablement.

Cloud Provider and Region

MongoDB offers multiple regions across AWS, Azure and GCP and Realm currently supports 7 AWS regions for local deployment (more details) but is planning to add regions in Azure and GCP later this year.

It is recommended that you choose the Realm region closest to your Atlas cluster’s location. . Having the same Cloud Provider for both Cluster and Realm App is more advantageous for better throughput, performance, and cost – though not required.

Please Note: Sharded Clusters do not support Realm Sync

Deployment Model for Realm App

It is recommended that you choose a local deployment model when you create your Realm Application compared to global. Local Deployment means that all requests to your application are processed in a single region. This also leads to low latency and better performance between Realm ⇐=>Cluster traffic. In Global deployments, Realm will process end-user requests in the closest region to that user.

Metrics

There will be different metrics displayed for shared and dedicated cluster tiers as shown in the diagram below:

The Shared tiers will show only basic information around CPU, Memory, and Network usage while more granular details will be shown with dedicated tiers.

The dedicated tiers will be more detailed than the shared tiers. Some of the important metrics for better application performance are:

Oplog - Oplog is a capped collection that keeps records of all transactions done on MongoDB. Sync uses the oplog to ensure changes are passed between database and application. It is important that your Atlas cluster has a sufficient oplog to be resilient to changes in workload and it is recommended to have a minimum oplog of 72 hours. Check Changing Oplog Size to learn more.

Errors like “Cannot Resume as resume token fall off the oplog ‘’ can be prevented if Oplog is configured properly and this will minimize cases where a termination/re-enablement is required.

Disk IOPS - Corresponding with your application workload, Realm Sync will use Disk IOPS to construct the Sync metadata and merge changes across applications into Atlas. If you see that Disk IOPS are exceeding the limits of your cluster, increasing the cluster tier or provisioning additional IOPS may significantly increase performance.

Query Metrics - The graph depicts the performance if you are running queries on data in MongoDB Atlas. You can also use Performance Adviser and Profiler capabilities in conjunction with query metrics to understand query outputs. Any other queries/workload run on the Atlas cluster with Sync will use the same resources, some of these operations may include:

  • Functions
  • Triggers
  • Driver Requests
  • Charts, Compass, and Data Explorer operations

Check the Important Metrics section to learn more.

If you are new to MongoDB, the recommendation is to use the free tier and try different operations in your development environment to understand the workflow. However, it is not recommended to ship your production application while using the free tier.

I hope the provided information is helpful.

Please feel free to add any questions or ideas you may have based on your experience working with MongoDB and Realm.

Happy Learning and I will see you next week… :heart:

5 Likes

What will happen when you hit the limits of your selected cluster? I have a consumer app with a very high number of MAU and want to migrate this to Atlas/Realm.

If I pick an M30 instance and this isn’t enough, will it automatically upgrade? For storage, does it also automatically upgrade? For a global app, is it still fine to chose local deployment and what region should I choose?

1 Like

Hello @Simon_Persson,

Thank you for your great questions :smiley:

What will happen when you hit the limits of your selected cluster? I have a consumer app with a very high number of MAU and want to migrate this to Atlas/Realm. If I pick an M30 instance and this isn’t enough, will it automatically upgrade? For storage, does it also automatically upgrade?

As I mentioned in the post, choosing a cluster tier is an important factor. For production apps, I would recommend M30 or above and you can gradually scale as per your app traffic. Please refer Cluster Auto-Scaling in the documentation.

For storage as well, you can change as needed by your application. Please refer Customize Cluster Storage section for details.

For a global app, is it still fine to chose local deployment and what region should I choose?

Please understand, the deployment model most affects the latency between the SDK and the Realm Cloud Server. For normal requests, global is sometimes better. For Sync, there is a huge reliance on the database so we suggest using a local deployment in the same region as your cluster because this minimizes the latency of the Realm Cloud - MongoDB Connection which is more important than the latency between the device and the Realm Cloud.

I would recommend choosing a cluster region where most of your traffic comes from and then deployment the Realm App in the same region as your cluster.

I hope this answers your queries. Please feel free to ask if there are any more questions.

Cheers, :performing_arts:

1 Like

Thanks! Then single location makes sense and if I understand it correctly I can set it up so that the servers and storage options auto-scale. Sounds good!

Then single location makes sense and if I understand it correctly I can set it up so that the servers and storage options auto-scale.

The Single location is set up to minimize the latency between the database and Realm Cloud Servers. This helps in better Sync performance. For Auto-scaling and Storage, that will require some initial manual configuration, please refer to the links that I shared and feel free to ask any questions you may have.

Happy Reading :smiley:

1 Like