Что такое crud приложение
Перейти к содержимому

Что такое crud приложение

  • автор:

What is a CRUD App and How to Build One | Ultimate guide

We use CRUD apps every day. Most of the time, without noticing. They keep us organized, they help digitise business processes, and they’re critical to application development. But many of us are oblivious to what CRUD apps are, or how to build one. Within this post, I am to provide you with a simple and straightforward guide to the world of CRUD apps. The guide is broken down into three sections:

What is a CRUD App

A CRUD app is a specific type of software application that consists of four basic operations; Create, Read, Update, Delete.

At a high level, CRUD apps consist of three parts; the database, user interface, and APIs.

Database

The database is where your data is stored. A database management system is used to manage the database. There are several different types of database management systems (DBMS) that can be categorized by how they store data; relational (SQL), Document (NoSQL). If you are deciding what DBMS to choose for your CRUD app, here’s a list of the 14 best database management systems . Going forward, our content will focus on SQL. SQL databases consist of tables. Tables consist of records. Records consist of fields. Fields consist of data.

User Interface

The user interface (UI) is what your users interact with. Due to the increasing popularity of applications, businesses are now prioritizing user interface design and user experience.

Finally, the APIs are how your application informs your database of what functions to perform. These functions can be modeled in different ways but they are designed to perform four basic CRUD operations; Create, Read, Update, Delete.

CRUD operations

As previously mentioned, there are four basic CRUD operations; create, read, update and delete. These four operations map to functions/statements, as seen in the following table:

OPERATIONS FUNCTIONS
Create Insert
Read Select
Update Update
Delete Delete

Each letter in CRUD can also be mapped to an HTTP protocol method:

OPERATIONS HTTP PROTOCOL
Create Post
Read Get
Update Put
Delete Delete

Let’s dive deeper into each of the CRUD operations. We’ve used a library management app as an example to help with learning.

Create

Create allows you to add new rows/records to a database/table. If the record does not exist, the create operation adds it to the database.

Recipe example

  1. Create/add a new book to our library management app

Read is the operation that allows us to see the recipe we just created. It does not alter data. It simply displays it. Read consists of a function that queries our database and fetches all our records, in this case, recipes. We can tailor our queries to pull back all recipes, or only recipes of a particular type (for example,, vegan recipes). We can also pull back a single recipe if we have a UID (unique identifier).

Recipe example

  1. View the books within our library
Update

Update is the operation that allows us to modify existing data and records within a table. We can update a single field within a record or multiple fields at once. It is also possible to update multiple records at once too.

Recipe example

  1. Update a book’s availability
Delete

Delete is the operation that allows us to remove records from a table.

Recipe example

  1. Remove a book from our library management system

Two additional basic CRUD app examples

Recipe app
  1. Create — Add a new recipe to my recipe app
  2. Read — View recipes in my recipe app
  3. Update — Update the carbonara recipe in our recipe app to use guanciale instead of bacon
  4. Delete — Remove the carbonara recipe from my recipe app
Project management app
  1. Create — Insert a new task in your project management tool
  2. Read — View all open tasks
  3. Update — Mark a task as ‘complete’
  4. Delete — Remove a task from your project management app

CRUD app ideas

If you want to get started and work on CRUD app ideas, this section provides you with some inspiration.

In general, whenever you see data storage there is potential for a CRUD app. From something as simple as a to-do list to complex software and apps.

CRUD use cases

There are several use cases for CRUD apps, including:

  • Event management app,
  • Student portal,
  • Sports club membership app,
  • Book club app,
  • Content marketing calendar,
  • OKRs app,
  • To-do app,
  • Project management app,
  • Applicant tracking system.
What are CRUD projects?

You can create CRUD projects in any application that requires data storage. They can range from a simple standalone table to complex projects with hundreds of interlinked tables.

Another interesting aspect is that many daily tasks are based around CRUD software even if users don’t realize it. For example, a spreadsheet containing your monthly finances uses CRUD operations.

That is, you can create, read, update and delete data from it.

CRUD platforms / frameworks / tech stacks

There are many, low code platforms, frameworks, or tech stacks that provide an effective workflow when creating CRUD apps. The following are options you might consider:

  • Budibase
  • Python and Django
  • LAMP — Linux, Apache, MySQL, PHP
  • Supabase and Next.js
  • MEAN — Mongo, Express, Angular, Node.js

How to build a simple CRUD app

Budibase is a low code platform that is designed for creating CRUD applications. From the frameworks, tech stacks, and platforms listed above, Budibase is the easiest and fastest way to build a CRUD application. For these reasons, we will use Budibase to build our CRUD app.

Overview

A local library is currently using an spreadsheet to manage their catalogue of books, and they would like to upgrade to a CRUD application.

  1. Make it easier to add new books
  2. Make it easier to search books
  3. Make it faster to check the availability of books
  4. Improve the experience when updating book information, including availability
  5. Make it possible to assign users to books
  6. Improve the experience around deleting books

Building our library management CRUD app

There are three high-level steps to building our CRUD app; setting up Budibase, create our data structure, and designing our user interface.

Setting up Budibase

If you are new to Budibase, click the ‘Get started’ button in the navigation (if on mobile, click the burger menu, then the ‘Get started’ button). Once you have Budibase setup, follow the actions below:

Actions:
  • Click the ‘Create new app’ button.
  • Give your app a name. We are going to call our app the ‘Library management app’ — very original.
Create your data structure

Budibase has its own database and supports several others; including MySQL, PostgreSQL, Mongo, and more. For our CRUD app, we will simply use Budibase’s internal database — Budibase DB.

Actions:
  • Create a Budibase DB table, and call it ‘Books’
  • Create a column within your Books table, and fill out the form:
    • Name — Title
    • Type — Text
    • Select ‘Primary’ under search indexes
    • Name — Author
    • Type — Text
    • Select ‘Secondary’ under search indexes
    • Name — Status
    • Type — Options
      • Options 1 — Available
      • Options 2 — Not available
      • Name — Checked out by
      • Type — Relationship
      • Table — Users
      • Define the relationship — One Users row -> many Books rows
      • Column name in other table — Books
      • Click ‘create row’
      • Complete the form:
        • Title — Superfreakonomics
        • Author — Stephen Dubner
        • Status — Available
        • Checked out by — leave blank
        • Click ‘save’
        • Title — Burning Bright
        • Author — John Steinbeck
        • Status — Not available
        • Checked out by — leave blank
        • Click ‘save’
        • Title — Electric Universe
        • Author — David Bodanis
        • Status — Available
        • Checked out by — leave blank
        • Click ‘save’
        Designing your user interface

        The design section is where we create our User Interface. You will notice on the left-hand side of your screen, there is a list of screens/routes and components. These screens were autogenerated by Budibase. Budibase is smart enough to know that for each Budibase table you create, you will need a new, list, and detail screen, in other words, a create (new), read (list), update + delete (detail) screen. This makes it faster and easier to build CRUD apps. Let’s get started.

        Actions:
          Click the books/:id screen

          Click ‘Field group’

          In the settings panel, click ‘Update form fields’

          This should generate a form, with record details in it, and will allow us to update and delete individual records.

          Click ‘Field group’

          In the settings panel, click ‘Update form fields’

          This should generate a new form for adding new books

          • Click on the ‘Container’ component under /books
          • Add a form component (located within the component panel ((above the main screen))
          • Drag the ‘Data Provider’ component (with children) inside the ‘New Form’ component
          • Click on the ‘New Form’ component
            • In the settings panel (right panel), select the Schema dropdown, and select Books
            • Under Theme, select ‘Lightest’
            • Drag the text field component above the data provider component (and nested under ‘New Form’)
            • In the settings panel, click the ‘Field’ dropdown and select Title.
            • In the ‘Placeholder’ textbox, add a placeholder — we will use ‘Search title’.
            • Find the ‘Margin’ section and change ‘Bottom’ to ‘20px’.
            • Click ‘Define Filters’
            • Click ‘Add expression’
            • In the first dropdown, select ‘Title’
            • In the second dropdown, select ‘Starts with’
            • In the third dropdown, select ‘Binding’
            • And in the fourth input, click the little lightning bolt
              • A new drawer will appear. Select the ‘New Form.Fields.Title’ option under ‘Columns’, and click ‘Save’
              • Click ‘Save’ again (to save your new filter)

              You’ve successfully added search and we now have our final CRUD app that will:

              1. Make it easier to add new books
              2. Make it easier to search books
              3. Make it faster to check the availability of books
              4. Improve the experience when updating book information, including availability
              5. Make it possible to assign users to books
              6. Improve the experience around deleting books

              And believe it our not, that’s us finished. Well done! Click the preview button (play icon) to view your CRUD app, or click Publish to push it live. Click the Books link, and there is your table with search.

              Tip — if you click the Books screen, and change the route to ‘/’ it will reroute to your homepage.

              Why CRUD is important

              The CRUD acronym is a great, memorable framework for building applications and constructing usable models. We can examine why CRUD is essential from two fronts; developers and end-users.

              1. For developers, CRUD operations are essential to app development. In a similar vein, REST, a superset of CRUD, is necessary for website development.
              2. For end-users, CRUD operations allow them to fill out forms, edit data, manage their admin panels and user settings.

              CRUD offers many other benefits including:

              • Security control
              • It is more performant vs. SQL statements
              • It’s tried and tested
              • It’s a recognized pattern and recognizable by most devs
              • It simplifies the process and provides an easy framework for new developers to learn

              CRUD Software and alternatives

              CRUD means Create, Read, Delete, Update. From this definition, it’s clear that CRUD is closely related to databases and data storage. CRUD is the simplest form to interact with tables and documents, and it provides you with a representation of the database itself as it is.

              This means that any app that uses these methods is CRUD software. This begs the question, are there other ways to interact with data?

              By definition, CRUD itself is limited to primitive operations. But you can do other operations to aggregate, manipulate and represent data in completely different ways.

              For example, CRUD software can provide you with ways to interact with each individual table within a database. Alternatively, you could create REST API endpoints or even app screens that load all consituent tables in one place.

              Therefore, you can spice up your CRUD software with additional methods that aren’t just pure CRUD.

              Check out our ultimate guide to data sources to find out more.

              CRUD app templates

              You can find over 50 CRUD app templates on the Budibase template page. These templates are free, 100% customizable, and simple to install.

              CRUD app templates

              And that’s the wrap. I hope you found value within this post and your understanding of what a CRUD app is and how to build one has improved. I wish you all the best on your development journey.

              CRUD Operations – What is CRUD?

              Kolade Chris

              Kolade Chris

              CRUD Operations – What is CRUD?

              Despite being commonly pronounced /krʌd/ , CRUD is not a word. It’s an abbreviation that stands for Create, Read, Update, and Delete or Destroy.

              In this article, I will show you what CRUD means, and what the individual terms mean and do. I will also show you how create, read, update, and delete operations work in the real world.

              What We’ll Cover

              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.

              In a user interface, this GIF below shows how the CREATE operation works:

              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.

              read-operation

              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.

              In a user interface, this GIF below shows how the UPDATE operation works:

              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.

              Conclusion

              This article showed you what CRUD means and what each individual operation in a CRUD app does.

              You can think about CRUD in this way:

              • You create a social account and fill in your information — CREATE
              • You get access to the information you entered and people can search for you – READ
              • You get a new job at Google and changed your employment status to employed – UPDATE
              • You get tired of social media toxicity and delete your account — DELETE

              To learn how you can make your own CRUD app, check out this tutorial by Joy Shaheb of freeCodeCamp.

              Что такое CRUD?

              Построение модели API требует стратегического подхода, и он связан с CRUD. Направляя разработчиков целиком и полностью, CRUD прокладывает путь для разработчиков API, ведя их по пути разработки доработанных и высококлассных API.

              CRUD

              Что такое CRUD?

              CRUD – это сокращение от Create (создание), Read (чтение), Update (модификация) и Delete (удаление). Эти четыре функции являются ключевыми принципами, которым следуют разработчики и программисты API при создании надежных API. В соответствии с отраслевым стандартом каждая модель API должна следовать всем этим четырем (или как минимум трем) принципам в процессе выполнения.

              Некоторые языки программирования следуют CRUD в том виде, в котором он есть, в то время как лишь некоторые используют адаптированную версию CRUD. К языкам, использующим инфраструктуру CRUD, относятся: Python, PHP, Java и .Net.

              CRUD работает как напоминание для разработчиков о том, что необходимо для того, чтобы приложение чувствовало себя полноценным. Она возникла в начале 80-х годов. В то время его использовали для иллюстрирования жизнеспособности базы данных SQL. Со временем он расширил список областей применения и стал ключевым принципом проектирования для DDS и HTTP.

              Определение функций CRUD

              Однозначное понимание функций CRUD позволяет разработчикам максимально эффективно использовать их. Итак, ознакомьтесь с каждой из 4 функций и рассмотрите примеры для того, чтобы лучше понимать их принцип действия.

              Create

              Эта функция используется для оповещения о введении любых новых изменений в базу данных и обеспечения их реализации. В реляционной базе данных SQL, Create называется INSERT . Этот оператор разрешает конечному пользователю создавать новые строки данных и позволяет ранее сохраненным данным легко взаимодействовать с новой базой данных.

              Допустим, мы добавляем Фрукты в список http://www.example.com/fruits/ . Для того, чтобы создать объект «Манго», мы должны оправить запрос POST на этот URL:

              Этот код создаст еще один объект в списке фруктов с именем «манго», у которого есть свойство (цвет) со значением «желтый». При успешном создании вы получите HTTP-ответ 201 .

              Что функция поиска делает в обычных случаях, вы можете узнать, почитав о реляционных базах данных. Конечным пользователям разрешено искать различимые значения или данные в таблице данных и находить значения. Можно использовать определённые ключевые слова или фильтровать данные, чтобы получить точную информацию.

              Теперь для того, чтобы прочитать список, в который вы добавили объект в предыдущем примере, воспользуемся GET-запросом.

              Используйте этот код:

              Если для вашего запроса существует запись, то вы увидите HTTP-ответ 200 . Также вы увидите список фруктов.

              Для того, чтобы увидеть детали, связанные с конкретным объектом Манго, который мы создали, используйте этот код:

              Update

              Функция модификации полезна для изменения уже существующих записей без внесения каких-либо нарушений в существующую базу данных.

              Для полной модификации требуется некоторая модификация в нескольких областях. Эта функция известна как Update как в SQL, так и в Oracle HCM Cloud.

              Для того, чтобы изменить значение объекта, выполним PUT-запрос для URL-адреса конкретного объекта. Вот так:

              Если возвращается идентификатор состояния 200 , то обновление прошло успешно. Для подтверждения вы можете прочитать этот объект повторно и просмотреть значения для него.

              Delete

              При помощи этой функции пользователи могут удалять определенные записи или данные из определенной базы данных. Вы можете удалять данные, которые больше не нужны или устарели.

              Удаление бывает двух типов: обратимое или необратимое удаление. Необратимое удаление удаляет данные один раз, а обратимое используется для обновления состояния строки данных без ее окончательного удаления.

              Это очень просто. Давайте удалим созданный нами объект.

              Теперь при GET-запросе (чтение) вы получите код 404, который говорит о том, что данных по вашему запросу нет.

              CRUD и REST

              Преимущества CRUD

              Есть что-то, что заставляет разработчиков и дизайнеров приложений предпочитать CRUD любому другому подходу. Это «что-то» — это непревзойденная производительность, интегрированная с некоторыми уникальными функциями. Основные преимущества, которыми можно воспользоваться после запуска CRUD, представлены ниже.

              Меньшая вероятность атак путем внедрения SQL-кода

              Использование SQL-языка имеет больше шансов столкнуться с SQL-атаками, поскольку все операторы SQL выполняются непосредственно на SQL-серверах. Сервер также хранит инструкции и процедуры SQL, доступ неавторизованных ресурсов к которым может оказаться фатальным.

              Использование CRUD позволяет контролировать возможные атаки путем внедрения SQL-кода, поскольку использует уже сохраненные действия и не требует создания динамических запросов с использованием данных конечного пользователя. Кроме того, такой подход использует однозначное цитирование параметров SQL-операторов.

              Лучшая защита от случайного просмотра

              Пользователи специальных SQL-операторов должны получить разрешение на доступ к таблицам базы данных. После успешного предоставления разрешения конечным пользователям разрешается читать и управлять данными, имеющимися в Excel, Word и любой другой программе. Также возможен обход бизнес-правил приложения.

              Однако делать это не всегда выгодно. Риски утечки данных есть всегда. CRUD в такой ситуации полезен, так как делает возможным использование ролей приложений. Используя роли приложений, можно обеспечить высоко интегрированную безопасность базы данных и контролировать права доступа.

              Полномочия могут защищаться паролем, а поскольку пароли также интегрированы в приложение, то изменить их сложно. Таким образом, можно покончить со случайным просмотром.

              CRUD и SQL

              CRUD vs REST – сравнение

              CRUD и REST очень часто используют для обозначения одного и того же подхода. Такая путаница очевидна, так как приложения REST следуют принципу, подобному CRUD, для взаимодействия с другими приложениями или компонентами. Тем не менее, эти два термина не идентичны и имеют ряд явных сходств и различий.

              Что общего?

              Приложения REST разрабатываются с сохранением определенного набора ресурсов в смысловом центре. Эти ресурсы, как и ресурсы CRUD, можно легко создавать, читать, модифицировать и удалять. Просто вместо Create, Read, Update и Delete в REST используются ресурсы PUT/POST, GET, PATCH/POST и DELETE.

              В чем разница?

              Абсолютно точно, то у этих двоих больше различий, чем сходств. Взгляните на ключевые различия между ними.

              • В части определения REST упоминается как архитектурная система, а CRUD – как функция.
              • REST «крутится» вокруг ресурсов, основанных на компонентах HTTP.
              • CRUD «крутится» вокруг информации, хранящейся в настройках базы данных.
              • CRUD может быть частью REST, но REST не может быть частью CRUD. REST – это независимый подход, который может правильно функционировать и без CRUD.

              Что такое CRUD-тестирование?

              CRUD-тестирование – это оригинальная методология тестирования методом «черного ящика», которая широко используется для подтверждения полезности данного программного обеспечения в режиме реального времени. Это понятие используется для SQL и других ресурсов СУБД, для которых гарантируется точное отображение данных, сквозное обслуживание ACID-свойств и несравнимая целостность данных.

              Обеспечение безопасности в REST и CRUD-операциях

              Аутентификация, авторизация и учет использования ресурсов (или ААА – Authentication, Authorization, Accounting) – это крайне эффективная практика безопасности, которая одинаково хорошо подходят для REST и CRUD. Она включает в себя аутентификацию конечных пользователей, выполнение авторизации перед каждым доступом и привлечение конечных пользователей к ответственности за свои действия или использование данных.

              What is CRUD ?

              Nureddin Hasan Bikeç

              The term CRUD relates to data management. As an acronym, CRUD comes in the software industry and represents the four branches required to implement a permanent storage application:

              • Create
              • Read
              • Update
              • Delete

              These are the four basic operations of persistent storage. Alternate words are sometimes used when defining the four basic operations of CRUD, such as construct instead of create, retrieve instead of read, or destroy or destruct instead of delete.

              When Should We Use CRUD?

              The ability to create, read, update, and delete items in a web application is essential for most full-stack projects. Instead of using ad-hoc SQL statements, many programmers prefer to use CRUD because of its performance.

              Explain CRUD Elements

              Create (create a dataset):

              The create function allows users to create a new record in the database. In the SQL relational database application.Performs the INSERT statement to create a new record.

              Read or Retrieve (read datasets):

              The read function is similar to a search function. It allows users to search and retrieve specific records in the table and read their values.

              Update (update datasets):

              The update function is used to modify existing records that exist in the database. To fully change a record, users may have to modify information in multiple fields.

              Delete or Destroy (destroy datasets):

              The delete function allows users to remove records from a database that is no longer needed.

              How to Use It ?

              The images below are from my CRUD Operations Project. I tried to express it simply.

              The main purpose of this project is to save usernames in the database, display them, edit and delete them. If you are curious about the details, you can review my project on my Github page.

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *