官术网_书友最值得收藏!

Characteristics of REST services

These are the main properties that make REST simple and unique compared to its predecessors:

  • Client-server based architecture: This architecture is most essential for the modern web to communicate over HTTP. A single client-server may look naive initially, but many hybrid architectures are evolving. We will discuss more of these shortly.
  • Stateless: This is the most important characteristic of a REST service. A REST HTTP request consists of all the data needed by the server to understand and give back the response. Once a request is served, the server doesn't remember if the request has arrived after a while. So the operation will be a stateless one.
  • Cacheable: Many developers think a technology stack is blocking their web application or API. But in reality, their architecture is the reason. The database can be a potential tuning piece in a web application. In order to scale an application well, we need to cache content and deliver it as a response. If the cache is not valid, it is our responsibility to bust it. REST services should be properly cached for scaling.
  • Scripts on demand: Have you ever designed a REST service which serves the JavaScript files and you execute them on the fly? This code on demand is also the main characteristic REST can provide. It is more common to request scripts and data from the server.
  • Multiple layered system: The REST API can be served from multiple servers. One server can request the other, and so forth. So when a request comes from the client, request and response can be passed between many servers to finally supply a response back to the client. This easily implementable multi-layered system is always a good strategy for keeping the web application loosely coupled.
  • Representation of resources: The REST API provides the uniform interface to talk to. It uses a Uniform Resource Identifier (URI) to map the resources (data). It also has the advantage of requesting a specific data format as the response. The Internet Media Type (MIME type) can tell the server that the requested resource is of that particular type.
  • Implementational freedom: REST is just a mechanism to define your web services. It is an architectural style that can be implemented in multiple ways. Because of this flexibility, you can create REST services in the way you wish to. Until it follows the principles of REST, your server has the freedom to choose the platform or technology. 

 Thoughtful caching is essential for the REST services to scale.

主站蜘蛛池模板: 临朐县| 察隅县| 都昌县| 竹溪县| 明星| 常山县| 洞口县| 乌鲁木齐市| 阳新县| 建昌县| 温州市| 南安市| 张家港市| 无为县| 博兴县| 额济纳旗| 巴林右旗| 吕梁市| 社旗县| 锡林郭勒盟| 达日县| 聊城市| 南宁市| 陇川县| 当阳市| 乐至县| 简阳市| 屏东市| 江山市| 钦州市| 江陵县| 正定县| 咸阳市| 武义县| 崇州市| 景洪市| 龙岩市| 罗源县| 平昌县| 思南县| 鄱阳县|