Need some clarification about Mongo Realm and Mongo Atlas. And App user data - mongodb

I am new to app development and I've been looking into using MongoDB Atlas and MongoDB Realm. A few questions I couldn't find answers from their documentation, hopefully someone can clarify for me.
Is it correct to think Mongo Realm is client DB and it uses sync to the MongoDB Atlas, so if I make a React Native app using Realm, then user store/retrieve data from one device, and can pick up from another device (if they logged in with the same account)?
If point 1 is yes, then if I want to make a web app as well and skip Realm and only use Mongo Atlas, can I use the data synced from Realm? E.g. a task list created with my React Native app in Realm and synced to Atlas, can I create a web app and query synced data stored in Atlas direct say with Mongoose?
If point 2 is true, how can I access app user from Atlas, it seems it only exists only in Realm, what's approach here?
Final point is, for this kind of cross platform app, what's the best approach?
Many thanks,

I am currently working on implementing an app with the setup you describe.
Is it correct to think Mongo Realm is client DB and it uses sync to the MongoDB Atlas, so if I make a React Native app using Realm, then user store/retrieve data from one device, and can pick up from another device (if they logged in with the same account)?
Yes! You can try this easily with the Task Tracker App by MongoDB Realm Sync
if I want to make a web app as well and skip Realm and only use Mongo Atlas, can I use the data synced from Realm? E.g. a task list created with my React Native app in Realm and synced to Atlas, can I create a web app and query synced data stored in Atlas direct say with Mongoose?
Yes! - Realm Sync does not support React Native Web as far as I know, therefore creating a Web App with React or Next.js is a good alternative as MongoDB Atlas data synced from mobile devices via Realm Sync can be easily be accessed in this way. I am currently looking at the following approach: How to Integrate MongoDB Into Your Next.js App
how can I access app user from Atlas, it seems it only exists only in Realm, what's approach here?
Try the above mentioned example app with a few users and this will become more clear to you. In this case the MongoDB Atlas database will be 'partitioned' by userID making it easy to get just the data you want for the web app. Look into Partition Atlas Data into Realms to understand this more fully.
for this kind of cross platform app, what's the best approach?
Well what is the best approach is difficult to answer as the question is too broad, and it depends a lot on what the app is for and how it is used.
Personally I have good reasons for choosing Realm Sync, as I require offline-first capability. I am building a React Native iOS/Android app with many users having their own data. Therefore I am 'partitioning' by userID. My main use case is mobile and the web app is merely intended to support easy data entry and editing on a laptop or desktop. Therefore not all features of the mobile app need to be replicated in the web app. This is just my personal approach.

Related

How to create flutter app's offline and online

i am just looking for ideas about how to make the app work in online and offline modes(it is a todo app and it should work online and offline both)
I have a todo app that stores the data in sqflite database(locally on the phone) when the app goes online I want the data to be synced with my online database for online database i am using from mongodb. i am just looking for suggestions and also i want to ask which offline database is fine beside of mongode, Hive or sqflite.
you can use a shared_prefernce library and create a function if phone not connected to wifi return null else if connected use socket emit and clear local storage
MongoDB's Realm supports the sync feature, however this would lock your application to the MongoDB's Atlas hosted Database.

Can I pre-cache data to work offline in mobile app using AppSync?

I am developing an Android and iOS app that could be used in areas that have a very poor or no data connection. It is a requirement for the app to be pre-loaded with all of the data so it will work even if the app never communicated with the server, but it also needs to be able to update and sync when a connection is made. Is it possible to manually populate the AppSync (Apollo) cache database with data on launch and query and mutate it later? The app also contains several search and filter queries. Our backend API is currently using GraphQL.
I have seen this question, Is it possible to build offline-first mobile apps using AWS AppSync?, but it is a little different that what I'm asking.
The recommendation would be to hydrate (read: pre-load with data) a local SQLite database after install. SQLite is what the 'local cache' uses to persist data on the device.
Refer to this github issue for a code example of how to do this:
https://github.com/awslabs/aws-mobile-appsync-sdk-js/issues/160

How to manage sessions in Realm Mobile Platform?

I was trying to make an iOS app with real-time collaboration using Realm Mobile Platform (Swift 3) and got stuck with lack of docs and examples. At the moment I have user authentication through realm object server. I can sync data between server and all users. Now I want two users to connect within a session, and then to sync data between them like it was done in their drawing demo (watch the video on https://realm.io )
Realm Mobile Platform doesn't support sharing the data between different users yet. Partially resolved by this PR https://github.com/realm/realm-cocoa/pull/4275.
So for now, you should share one SyncUser between multiple people to share session like a draw app demo.

Accessing Database using node.js in iOS

I want to create such a application in which my iPhone will have the UI for entering the data for the employees. After clicking on the post button data should be saved on the sqlite database and I also want to retrieve the data on button click from the database. I want to use node.js for communicating between my iOS app and the database. Since I have never used node.js before, please give me some links where I can study the sample applications.
I am not an iOS developer but I would make a REST service in Node.js that can sit between your Iphone app and your database. You most likely are going to want to have some form of authentication on the service.
Also does it have to be sqlite? There are databases that can understand HTTP. If you use CouchDB (there are others) you can let your app talk directly to your database. That means you can leave out Node.js completely. You can go even further and use a service that will provide a back-end for you. Something like parse.com (there are others) will do this for you.

Application users account registration and login, best way to handle?

First of all, i'm new to Objective-C, so please be patient with me.
I want to add to my application users account management, users can register/log-in into a personal account that will synchronized with database on the internet. I dont have a clue how to do that. I know how to work with sqlite3. I was thinking maybe to create an sqlite3 database on the device. is it possible to store images into sqlite3 database? is it the best and efficient way to manage users on application?
what does sign in with Facebook or Twitter do? is it possible to add them both and another option for someone who doesn't have Facebook or Twitter?
What is the best way to handle account registration and login on iPhone?
Thanks alot!
I want to add to my application users account management, users can register/log-in into a personal account that will synchronized with database on the internet.
AFNetworking or ASIHTTPRequest can help you with this. create a web service api, maybe in php + mysql or any web scripting language you prefer, from the device you can POST your data like username and password and do the logic in your web service.
I was thinking maybe to create an sqlite3 database on the device. is it possible to store images into sqlite3 database?
what is your plan here? why would you create a database on the device? do you want to manage the users locally? if yes, that would be easier and more efficient because you dont need internet connection to create a request to server. and yes its possible to store images in sqlite by storing the image as blob
what does sign in with Facebook or Twitter do? is it possible to add them both and another option for someone who doesn't have Facebook or Twitter?
Yes its possible. you can have three log in options. facebook, twitter, and your custom log in option. if you want to integrate facebook and twitter on your app. there are many tutorial and docs you can find there.
I suggest: this for facebook and download the sample app
What is the best way to handle account registration and login on iPhone?
it depends on your app requirement, if you dont need to store your user data in a database on a cloud server, the best way is to create a local database on device.
This is a broad question - so the answer is going to be very general, little of which has to do with Objective-C, iOS, or Mac specifically.
It sounds like you are creating an application on a mobile device that needs to synchronize data with a database for which the mobile app is a client. One way of managing this is to start with table of users and credentials on your server, e.g. in MySQL. Then you need to write the API on the server side, e.g. in PHP, Rails, Python, etc. Then you will write the web service code on the device that interacts with the server's API.
If you are new to developing on iOS, then I would suggest running through some tutorials on consuming web services, first. That is, I would learn how to connect to pre-existing web services first. You might want to check out the AFNetworking library for Mac and iOS. It has some demo applications. But if you want to stick with the native URL loading system on iOS, there are numerous tutorials available. (Here's one)
I should mention another option is to use Amazon Web Services SimpleDB. There is an iOS SDK. It allows you to execute queries directly against the db without writing the server-side code.
You mentioned sqlite3. This will allow you to manage data on the device; but you state that you want to sync data with some resource on the internet. You can store images in sqlite3; but you can save yourself a lot of hassle by looking into Core Data as an alternative.