Sobes.tech
Junior

What is REST-oriented architecture (ROA)?

sobes.tech AI

Answer from AI

REST-oriented architecture (Representational State Transfer) is an architectural style for distributed systems based on a set of principles that define how resources are identified and how interaction occurs between client and server.

Main principles of REST:

  1. Client-Server: Separation of concerns. The client handles the user interface, and the server manages data storage and processing.
  2. Stateless: Each request from the client to the server must contain all the information needed for processing. The server does not store client state between requests.
  3. Cacheable: Clients and intermediate nodes can cache server responses to improve performance and scalability.
  4. Uniform Interface:
    • Resource identification: Resources are uniquely identified via URLs.
    • Manipulation of resources through representations: Clients can manipulate resources using representations (e.g., JSON, XML).
    • Self-descriptive messages: Each message contains enough information to understand how to process it.
    • Hypermedia as the Engine of Application State (HATEOAS): Clients interact with the application solely through hypermedia links provided in server responses.
  5. Layered System: The system can be organized into layers (e.g., proxies, gateways), and each component only sees the next layer it interacts with.
  6. Code-On-Demand (optional): The server can temporarily extend client functionality by transferring executable code (e.g., JavaScript).

In QA, testing REST API includes verifying adherence to these principles, as well as:

  • Functional testing (HTTP methods GET, POST, PUT, DELETE).
  • Load testing.
  • Security testing.
  • Compatibility testing (various data formats, clients).