Chapter 6. REST APIs

Amazon had a hard time scaling functionality in different teams as the organization became reliant on shared access to several databases across teams. This frustrated the ability of a given team to change functionality without impacting others in the organization. So, as Amazon.com CTO Werner Vogels explained in 2006, all integration would be done in terms of APIs, not database calls.

This is an important first step in making the move to microservices: everything is an API. Representational State Transfer (REST) is far and away the most popular protocol supporting the web’s millions of APIs.

REST was originally advanced by Dr. Roy Fielding as part of his doctoral dissertation in 2000. Fielding helped define the HTTP specification and wanted to help illustrate how the web—an already proven, massively scalable, decentralized, failure-resistant fabric—could be used to build services. HTTP is an existence proof of the REST architecture’s merits.

Where previous approaches to distributed services (like CORBA, EJB, RMI, and SOAP) focused more or less on exposing an object-oriented interface and methods as a remotely accessible service (RPC), REST instead focuses on the manipulation of remote resources or entities. Nouns, not verbs. Entities, not actions.

Leonard Richardson’s Maturity Model

REST is all about exposing the mutations of business state with the verbs (GET, PUT, POST, DELETE, etc.) and idioms (HTTP headers, status codes, etc.) that HTTP already gives ...

Get Cloud Native Java now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.