The advantages of REST

Typically, there could be many interactions between requesting and serving services to fulfill a business process and, hence, the communication among different and distributed microservices has to happen fast with less overhead. REST is mandated to have less latency networks for speedier service requests and fulfillment, which makes REST APIs a good fit. REST APIs not only support XML and JSON, but also support more optimized binary representation formats, such as a protocol buffer or Avro. Further on, it can upgrade to HTTP/2.0. Billions of people across the globe use the web for a variety of purposes. There are millions of developers creating a variety of web applications. Thus, a competent web architecture is needed to fulfill the varying requirements of businesses and people. In short, the powerful REST paradigm helps to build software architectures and applications that implicitly inherit all the praiseworthy qualities of the web. RESTful services bring forth a few important capabilities, such as greater scalability, efficient network use, and the independent functioning of clients and servers.

The REST paradigm inherently supports the ROA. Everything, as per the REST specifications, is a resource. Software architectures are typically a combination of several configurable architectural elements. In the case of REST, the principal architectural elements are components, connectors, resources, representations, and a few data elements. Resources are the building blocks of RESTful APIs. A resource can be anything that an application wants to expose on the network for other applications to find and operate through various HTTP methods. It can be text content, images, video and audio, a white paper, or a bank account. These resources are linked together by embedding the respective hyperlinks in HTML documents. Note that the resources can be retrieved, updated, and deleted by both humans and software programs. The following diagram illustrates this and shows the potential relationships between distributed and different resources via hyperlinks:

To unambiguously find and use them, each resource has to be given a unique name, which is called a URI. A sample URI is http://www.paris.fr/weather. As indicated in the preceding diagram, a resource can expose its state through the concept of representation. A representation typically contains both metadata (such as resource size, media type, or character set) and content (binary image or text document). The representation varies significantly. For example, the representation of a confirmation of purchase on an e-commerce site could be an HTML document. For a wedding picture, the representation could be a JPEG image streaming. For a contact in an address book web service, it could be an XML file. Thus, it starts with the resource identification and there's a corresponding representation for each resource identified.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.191.22