2 min readSep 1, 2021
What is CRUD and REST?
I’ll be going over the basics of CRUD and REST. CRUD is an acronym for four basic operations: Create, Read, Update and Delete. CRUD also deals with the database side of things. I’ll be using a bakery for my example.
- Create: This can create a new database or an assortment of cupcake flavors.
- Read: This will be able to fetch information from the database, which will allow us to display the marvelous flavors.
- Update: This will update or adjust a specific record in the database, meaning you can change a flavor or the description of the spectacular flavor.
- Delete: This will allow you to delete an item from the database, permanently. Relating to the bakery will allow you to delete a boring flavor, for whatever reason.
Awesome, now let’s move on to REST. While rest is something I clearly lack, it also means Representational State Transfer. REST is a popular design style for developing web APIs. REST uses resources and routes to get the information.
- GET: This will allow us to get the information from the resource request URL. A customer would be able to view the flavors available.
- POST: This will let us fetch a create a new resource. A customer could make an order for some cupcakes.
- PATCH/PUT: This will change a new resource based on what the request is. A customer could edit the order but still be within the limitations that the database provides.
- DELETE: And just like CRUD this will delete a resource, permanently. A customer could delete an order, but not a flavor itself.
In the end, CRUD and REST can do similar things, the main difference is one involves the databases and the other is more involved with the resource and routes.