Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Do I understand MongoDB Realm correctly?

There are three components:

  • Realm Database: Local Storage & Persistence
  • Realm Sync: Sync Realm Databases between clients and the Mongo DB Atlas
  • Mongo DB Atlas: A Cloud Database.

You can use each separately or together. So you can

  • Just store data locally with Realm Database and not sync it
  • Just store data on Mongo DB Atlas without using realm sync, using standard queries to access the data.
  • Use realm sync to create a synced realm that partitions your mongo db atlas database into a local realm and syncs data between the database and all clients who use it.

Is this all correct? (Thank you)

like image 617
Iskeraet Avatar asked Jun 11 '20 02:06

Iskeraet


People also ask

What does MongoDB Realm do?

Realm is an embedded, object-oriented database that lets you build real-time, offline-first applications. Its SDKs also provide access to Atlas App Services, a secure backend that can sync data between devices, authenticate and manage users, and run serverless JavaScript functions.

What is the difference between MongoDB and MongoDB Realm?

MongoDB belongs to "Databases" category of the tech stack, while Realm can be primarily classified under "Mobile Database". "Document-oriented storage" is the primary reason why developers consider MongoDB over the competitors, whereas "Good" was stated as the key factor in picking Realm.

Is Realm owned by MongoDB?

Both a developer and a commercial edition was released, along with a business license for integrating with other database management systems such as PostgreSQL. In spring 2019, MongoDB acquired Realm for 39 million USD.

What is the difference between MongoDB Atlas and Realm?

Atlas is the UI that sets up a database cluster, which you can connect to like any other via MongoDB Compass, etc. Use realm sync to create a synced realm that partitions your mongo db atlas database into a local realm and syncs data between the database and all clients who use it.


Video Answer


1 Answers

below are some notes for your questions. I'm just getting setup with MongoDB and Realm, myself.


A - Tools

Realm Database: Local Storage & Persistence

Correct - Client (on-device / local) storage

Realm Sync: Sync Realm Databases between clients and the Mongo DB Atlas

Somewhat confusingly, there's 2 different implementations of Realm Sync:

  1. Realm Sync - Syncs between clients with Realm (no MongoDB implementation necessary). This uses Realm-run database which costs $30/month
  2. MongoDB Realm with Sync - Syncs between Realm clients and MongoDB + Atlas backend which has a 'free forever' sandbox tier.

Mongo DB Atlas: A Cloud Database.

Correct - A database cluster + UI that is used in most tutorials to setup data models & database configuration.


B - Setups

Based on those understandings, you're correct that these tools can be used differently to have each of these setups. For instance...

Just store data locally with Realm Database and not sync it

Just normal old Realm for whatever client you need

Just store data on Mongo DB Atlas without using realm sync, using standard queries to access the data.

Any cloud MongoDB database provider. Atlas is the UI that sets up a database cluster, which you can connect to like any other via MongoDB Compass, etc.

Use realm sync to create a synced realm that partitions your mongo db atlas database into a local realm and syncs data between the database and all clients who use it.

MongoDB Realm with Sync (#2 above). For this, I've found the Task Tracker tutorial most helpful.

Hope that helps!

like image 150
tommy2712 Avatar answered Oct 27 '22 00:10

tommy2712