Lennart
Lennart

Reputation: 35

Are there any known negatives to using Requests in Flask to interface to Cloudant on Bluemix?

I am writing an app in Python Flask that makes use of the Python HTTP library Request to interface with Cloudant on Bluemix. It is an easy interface that allows me to directly access the Bluemix VCAP information for Cloudant and of course the Cloudant API. However it does not make use of the CouchDB package, which seems to be the most popular way to inteface to Cloudant.

Are there negatives in staying with Request as I scale up, and if so what would they be?i

Upvotes: 2

Views: 155

Answers (1)

Chris Snow
Chris Snow

Reputation: 24596

The main advantage of using a Cloudant/CouchDB library is that you write less code. This can be significant in languages like Java where Rest and JSON handling is very cumbersome. However working with Rest and JSON in python using standard libraries is very easy.

However, the main disadvantages of using a Cloudant/CouchDB library are:

  1. you have less control over the interaction with Cloudant which may make things like session management and http connection pooling much harder.
  2. You don't get to learn the Cloudant API as this is abstracted away from you by the library.
  3. Some libraries allow you do to things which can be problematic for scalability such as py-couchdb's functionality for creating temporary views.
  4. Libraries may not implement the full Cloudant API so you may end up having to make Rest/JSON calls to access these features not implemented by the library.

Upvotes: 4

Related Questions