Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

why use rest api in what scenario is REST better? NoSQL

There are now REST apis for Mongodb and redis.

I can connect to those databases with my language's driver.

Or I can use the REST api. I understand that the REST api is easier to grok, and easier to convert from language to language. But there's less features.

But is there any reason to use the rest api if I'm already doing fine with the language driver?

Thanks.

like image 619
Mark Avatar asked Jan 24 '11 22:01

Mark


2 Answers

In my opinion a RESTful API is useful when you have to integrate multiple different clients in heterogenous environments. It's also good when you need features that are already solved for HTTP – like caches or load-balancing.

like image 125
b_erb Avatar answered Nov 15 '22 04:11

b_erb


REST resources are supposed to capture use-cases of your application. I find it highly unlikely that an API to a database would do that for you. Mostly like the native language driver is the appropriate choice.

like image 27
Darrel Miller Avatar answered Nov 15 '22 04:11

Darrel Miller