May 2, 2021
CRUD is an essential acronym that models the life cycle of the objects in an application. Since these phases cover most of the application features, it is valuable to grasp the idea behind CRUD.
There are four main actions that form CRUD:
In this guide, we will go over some sample pages and explore CRUD operations they perform.
Almost all applications have object creation features like post sharing, task create and sign-up.
Even though the resulting objects have different types (for example,
Account), the concept is the same; objects are created with respect to the user input and stored in the database for future use.
Since read operations don't require any user input, it might be harder to identify them. Read actions are commonly used in two patterns:
Read a single tweet
Read a set of tweets
Update operation works on existing instances to change one or more fields.
Since Twitter doesn't allow editing
Tweet instances, we will use profile editing to demonstrate the update method.
As we can see from the screenshot, an update operation can take files (for example,
profile image and
profile banner) or plain text inputs (for example,
bio) to modify existing objects.
Deletion is the last phase of an object's life cycle.
Services might remove instances completely, mark them as deleted or move them to trash. As a result, deleted instances are expected to be hidden from the users.