My questions and understanding about REST API & SOAP API

  1. What is REST architecture? It is used in distributed system. There are many other architectures can be used in distributed system depending on different context. If use REST architecture to design our software, tool or web service, HTTP protocol needs to be used. The interface of the server application needs to be designed as REST API.
  2. REST API is an API backed by REST architecture.
  3. SOAP API is a protocol which has specific standard.
  4. Web API can use REST API or not.
  5. About web service:
    UI is for human to interact with the web service and REST API or SOAP API is for an application to interact with another application.
    Web is to provide access/interface of resource. The key point of web architecture is resource involving three operations which are identify, represent, and interact with. URI (URL and URN) to identify resource, html, xml, images, and videos to represent resource, HTTP, FTP to interact with resource.
  6. We can choose either one to design the API or sometimes they are combined together to get the job done better.
  7. Even though REST is widely used today, it has drawbacks. Is security the biggest problem the REST has.
  8. REST is very data-driven, compared to SOAP, which is strongly function-driven. REST is used when clients are able to manipulate CRUD operations themselves while SOAP is used when clients are only allowed to propose their request like bank customers only be able to request to transfer money but not be able to deduct the money in the bank database themselves.
  9. SOAP is a protocol and has to use XML format data (not html, maybe data from database or Uri).
    REST style uses HTTP protocol and can use different ways to format data like XML, YAML, or any other format that is machine-readable, but usually JSON is most widely used. REST follows the object-oriented programming paradigm of noun-verb. REST is very data-driven, compared to SOAP, which is strongly function-driven. You may see people refer to them as RESTful APIs or RESTful web services. They mean the same thing and can be interchangeable. REST is a good option for public APIs.

Reference:
https://martinfowler.com/articles/richardsonMaturityModel.html
https://www.soapui.org/learn/api/soap-vs-rest-api/
https://www.zhihu.com/question/28557115
https://www.cnblogs.com/zhangz721/archive/2009/10/02/1577316.html
https://dzone.com/articles/comprehensive-guide-rest-vs-soap
https://dzone.com/articles/difference-between-rest-and-soap-api#:~:text=Differences%3A,based%20on%20HTTP%20and%20XML
https://keetmalin.wixsite.com/keetmalin/post/2017/09/27/distributed-system-architectures-and-architectural-styles