When to use REST

Definition

The following list shows some prerequisites and scenarios that indicate if REST is an appropriate way to build your application:

Prerequisites

  • You have completely stateless services, for example, subsequent calls to the same REST service do not rely on a state kept at the server side. Only the transferred document and the (HTTP) method are used to identify the state. The client side keeps track of which steps have to be done next in an application scenario, but not the server side.

  • You can support and want to make use of (Web) caching infrastructures.

  • Your design is based on a point-to-point integration with a mutual understanding of the context and the content passed between client and server. Other than, for example, SOAP-based Web Services, REST client, and server do not have a formal description of an interface used between them. Clients and servers must agree on the schemas that describe the data being exchanged and on ways to process it meaningfully.

In addition, you should consider the following:

  • If the bandwidth is limited, then the overhead introduced by REST-based communication is usually lower than with other communication techniques.

  • Frontend technologies may be of specific interest for the communication architecture. REST services are easier to be integrated and consumed by frontend platforms if you use their technical basis (like XML or HTML) for building your application.