Bookmarks

CRUD — CRUD operations

Create, Read, Update, Delete

The four basic data operations: create, read, update and delete. The name comes from the first letters of those words.

Also: CRUD, create-read-update-delete, create, read, update and delete

checked 9 Nov

All terms

Any system that stores data can create it, display it, change it and delete it, and this minimal set is called CRUD. The term is used to describe an interface: a screen, module or API that does only this is called a “CRUD app”.

How the operations map to SQL and HTTP

OperationSQLHTTP method
CreateINSERTPOST
ReadSELECTGET
UpdateUPDATEPUT or PATCH
DeleteDELETEDELETE

The mapping between operations and methods is not rigid: POST on a resource can create it or trigger processing, PUT replaces the whole representation, and PATCH changes it partially; the choice depends on the intended semantics of the resource.

Where it appears

  • REST API design: a set of CRUD operations describes what can be done with a resource.
  • ORMs: every model has methods to create, fetch, change and delete records, and admin pages are often built by CRUD interface generators.
  • Access control: permissions are phrased as “create, read, change, delete”.

CRUD app

This is an application whose user interface boils down to forms and lists over a table, with no complex logic. In tutorials, a “to-do list with CRUD” is a typical first project.

Sources

the term is written from these pages

Verified 9 Nov

Not to be confused with

what it is mixed up with and how it differs

  • RESTREST

    REST is an API design style: resources, representations, caching; CRUD is just a set of operations on data.

In depth in the references

where the topic is covered in detail