Why does MongoLab not recommend using their REST API? - mongodb

From the MongoLab's documentation, they recommend:
MongoLab databases can be accessed by your application code in two ways.
The first method - the one we strongly recommend - is to connect using one of the MongoDB drivers (as described above). You do not need
to use our API if you use the driver.
The second method, which you should use only if you cannot connect via one of the MongoDB drivers, is via MongoLab’s RESTful data API.
Why do they recommend using the driver rather than their REST API? One reason I can think of is portability across different MongoDB providers. Are there any other reasons? Wouldn't it be more beneficial for MongoLab to "vendor lock-in" customers with their API?

The points that #WiredPrairie and #Stennie brought up around security are correct. *When you use our REST API, you expose your API key to the client. Currently, anyone with the API key can modify your database. As a result, we only recommend using the REST API with public data, e.g. all the locations for taco trucks in the country.
By writing your own app tier, you can keep credentials to your database from being exposed to the client.
If you have any more questions, email us at support#mongolab.com. Happy to help!
-Chris#MongoLab
p.s. thanks #WiredPrairie and #Stennie

Related

Data synchronization between primary and redundant servers

I want to synchronize data among a set of REST API servers(Spring Boot based API cluster) periodically. Any instance in the cluster should be able to broadcast new information to all others.
I don't want to use a DB here. I am trying to find a lightweight library that can be used inside the API for this purpose. Is it possible to use Atomoix/Hazelcast/ZooKeeper for this purpose? If so, it will be really helpful if someone can post a sample code - if possible.
My thanks in advance.
In Hazelcast you can do it through WAN replication.
It is an enterprise feature you have to buy a license.
Hazelcast can be used for this use-case. Each of the REST instances will create an embedded Hazelcast member within its JVM. Hazelcast members then discover each other and form the cluster. Your REST apps will use the IMap or ReplicatedMap service - a distributed key-value store (IMap can store more data, ReplicatedMap is faster). Once you write a data to the IMap all other instances see it right away.
See the code sample here: https://docs.hazelcast.com/hazelcast/latest/getting-started/get-started-java.html#complete-code-samples
This feature and the Spring integration are open-source.

Is it possible to use Appery to access data from Neo4J Graph Database?

I have a web application that has to be linked with a graph database (Neo4J). Is it possible to read or write data to Neo4J using Appery?
I have chosen Appery because I am a beginner when it comes to databases and Appery seems to be easy in using REST API, as well as there is a free trial.
Feedback would be highly helpful. Thanks in advance.
Edit: I am aware that Neo4J uses Cypher queries. I would like to know if Appery supports Cypher as well.
Side note: The reason I am asking the question here without trying it out is because I dont have an active DB and my application is private due to my company's security policy
You can do that as long as Neo4J database has a REST API. If it does, then you can make calls to it from an Appery app (from Server Code or API Express). Hope this helps.

Query Azure database using API

I host my database on Azure. I would like to search data on the table in that database. I am trying to use B4I and the tech help their said I need to use REST API's. I am pretty sure I need to use ODATA. I have the auth token but I am not sure if this is even possible.
In order to query Azure SQL with an API you need to add a layer between it and the destination. As mentioned in this question, OData is a specification that can be implemented fairly easily as there are plenty of libraries that will take care of the bulk of the code for you.
As far as where to host the API, you have several options within Azure. The most common being App Services, Azure Functions, and Logic Apps.

Using Local storage and REST adapter at the same time?

I'm pretty new with an Ember so for the start I have a noob question - is it possible to use Local Storage and REST adapter at the same time?
For example, if I want to do a login via API, if login is success the server will return an API key which is used for later communication with a service. Is it possible to store that information locally on the client and to retrieve it when necessary but also, for other models, to use REST adapter?
If this is not a good way to handle such case, which one would you propose and is there any kind of example which would me lead me in the right direction?
Thanks to the people from #emberjs, I found out that there is a wonderful ember-auth authentication framework for the Ember.js which does what I need.

REST based service on iPhone

I have never before created a REST based service. I am about to create a simple apps for the iPhone which needs to store data and I want to consume the data by using a REST API. Do you think this is worthed or should I as well do a query to the DB? What sort of DB/language do usually iPhone developers use for their application?
the iPhone includes SQLite which can store your data locally. If you need to query a system on a server, then you need some method of exposing your data and performing operations against it. Using a RESTful api with something like JSON is a relatively common method for this.
For the database, it depends on your needs, if you need a true relational database then something like MySQL, PostgreSQL, SQL Server, Oracle, etc. will work. You can also look at Google's BigTable or Amazon's SimpleDB to store data for non-relational data stores, and write your RESTful services on those.
This article has an example of integrating the iPhone with Flikr using their REST services and JSON.
http://iosdevelopertips.com/networking/iphone-json-flickr-tutorial-part-1.html
I think RESTKit provides seamless integration with SQLite in addition to being a nice REST client. There's also RESTframework if you're looking for something simple to use.