Create, read, update and delete (CRUD) are the four basic functions of persistent storage[1], a major part of nearly all computer software. Sometimes CRUD is expanded with the words retrieve instead of read or destroy instead of delete. It is also sometimes used to describe user interface conventions that facilitate viewing, searching, and changing information; often using computer-based forms and reports.
Alternate terms for CRUD (one initialism and three acronyms):
The acronym CRUD refers to all of the major functions that need to be implemented in a relational database application to consider it complete. Each letter in the acronym can be mapped to a standard SQL statement:
Operation | SQL |
---|---|
Create | INSERT |
Read (Retrieve) | SELECT |
Update | UPDATE |
Delete (Destroy) | DELETE |
Although a relational database is a common persistence layer in software applications, there are numerous others. CRUD can be implemented with an object database, an XML database, flat text files, custom file formats, tape, or card, for example.
Google Scholar lists the first reference to create-read-update-delete as by Kilov in 1990[2][3] The concept seems to be also described in more detail in Kilov's 1998 book [4][5]
CRUD is also relevant at the user interface level of most applications. For example, in address book software, the basic storage unit is an individual contact entry. As a bare minimum, the software must allow the user to:
Without at least these four operations, the software cannot be considered complete. Because these operations are so fundamental, they are often documented and described under one comprehensive heading, such as "contact management" or "contact maintenance" (or "document management" in general, depending on the basic storage unit for the particular application).
One of useful free tool on Internet is Shine CRUD [6], which helps all the developers to create a simple class in PHP code using the common PEAR libraries.