What the CRUD?

What the CRUD?

Introduction

In my previous blogs, I have talked about back-end development, how to set up your local development environment for Typescript backend development, etc. In this blog, I will introduce you to the concept of CRUD, which is essential knowledge you should have as a server-side developer. This is going to be a concise blog, so without any further ado, let's start...

So, what is CRUD?

CRUD stands for Create, Read, Update, and Delete.

These are the most basic functions you would have to carry out as a server-side developer. All these functions are directly related to Database management. These functions are used to store and manipulate data in a back-end database. Let's go through these functions one by one.

CREATE

The create function is used to add new data to the database. For instance, let's assume that we are making the back end for a social media application. We need to make a user authentication system for this application. Whenever a new user registers for our application, we need to store that user's data inside our database. So, we are creating a new user data record in our database. Therefore, we call this the CREATE operation. Concerning HTTP requests, this is carried out using the POST request.

READ

The read function is used when we want to display or return some existing data from the database. The data returned is a response to a client request. Taking reference from the social media application example, when the user opens up their home page, they are greeted with all the recent posts made by the people they are following. So, when the home page opens up, the client makes a GET HTTP request to the server to help the end user read the data based on their requirements.

UPDATE

The update functionality is used when we want to modify existing data in the database. Say, for instance, the user of our social media application wants to change certain data on their profile, so what do they do? They make a request to the server with the required changes and the server updates the required data record in the database. The HTTP request associated with this functionality is the PUT request.

DELETE

The delete functionality is used when we want to delete any existing data in the database. Let us consider our user wants to delete their account permanently from our social media application. So the client application makes a DELETE request to the server, which deletes the required data record.

Conclusion

This brings us to the end of this blog. In this blog, we have learned about the simple concept of CRUD. It may be simple but it is essential as any server-side application deals with querying databases. And when dealing with databases, you need to carry out these functions almost all of the time. Therefore it is essential to learn what these functions represent.


Keep Learning, and follow me in my socials: