REST is not CRUD

Many developers think of REST and CRUD as equivalent. This belief might stem from the Wikipedia article on CRUD , which contains the following table providing a mapping from SQL statements to HTTP methods:

Operation SQL HTTP
Read (Retrieve) SELECT GET
Update (Modify) UPDATE PUT / PATCH
Delete (Destroy) DELETE DELETE

This table has been widely copied in computing literature. I found it almost verbatim on page 418 of the O'Reilly book Weniger schlecht programmieren (literally, Programming less worse ) by Kathrin Passig and Johannes Jander, released in 2013:

  • Create: POST
  • Read: GET
  • Update: PUT und PATCH
  • Delete: DELETE

Explaining the history of the web framework Ruby on Rails , booldog once told me that this kind of confusion stems from the naive association here are four verbs, there are four verbs ( HTTP PATCH was invented in 2010 ).

This error in reasoning is structurally similar to american programmers thinking of text as ASCII text and therefore of characters as bytes octets – or swedish programmers assuming a character always fits in three octets .

Thinking of REST and CRUD as equivalent does not take into account that relational database operations act on a set of records, while HTTP methods act on a single resource (that may represent a collection). This difference results in fractures in interpretation as information flows across abstraction boundaries , yielding interoperability and security problems.

The existence of differences between REST and CRUD implies that thinking of REST and CRUD as equivalents hampers understanding:

Attempts, however well-intentioned, to explain one by analogy with the other run a great risk of increasing confusion rather than clearing it. If you are considering using such an analogy, please think twice.