All You Need Is CRUD?

all you need is crud

 

Believe it or not, everything is essentially CRUD on the internet. It is the hidden skeleton that supports all of our digital interactions.

What is CRUD?

First of all, let’s get the jargon out of the way. CRUD stands for Create, Read, Update, and Delete — the four basic operations performed on data in a database or application.

It’s not just about data entry forms or database management; CRUD operations are embedded in nearly every feature and action we perform in applications, including those that might seem more complex at first glance.

Let’s start with an example.

SAP is a massive CRUD

During my years in grad school, I had the pleasure (or displeasure) to use SAP ERP system The first time I launched SAP (back when it was still a Windows app), I was struck by its overwhelming number of datagrids. And not just a few — TONS of them, all intricately linked.

SAP interface with datagrids

Imagine navigating through this cluttered interface — it’s a German product, after all!

Despite its chaotic appearance, SAP’s core is packed with datagrids. These datagrids with columns and rows are fundamentally tied to CRUD operations (Create, Read, Update, Delete). They ensure that managing vast amounts of data is both efficient and intuitive, thanks to CRUD’s reliable framework.

SAP has improved is UI over the years, but datagrid still play an essential role at its core.

When there is datagrid, there must be CRUD (Create, Read, Update, Delete).

HTTP verbs are CRUD

Now, let’s talk about something you might use every day without realizing its connection to CRUD — HTTP verbs.

HTTP verbs (or methods) GET, POST, PUT, DELETE, and PATCH are essentially aligned with CRUD operations because they map directly to the fundamental actions required to manage resources in a web application.

Image credit: useful-web

Here’s how each HTTP verb corresponds to CRUD:

1. GET → Read

  • GET is used to retrieve data from a server, which corresponds to the Readoperation in CRUD. For example, when you visit a webpage or query an API to fetch information, the server processes a GET request to retrieve and return the requested data.

2. POST → Create

  • POST is used to send data to the server to create a new resource. This aligns with the Create operation in CRUD. For instance, submitting a form to create a new user account or adding a new item to a database typically involves a POST request.

3. PUT → Update

  • PUT is used to update an existing resource on the server. This corresponds to the Update operation in CRUD. PUT requests typically involve sending the complete updated resource to the server, which then replaces the existing resource with the new version

4. DELETE → Delete

  • DELETE is used to remove a resource from the server, which directly aligns with the Delete operation in CRUD. When a DELETE request is sent, the specified resource is removed from the server, reflecting the removal of a record in a database.

By designing HTTP verbs around CRUD concepts, web APIs can manage resources in a way that is both intuitive for developers and effective for data manipulation, maintaining consistency across different systems.

Not Convinced? Let’s Dig Deeper

You might be thinking, “Okay, there are lots of CRUDs, but does that really mean everything is CRUD?” You might argue that complex applications like Facebook or YouTube don’t fit into this model. Or do they?

Why Facebook is also just a CRUD

Post image

In 2016, Anatoly Lubarsky reverse-engineered Facebook’s database schema, revealing that at its core with user data is stored in relational databases, and CRUD operations manage and retrieve this data.

Whether it’s creating posts, reading news feeds, updating profiles, or deleting content, CRUD operations ensure data is consistently handled in the background, even as the complex processes remain invisible to the user.

Facebook’s Database reverse engineered by Anatoly Lubarsky

Users interact with the platform by creating posts, reading news feeds, updating profiles, and deleting content, all of which are underpinned by CRUD operations that ensure the data is consistently stored, retrieved, and modified in the database, while the complex backend processes remain invisible to the user.

Let’s break it down:

1. FB User Login

  • Read: When you log in to FB, the system reads (R) your input credentials (username and password) from the database to verify your identity.
  • Update: The system might update (U) the last login timestamp or session information in the database once you’re authenticated.
  • Create: If you log in for the first time or create a session, the system might create © a new session record.
  • Delete: Old session data or failed login attempts might be deleted (D) as part of maintaining security.

2. Reading FB posts

  • Read: Search operations are primarily about reading (R) data. When you search for something, the system queries the database and reads the relevant records that match your search criteria.
  • Create/Update/Delete: Though less obvious, search engines also involve creating, updating, and deleting indexes in the background to ensure fast and accurate results. For instance, when new content is added or updated on a platform, search indexes are updated (U) or new entries are created ©. When content is removed, those indexes are deleted (D).

3. Updating Profile

  • Updating profiles is a CRUD operation because it involves modifying existing data in the database. When a user changes their profile information, the system updates the corresponding record in the database

Still not convinced?

Let’s take a look at YouTube.

YouTube: A CRUD Classic

Post image

YouTube is actually a great example of a CRUD application. Here’s how YouTube fits into this model:

  1. Create
    Uploading Videos:
    Users can create content by uploading videos. This involves adding a new video record to the YouTube database, including metadata like the title, description, tags, and thumbnail.
  2. Read
    Watching Videos:
    The core functionality of YouTube is allowing users to read (consume) content. This involves retrieving video data from the database and streaming it to the user.
    Searching and Browsing: Users can search for videos, browse recommendations, and view playlists, all of which involve reading data from YouTube’s servers.
     
  3. Update
    Editing Videos:
    Users can update the metadata of their videos, such as changing the title, description, or privacy settings.
    Managing Playlists: Users can update their playlists by adding or removing videos, changing the order, or editing the playlist title and description.
     
  4. Delete
    Deleting Videos: Users can delete their videos, which removes the video and its associated data from YouTube’s database.
    Removing Content from Playlists: Users can also delete videos from playlists or remove entire playlists.

The Myth of Non-CRUD Operations

What I heard the most is that people would say, “My application has non-CRUD operations,” usually referring to complex functionalities that go beyond basic data management, such as real-time data processing, advanced analytics, complex business logic, or workflow automation, which involve more than just creating, reading, updating, or deleting records in a database.

Or are they?

CRUD in disguise

Datagrid is a CRUD, but not all CRUDs are datagrids. CRUD could have many forms and faces.

Even in situations involving complex functionalities like real-time data processing, advanced analytics, or workflow automation, CRUD operations are still essentially everywhere. These advanced features still rely on the underlying ability to create, read, update, or delete data as they interact with databases or data stores.

1. Real-Time Data Processing:

  • In a real-time data system such as stock trading platform that processes real-time data, CRUD operations are still involved. For instance, the system createsnew trade records when transactions occur, reads real-time market data to display to users, updates users’ portfolios with the latest values, and deletesoutdated or canceled orders. While the processing might be complex, the data handling at its core is still CRUD-based.

2. Advanced Analytics:

  • In a business intelligence tool that performs advanced analytics, CRUD operations are essential. The tool creates datasets based on user queries, readslarge volumes of data from various sources, updates dashboards with the latest analysis results, and deletes outdated reports. The sophisticated algorithms and visualizations rely on CRUD to manage and display the underlying data effectively.

3. Workflow Automation:

  • When you automate a workflow, what’s really happening? The system createsnew tasks, reads existing data (because it’s nosy like that), updates the status as things move along, and deletes anything that’s done or obsolete, kind of like cleaning out your closet but with data instead of last season’s shoes. So no matter how complex or high-tech the automation gets, at its core, it’s just CRUD — on autopilot, and maybe with a little more flair.

4. Machine Learning Applications:

  • In a machine learning platform, CRUD operations are involved in managing training datasets and model results. Even though machine learning is a mystical dance of algorithms and data, it’s still fueled by the trusty old CRUD operations — because even fancy AI models need their data served fresh, updated, and occasionally deleted.

Even though the applications may perform sophisticated tasks, add, read, update, delete operations are still the backbone of any data management system. CRUD remains essential to ensure that the application’s complex functionalities can operate effectively.

The list goes on and on.

Once You Spot CRUD, You’ll Start Seeing It Everywhere!

Once you understand how CRUD works, you’ll start recognizing its patterns in all kinds of software.

These four magic letters are so fundamental to data management, it quietly powers a wide variety of interactions — even ones that don’t seem obvious at first glance. The more familiar you are with this concept, the easier it becomes to see how deeply integrated it is in almost every digital system.

It’s like discovering the hidden building blocks behind the digital world.

All you need is CRUD!

Richard