When not to use the REST API?

The REST API is always seen as an infrastructure goal. I am not an expert, but I realized that the principles that they must comply with are horizontal scaling and performance. They must suppress all forms of intimacy between customers and services (no session, etc.). The REST API is rarely considered from a business perspective.

Last week, one of the team suggested introducing part of the legacy application as a REST API. This application was previously embedded as a library (.NET) in every application that requested it. The REST API quickly suffered from performance issues (too many trips between the client and server). As a workaround, caching was implemented (server-side). In my opinion, this violates the principles of REST. Without caching, we should have many servers for one client for acceptable performance, with parallel requests or a load balancer (or something like this ...).

As we talk about APIs, I believe that such APIs should be driven by business needs. Based on your experience, are there business applications that are not suitable for REST?

[EDIT] The API is designed to simulate a workflow from records coming from a client ...

+4
source share
1 answer

As a workaround, caching was implemented (server-side). In my opinion, it violates the principles of REST.

In fact, using a cache is a REST restriction that you MUST follow. Field dissertation 5.1.4 Cache: http://www.ics.uci.edu/~fielding/pubs/dissertation/rest_arch_style.htm#sec_5_1_4 I suggest you read the entire dissertation (or at least a part of REST) ​​before any additional questions.

they must suppress all kinds of affinity between clients and services (no session, etc.).

REST, . , . .

API REST .

, API REST. . facebook, google, twitter .. API . Ofc. API , REST SOA, RPC , , .

- API REST. (.NET) .

REST - ( ), , . SOA , . DDD - () .

API REST ( ). ( ).

. , REST API , REST - , , REST , ( ). , , ofc. / - .

API REST?

, . REST , SOA -. , , . , , , REST HTTP req-rep pat, (-) .

REST - , , . . public facebook api, fb api , - .

- HTML- REST , . . (URL-, ..) (, HATEOAS). , , , HTML- , , JSON-LD. .

+7

Source: https://habr.com/ru/post/1609023/


All Articles