June 10, 2020

What is REST(Representational State Transfer)


❑ REST(Representational State Transfer)
❍ Communication way of client↔server.
클라이언트↔서버의 통신 방식.
❍ An architecture style (type) for the purpose of communication using URI and HTTP.
URI와 HTTP를 이용한 통신 목적의 아키텍처 스타일(유형).
* URI(Uniform Resource Identifier): Name for identifying resources such as pictures, documents and videos.
그림, 영상 등의 자원 식별용 이름.
* Architecture style(아키텍처 스타일): Type of architecture(structure). 아키텍처(구조)의 종류(유형, 스타일, 타입).
e.g.
Client-Server(클라이언트/서버)
Repository(저장소)
Pipe/Filter(파이프/필터)
REST.

❑ RESTful: REST applied system.
REST가 적용된 시스템.

❑ REST API: REST applied API.
REST가 적용된 API.

❑ The system that provides REST API is RESTful.
REST API를 제공하는 시스템은 RESTful이다.




To be precise, REST should satisfy the following conditions.
정확하게는, REST는 아래 조건을 만족해야 한다.

1. Uniform interface: It conforms to the interface specified by URI use, HTTP method use, RPC not called, etc.

1. 일관된 인터페이스(Uniform interface): URI 사용, HTTP 메소드 사용, RPC 미호출 등으로 지정된 인터페이스를 준수한다.



2. Client-Server: The client sends a request message to the server, and the server sends a response message about the request.

2. 클라이언트/서버(Client-Server): 클라이언트는 서버에 요청(request) 메시지를 전송하고 서버는 요청에 대한 응답(response) 메시지를 전송한다.



3. Statelessness: Communication is possible without a previous situation(context) such as a session.

3. 비연결성(Statelessness): 세션 등 이전 상황(문맥) 없이도 통신할 수 있다.



4. Cacheable: The server's response message can be cached (stored and reused).

4. 캐시 가능(Cacheable): 서버의 응답 메시지는 캐싱(저장 후 재사용)될 수 있다.



5. Layered system: Roles are separated by hierarchy. Therefore, even if roles (load balancing, authentication, etc.) are added/removed in the middle, communication is not affected.

5. 계층화된 시스템(Layered system): 계층별로 기능이 분리된다. 그러므로 중간에 기능(로드 밸런싱, 인증 등)이 추가/제거되어도 통신에 영향을 주지 않는다.



6. Code on demand(option): For easy data processing, the server can send a script to be executed on the client.

6. 주문형 코드(Code on demand)(선택): 손쉬운 데이터 처리를 위해 서버는 클라이언트에서 실행될 스크립트를 전송할 수 있다.