MongoDB Atlas with GraphQL - mongodb

Looking to build a react-native app and was going to use MongoDB Atlas for the database, express/apollo/graphql mixed in there for better querying. Has anyone had any experience with these techs together? especialy MongoDB Atlas and express?
I'm not sure how all these techs link together. Any tutorials will be handy as well. Thanks.

MongoDB Atlas provides you the endpoint where you can connect to the replica set and use mongodb.
This takes over many other factors such as installing mongodb, backups and restore. Also, the endpoint(connection string) provided by MongoDB Atlas comes with built-in:
Authentication enabled
Authorized users
Replica set to maintain HA
All of these factors give you advantages of using MongoDB Altas so that you can focus on developing your apps
Using mongodb atlas is likely to give you same things you would expect from your local mongodb and express with additional advantages listed above

If you're planning on using MongoDB and GraphQL in a NodeJs service in the interest of getting better querying capabilities, I'd suggest looking at GraphQL-to-MongoDB, or how I learned to stop worrying and love generated query APIs.
Disclaimer: I wrote that blog post.

MongoDB Atlas just announced GraphQL support for Atlas and Stitch. In a nutshell , you can easily generate/ create Schema for a collection in Atlas, Define access rules, relations and generate queries and mutations. GraphiQL is also integrated to run and test your queries. Check this blog post for more details - https://www.mongodb.com/blog/post/introducing-graphql-support-in-mongodb-atlas-with-stitch

Related

Using MongoDB Atlas with Flutter

I want to create a Flutter mobile application and I want to use MongoDB Atlas as a database. Is there a Flutter package available that can help me with that?
If not, is there any other way I can connect Flutter to a MongoDB Atlas Database? If there isn't, what other options do you suggest?
Thank you in advance.
you can use the package mongo_dart, here is the catch in the database URL give URL to your MongoDB atlas database and you will be able to perform all the crud operations as usual. The documentation is pretty well written so you wouldn't have to face any pro
As #JideGuru said, what you'll want is some form of API that you can then make requests to from your app.
i.e. Instead of accessing your DB directly, you'd do something in Flutter like http.get("yourserveraddress.com/getSomethingWithThisNumber/1") using the HTTP package.
I'd recommend looking at something like Node.JS (https://nodejs.org/), which is a runtime for Javascript that allows it to be ran on servers. I'm just getting started with it and for basic CRUD (Create, read, update, delete) operations on my SQL database its been perfect. I'm not a JS developer by any stretch, but it is easy enough to pick up.
You really should never have your database being directly accessed by a client, as that means leaving it exposed on the internet!
MongoDB have their own driver for NodeJS, I've used it with atlas and it seems solid.
(https://mongodb.github.io/node-mongodb-native/)
Hope this helps!

What is the differencce between MongoDB Atlas and MongoDB Atlas for AWS

During my investigation on compatible DBs for IoT data storing I looked into MongoDB and pricing is a little bit confusing.
Just wondering what is the difference between MongoDB Atlas and MongoDB Atlas for AWS as they both work on AWS?
And what is the right way to run MongoDB Atlas on AWS?
As far as I can see, they both should mostly be similar :
MongoDB Atlas :
You can directly go to MongoDB-Atlas portal & create a MongoDB cluster(a cluster will usually be 3-shard/node replica set on which a DB is hosted) on either of the cloud providers (AWS/Google/Azure). This way all database updates/maintenance will usually be done by vendor. Quiet easy & simple - Which most people are opting for these days (SAAS/ db hosted on cloud). You can also opt for a free cluster which should be suitable for basic needs kind of learning MongoDB. While creating cluster you can check for pricing which is based on cluster level (M0 to M700), You can upgrade your cluster when ever you wish to, but when I was creating one I've noted that you would pay upfront for a certain amount of years likely 3 & whether you use the money or not you would not get anything back but it you've paid less then you might be charged over the time of usage. You'll pay bills thru MongoDB Atlas.
MongoDB Atlas for AWS :
From here aws-marketplace when you see the text marketplace (where multiple companies/people collaborate to sell products) it's basically these two companies have collaborated to provide MongoDB as SAAS. With this you can actually come from AWS rather than than Atlas from itself. When it comes to pricing AWS seems to provide some credits, It would be better if you can consult AWS & Atlas to check on their pricing & other terms if you really wanted to use it for enterprise purpose. You might end-up owing an AWS account to pay bills for this usage (Which hectic if you don't use AWS for other use-cases). Additionally if you check below on MongoDB Atlas for AWS page it seems like just a starting point is given at AWS side but entire setup would be done at Atlas.
You're charged for your purchase on your AWS bill. After you purchase
a contract, you're directed to the vendor's site to complete setup and
begin using this software.

Does Laravel support MongoB by default or any NoSQL database?

My company runs a huge Lumen 5.1 project on MySQL. They want to add to it analytics, and they that part to use MongoDB
Is it possible to use MongoDB without any third party libraries? I one going to use
https://github.com/jenssegers/laravel-mongodb
But the tech lead thinks Laravel support MongoDB by default, I'm just asking this question to check whether that's true or not.
Edit:
If MongoDB isn't an option, does Laravel support any other NoSQL by default?
Laravel does not support MongoDB by default.
You would need to use one of several available third-party packages. I like moloquent because it maps mongo db collections to laravel models just like eloquent.
You can use Redis if you need a natively supported NoSQL db or could consider ElasticSearch (not supported natively) if you are going to store a lot of meta data and then analyse it. Tools like kibana and logstash might get very helpful.

Azure SQL API vs Azure Mongo API

I'm very new in the world of "NoSQL", Recently I started using Cosmos DB for JSON documents and am able to store and get data using CosmosDB "SQL" and "Mongo" API.
Which API is best for me? (requirement: Performance, Low Latency, Huge Collection, Low cost)
Now I have spent more than 6 months with Cosmos DB project. I can give my opinion on this question.
Azure Cosmos DB offer the same feature with SQL API vs Mongo API, hence you can't compare by feature.
Reason using Mongo API in Cosmos DB
If you have existing Mongo DB database and you want to migrate on Azure.
If you or your team members have Mongo DB experience.
If you are developing cloud agnostic application, you can move your application on-premise or any other cloud vendor.
Reason using SQL API in Cosmos DB
If you have SQL query experience, it would be easy to start.
If you are not looking cloud agnostic application. (can't move Cosmos DB application on-premise or other clouds vendors).
Cosmos DB Change Feed only available with SQL API.
--- UPDATED 2020 ---
Change Feed is available for all the APIs across all available SDKs except the Table API
Both the API’s provide you high throughput, low latency, elastic scale, geo-replication, etc.
It boils down to what you are comfortable with. Many people preferred Mongo, as they are already familiar with Mongo, it’s syntax, tools, and they already had an application built on Mongo which they migrated to CosmosDB.
If you are starting new, and don’t have an existing investment in Mongo, I will suggest starting with SQL. SQL is the oldest API of CosmosDB, and more battle hardened.
As a software engineer using MongoDB API. I can confirm that my team and I suffered when handling 426 code errors from CosmosDB. So we end up developing our own custom solution with Polly to handles these throttles. Whereas if we used SQL API we would have access to CosmosDB sdk which pretty much handles these situations. This is just my feedback.

PouchDB/CouchDB like alternative for MongoDB

I'm amazed by the sync capabilities of Pouch and Couch DB, but I'm looking for for an alternative that will let me use my MongoDB databases for client-sync. Is there such thing?
If there is, I'd like to hear your experience with it, what should I be aware of, if there are any catches, etc...
Minimongo is specifically what you are looking for. It was originally developed as part of the excellent Meteor framework, but it can now be used independently to get the local db store and synchronization with a remote db, all using Mongo api.