CRUD represents the four core operations performed on data in any application.
In simple words
If an app works with data
It is using CRUD in some form π
CRUD stands for
β’ Create β
β’ Read π
β’ Update βοΈ
β’ Delete ποΈ
Without CRUD β
No user data
No posts
No dashboards
No real application
π Real World Examples
β’ Creating an Instagram account β
β’ Reading posts on feed π
β’ Updating profile details βοΈ
β’ Deleting a comment ποΈ
π CRUD in Backend Flow
Client sends request π
Server processes logic π§
Database performs operation ποΈ
Response sent back to client π©
π» Simple Example using Node and Express
// CREATE
app.post("/users", (req, res) => {
res.send("User created");
});
// READ
app.get("/users", (req, res) => {
res.send("Users fetched");
});
// UPDATE
app.put("/users/:id", (req, res) => {
res.send("User updated");
});
// DELETE
app.delete("/users/:id", (req, res) => {
res.send("User deleted");
});