What is CRUD?

What is CRUD?

CRUD refers to the four basic operations a software application should be able to perform – Create, Read, Update, and Delete.

In such apps, users must be able to create data, have access to the data in the UI by reading the data, update or edit the data, and delete the data.

In full-fledged applications, CRUD apps consist of 3 parts: an API (or server), a database, and a user interface (UI).

The API contains the code and methods, the database stores and helps the user retrieve the information, while the user interface helps users interact with the app.

You can make a CRUD app with any of the programming languages out there. And the app doesn’t have to be full stack – you can make a CRUD app with client-side JavaScript.

In fact, the app with which I will be showing you how create, read, update and delete operations work is made with client-side JavaScript.

Each letter in the CRUD acronym has a corresponding HTTP request method. | CRUD Operation| HTTP Request Method| | ----------- | ----------- | | Create| POST | | Read | GET| | Update| PUT or PATCH| | Delete | DELETE|

What is the CREATE Operation and How Does it Work?

In CRUD, the create operation does what the name implies. It means creating an entry. This entry could be an account, user information, a post, or a task.

As I pointed out earlier, the HTTP protocol that implements a CREATE operation is the POST method.

In a SQL database, to create is to INSERT. In a NoSQL database like MongoDB, you create with the insert() method.

What is the READ Operation and How Does it Work?

The READ operation means getting access to the inputs or entries in the UI. That is, seeing it. Again, the entry could be anything from user information to social media posts, and others.

This access could mean the user getting access to the created entries right after creating them, or searching for them. Searching is implemented to allow the user to filter out the entries they don’t need.

The HTTP protocol that implements a READ operation is the GET method.

In a SQL database, to read is to SELECT an entry. In a NoSQL database like MongoDB, you read with the find() or findById() method.

What is the UPDATE Operation and How Does it Work?

UPDATE is the operation that allows you to modify existing data. That is, editing the data.

Unlike READ, the UPDATE operation alters the existing data by making changes to it.

PUT and PATCH are the HTTP protocols with which you can implement an UPDATE operation, depending on what you need.

PUT should be used when you want the entire entry updated, and PATCH if you don’t want the entire entry to be modified.

In a SQL database, you use UPDATE to update an entry. In a NoSQL database like MongoDB, you can implement an update feature with the findByIdAndUpdate() method.

What is the DELETE Operation and How Does it Work?

To delete is to get rid of an entry from the UI and the database.

DELETE is the HTTP protocol for implementing a DELETE operation.

In a SQL database, DELETE is used to delete an entry. In a NoSQL database like MongoDB, you can implement delete with the findByIdAndDelete() method.

To view or add a comment, sign in

More articles by NISHI KUMARI

  • Spark Session vs. Spark Context

    In Apache Spark, an entry point is the gateway to its distributed computing capabilities, connecting your application…

  • What Is Basel III?

    Basel III Endgame is the last stage of U.S.

  • What Is Fraud Detection?

    Fraud detection using machine learning involves using AI algorithms to analyze data and identify patterns that suggest…

  • What is Anomaly Detection?

    Anomaly Detection, additionally known as outlier detection, is a technique in records analysis and machine studying…

  • What Are Performance Metrics?

    Performance metrics are data and calculations that businesses use to track activities, behaviors and capabilities…

  • What is Model Validation and Why is it Important?

    The process that helps us evaluate the performance of a trained model is called Model Validation. It helps us in…

  • Automation Testing

    What is Automation? Before starting with Automation Testing, let’s first understand the term – “automation”. Automation…

  • Programmer Analyst

    A programmer analyst is a professional who combines the roles of a programmer and a systems analyst. They are…

  • What is Treasury Data Analytics?

    Treasury data analytics is the practice of using data analysis techniques to gain insights into a company’s treasury…

  • Data Modeler

    Data modelers are systems analysts who work with data architects and database administrators to design computer…

Insights from the community

Explore topics