Moving Away from CRUD: How Task-based UI and CQRS Work with REST API

TLDRLearn how task-based UI and CQRS work with REST API and how they differ from a typical CRUD approach. Discover the benefits of mapping commands and queries to resources and the possibilities of composing data from multiple boundaries. See examples of HTTP methods and explore options for UI composition on the client or server side.

Key insights

🔄Commands and queries can be mapped to resources instead of entities in a task-based UI with a REST API.

🗺️Resources can be composed by fetching data concurrently from multiple boundaries and combining it into a single response on the server side.

🌐UI composition can be done on either the client or server side, depending on the desired approach.

HTTP methods can be used to perform actions like updating prices or marking items as available or unavailable.

🔁Task-based UI and CQRS provide a more flexible and scalable solution compared to the traditional CRUD approach.

Q&A

How do commands and queries work in a task-based UI with a REST API?

Commands and queries can be mapped to resources, allowing actions and data retrieval to be performed on specific boundaries instead of entities.

Can UI composition be done on the client side?

Yes, UI composition can be done on the client side by making multiple HTTP calls to different resources and combining the data to build the UI.

Is UI composition on the server side recommended?

UI composition on the server side can be a more efficient approach, as it allows for concurrent fetching of data from multiple boundaries and provides a single response to the client.

What are the advantages of using task-based UI and CQRS?

Task-based UI and CQRS provide a more flexible and scalable solution compared to the traditional CRUD approach, allowing for better separation of concerns and improved performance.

How can HTTP methods be used in a task-based UI with a REST API?

HTTP methods can be used to perform actions like updating prices, marking items as available or unavailable, and performing other operations on specific resources.

Timestamped Summary

00:00In this video, we explore how task-based UI and CQRS work with a REST API, focusing on moving away from the traditional CRUD approach.

02:32Commands and queries can be mapped to resources instead of entities, enabling actions and data retrieval on specific boundaries within a task-based UI.

05:31UI composition can be done on either the client or server side, depending on the desired approach and the need for concurrent data fetching from multiple boundaries.

07:46HTTP methods play a crucial role in a task-based UI, allowing for actions like updating prices, marking items as available or unavailable, and performing other operations on specific resources.

09:59Task-based UI and CQRS offer a more flexible and scalable solution compared to the traditional CRUD approach, providing better separation of concerns and improved performance.