Yani A.
Posted on March 12, 2022
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.
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, SELECT
s 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, DELETE
s 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!
Posted on March 12, 2022
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.