DEV Community

Cover image for What in the CRUD?
Yani A.
Yani A.

Posted on

What in the CRUD?

The title is also what I would be swearing under my breath when I couldn’t get a CRUD function to work.

What are CRUD functions? When do we utilize them? How do we make them work?

In this blog, I go back to the basics and try to answer all these questions about what CRUD is.

Oh CRUD!

So, what is CRUD?

CRUD stands for:

  • Create
  • Read
  • Update
  • Delete

According to Sumologic's glossary, CRUD refers to an acronym that refers to the four functions mentioned above, that are necessary to implement a persistent storage application.

Referring to the example in Altvater, A.'s article in Stackify by Netreo, Create performs the INSERT statement to create a new record. While Read, SELECTs the table's records based on the primary keynoted within the input parameter. Update executes an UPDATE statement on the table based on the specified primary key for a record within the WHERE clause of the statement. DELETE, DELETEs a specified row in the WHERE clause.

In addition, each letter in CRUD can also be mapped to an HTTP protocol method, where:
CREATE = POST
READ = GET
UPDATE = PUT
DELETE = DELETE

Why is CRUD important?

Can you recall any of these functions you used in your projects? Did you need all of them, or just one? What's the significance of each depending on what you want to do in your app? Just in case you need a refresher, here's a quick tutorial by Johnson, J. of BudiBase on "How to Build a CRUD Application".

CRUD operations are essential for both developers and end-users as it provides security control, for one. With this in mind, it is more performant versus SQL statements. Unquestionably, it's tried and tested, as it's a recognized pattern and recognizable by most developers.

Conclusion

I hope this was a comprehensive resource to better understand what CRUD is, and you can better implement it in your future projects!

Get set, get ready, CODE!

Top comments (0)