CRUD
Short for create, read, update and delete, the four basic things you can do to stored data.
In more detail
In a REST API they usually map to POST on a collection, and GET, PUT or PATCH, and DELETE on an item. Many real operations, such as publishing, approving or exporting, do not fit the four and are better modelled as state transitions or job resources.
Example
In the APIs course: The course stresses that the mapping is a starting point: real work such as completing a task or running an export does not fit it and is better modelled as a state transition or a job resource.Related terms
- HTTP method — The verb at the start of a web request that says what the client wants, such as GET to read or POST to create.
- state transition — A change of a resource from one state to another, such as a task moving from open to done, modelled as its own resource.
- job resource — A resource that represents long-running work, answered with 202 Accepted and a Location the client can poll for progress and the result.
- DTO — A plain object whose only job is to carry data across a boundary, such as the body of an API request or response.
- repository pattern — Putting all the code that reads and writes one kind of data behind a single object, so the rest of the app never talks to the database directly.
Taught in
- HTTP Methods And Status Codes — Modern API Architecture: REST, GraphQL & gRPC
- Actions That Do Not Fit CRUD — Modern API Architecture: REST, GraphQL & gRPC
- Generic Interfaces, Classes And Type Aliases — Production TypeScript
- Core Utilities: Partial, Required, Readonly, Pick And Omit — Production TypeScript