In the software development perspective, CRUD is basically the four operations (create, read, update, and delete) of data storage, regarded collectively.

  • Create: This operation would create a brand new entity. In terms of database, this corresponds to the INSERT statement.
  • Read: This operation would read something from the database and would not make any permanent changes to the database.
  • Update: This operation would change the values of an already existing entity.
  • Delete: This operation would delete an entity from the database.

CRUD in action

The operation we are performing during each route action is listed below:

VERBURI PatternController#ActionUsed forOperation
GET/booksbooks#indexList booksREAD
POST/booksbooks#createCreate a bookCREATE
GET/books/newbooks#newForm for a new bookREAD
GET/books/:idbooks#editForm for editing bookREAD
GET/books/:idbooks#showShow info about bookREAD
PATCH/books/:idbooks#updateUpdate info about bookUPDATE
PUT/books/:idbooks#updateUpdate info about bookUPDATE
DELETE/books/:idbooks#destroyDelete info about bookDELETE

As we can see each of those seven actions could be assigned to one of these four operations - Create, Read, Update and Delete.

REST and CRUD

REST is an architectural system that deals with data through HTTP protocols. You can read more about REST style here.

Typically software applications create RESTful APIs to handle CRUD operations. You can read more about CRUD operations here

There aren't any changes to the application in this chapter. So let us clean up any accidental changes.

1git clean -fd
⌘K
    to navigateEnterto select Escto close
    Previous
    Next