Interactions between mongodb realm and Atlas Clusters

I am a mobile developer without much experience in backend. I am wondering how does the mongodb realm interact with the underlying Atlas Clusters. More specifically I have these questions:

  1. The doc of mongodb realm says that mongodb can

    Deploy server-side applications without having to set up and manage server infrastructure.

    But I do need to setup an Atlas cluster right?

  2. How does scale-up work? Should I change the underlying clusters myself when needed?

  3. How does the backup work? The same doc also says:

    Realm includes provisioning, deployment, operating systems, web servers, logging, backups, and redundancy.

    But I don’t see details about backups/recovery in the doc. I’ve found out there is an option to turn on mongodb backup for the underlying Atlas cluster, but that’s not managed by the realm app.

  4. I chose AWS as the underlying infra. Is the data replicated in multiple availability zones? How available is mongodb realm?

  5. What else should I take care about Atlas while using mongodb realm?

Hello Sen,

I’m Brock, and I’d be glad to help clear things up for you.

What I’m going to do, is I’m going to walk through the creation of an Atlas Cluster, and go through starting up a Realm App as I answer your questions.

So for starters, just to clarify it doesn’t necessarily matter which PCS (Public Cloud Service) that you use, I would use the one that you feel the most comfortable with. As like I myself, I personally have an M2 cluster in AWS, GCP, and Azure that I have destroyed and rebuilt a few times among others in testing and developing applications.

As you can see:

I will be destroying both the AWS and GCP instances to show you the differences as I go about answering your questions.

For #1
Yes, you do need to build an Atlas cluster for use with Realm. The way Realm works is that it will work as local storage on your device or end client (depends what terminology you wish to use) and then with Sync functionality, or an API will transmit and store this information into your Atlas cluster.

Now for the second answer to #1 as you probably have more questions, we use Realm SDKs for End Clients, and then we have the MongoDB Drivers to interface Atlas with Backend/Server Clients. So a good rule of thumb, if it’s backend, think Atlas by using MongoDB Drivers. If it’s an end client for end users (such as a Mobile or Desktop application) or edge IoT devices, think of Atlas by using Realm, and Realm SDKs. As Realm is both local persistent storage, and a gateway into Atlas as mentioned.

As answer three for #1, keep in mind that Atlas is the centralized point in which all infrastructures data storage can safely be held in. Your infrastructures complexity really comes down to your own decisions and wants, as natively with realm you can automate functions with GraphQL, Triggers, and so on. And through Realm you have all of this and all of the benefits MongoDB itself can provide you. This doesn’t include talks about our APIs and the ability to integrate your own third party services such as AWS SDK 2.7.

#2 This is up to you, whether you want auto scaling which it’ll grow as needed, or you manually upgrade yourself. It’s up to you on this, for a full-scale production application however, I do recommend an M20 at the least. But for testing purposes you want an M2 or larger cluster. For learning how Atlas works, an M0 (free tier) is fantastic, but this is a shared instance. Until you go to an M10 you’re sharing resources with other tenants and thus will have limits on resource availabilities so keep this in mind. (Note: M0, M2, and M5 cannot be upgraded as these are not intended to be production instances. These are Learning and testing instances)

#3, Correct, Realm isn’t going to back up the data, Atlas (MongoDB) is. So Realm will store your data locally on the device, and Realm Sync (the Sync you will set up between the end client and Atlas with Realm through our documentation steps.) will send this data to be saved and stored in Atlas. Which is then replicated and saved across 3 nodes in the Atlas cluster. This ensures that you have data backup redundancy, and you won’t even have to worry about paying for any SSDs, extra storage fees, etc. either! Nor worry about setting up any virtual machines, configuring security appliances, or any of that.(In relation to Atlas and internal MongoDB Infrastructure) We do that for you. (As someone who’s spent a lot of time in DevOps… This is a great thing to pass off to other people to do)

#4. So I want to point out the locations in the boxes, where it says MongoDB 4.4, then location you have one in California (the Azure) and one that’s located in Oregon (The AWS) This is because for these two, I picked the datacenter that geographically make sense to my location.

So now, I’ve destroyed all of my M2 Atlas clusters, so back to your question for 4.
So no matter what, your users will always have their traffic routed to the closest datacenter and then it will be routed to your central nodes. The data centers you chose.

So you’re at this screen, and you can choose server less, dedicated, or or shared. (Free tier)

Then, you have “Cloud Provider & Region” this is where you select your exact provider that you want, and what your primary region will be. But do you notice the toggle button?

So when I chose AWS in this example, I can pick any single data center I want that’s owned by AWS. I personally choose Oregon as that’s the location that just makes sense to me for my use case. But going back to that toggle button.

The button I speak of belongs to “Multi-Cloud, Multi-Region and Workload Isolation” - basically just meaning for choosing more areas for more load distributions and minimizing latency for your users. An easy example of this is say East and West Coast of the United States.

For example purposes I also chose Germany to highlight that. Do you notice on the Provider list it says AWS? Well you’re not restricted to just one provided in this relation, as you can also select GCP or Azure and choose any of their datacenters they have available.

Overall, I encourage anyone to be realistic on their applications demand and scale/choose accordingly. Just as I also encourage signing up for our amazing support plans which our Atlas Developer plan is very worthwhile, as those Technical Support Engineers do go above and beyond if you ask me…

Now, because for me I am just making a test cluster for testing Realm Apps. I chose an M2 cluster via the Shared section. (Remember, only M10+ aren’t on shared tenants).

I chose

Now one thing to consider about this, is by doing this route you lose the abilities to enable business intelligence, or use your own encryption keys. So if you want those functionalities, you will have to choose an M10 cluster. (M20 is the minimum I personally would recommend for a production environment, this is not official, but as stated before, scale by the means of what makes sense for your use)


So now the cluster is created, I then click the link to access the cluster.

So this is what you’ll see:

For a better understanding of this UI and how to get the most out of Atlas, I would encourage going to MongoDB University and looking at our MongoDB Basics course, followed by our MongoDB Administration course. These two will be the fundamentals of everything Atlas.

So at this point, to answer your question where Realm comes into all of this, now we set up the Realm app. So you click on the Realm Tab between Atlas and Charts, and you’ll come to this page:

And I chose the “Build your own App” choice.

Where it then makes sure you have the settings that you want:

After this screen it goes over what guides will help you and so on. From this point you just worry about your app and how you want it to be setup and made from any of our SDKs.

So that now covers your questions of 1 through 4, which I can even elaborate even further than this if you’d so like.

So now onto 5.

I would always recommend and encourage learning MongoDB via our MongoDB University. Even if you have no plans of using MongoDB as a major power user, the information can be amazing to know as you and your application and business scale.

Which as your application becomes more and more successful, there are advanced features in MongoDB (ATLAS) That is heavily worth while to know and understand. Which as always, via the Atlas Developer Subscription, we are always willing and excited to help you out when you come across technical issues.

And that goes for the entirety of our product offerings.

Anything else I can elaborate on, or any further questions feel free to ask.

Regards,

Brock.

2 Likes

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.