Event Sourcing 101: Command Query Responsibility Segregation (CQRS)

  Рет қаралды 62,278

Confluent

Confluent

Күн бұрын

Пікірлер: 23
@acupsf
@acupsf Жыл бұрын
The most clear explanations on CQRS & event sourcing I've ever watched/read, thank you!
@therolinga79
@therolinga79 2 ай бұрын
This specific video it is not well explained at all
@mecamon
@mecamon 2 ай бұрын
What a beautiful way of explaining concepts. Bravo and thanks!
@sna241
@sna241 Жыл бұрын
Amazing lecture. Thank you.
@alexandresantos7966
@alexandresantos7966 Жыл бұрын
Clear and objective explanation. Thank you.
@david75186
@david75186 Жыл бұрын
it is very interesting to understand this paradigm because help us not to create a complexity where do not need
@anantmishra6783
@anantmishra6783 5 ай бұрын
1:21 Why would the balance of a checking account ever be calculated during a read operation anyway though? Not sure if this is a weak example, or just basic common sense being labelled as CQRS?! and additionally, how is THAT called CQRS? Quite confusing... hmm
@soak2094
@soak2094 2 жыл бұрын
Great explanation, thanks
@Akhbash
@Akhbash 10 ай бұрын
CQRS doesn't mean having 2 databases or models, read & write or to compute the Read Model when manipulating Write Model. The definition of CQRS is a term coined by Greg young, to explain an Architectural Pattern that allows for a SoC between a Read Model and a Write Model, the later used for Commands (Create, Update, Delete) and the other for Queries (Read), though not strictly meant only for CRUD. Also, CQRS does not enforce having 2 models.
@Akhbash
@Akhbash 10 ай бұрын
@@ConfluentDeveloperRelations Wow, didn't thought someone from Confluent would actually reply, that's awesome! I totally got the point of the video, perhaps I missed my chance on making that clear though. Thanks for the reply ;D
@bjojosimpson
@bjojosimpson 5 ай бұрын
​@@Akhbash What you are describing is CQS (Command-query separation), which is the more general pattern which doesn't require at least two models for reads and writes. Speaking of Greg Young, on his document about CQRS he wrote the following: "It is not possible to create an optimal solution for searching, reporting, and processing transactions utilizing a single model."
@thedacian123
@thedacian123 Жыл бұрын
What would happend if i have to change the event format and we have a lot of events gathered in the log?Thank you!
@vijayjayaram606
@vijayjayaram606 3 жыл бұрын
Much needed right now Thank you 🙏
@giacmoit
@giacmoit 2 жыл бұрын
What is the benefit of CQRS?
@tharun8164
@tharun8164 2 жыл бұрын
The primary intention is to decouple the writes and reads. If you want to understand why do we even need to decouple them, then the below example gives some context. Ex: I assume you're familiar with data structures and algorithms. Let's say we receive input as a stream(array) of numbers and we need to address the following questions. Q1) Print the last 5 numbers. (queue) Q2) Print the top K smallest of all numbers. (priority queue) Q3) Print the sum of numbers. To answer the above questions, we build a data structure tailored to address that specific question so as to improve the time complexity. Similarly, cqrs do this at the systems level.
@iamnoob7593
@iamnoob7593 Жыл бұрын
@@tharun8164 I get ur point , Its still not clear . As CQRS can lead to data inconsitency and performance issue
@tharun8164
@tharun8164 Жыл бұрын
@@iamnoob7593 CQRS may lead to data inconsistency with incorrect implementation. Let’s consider a use case of data integration i.e., we want to persist the same data in 2 different databases. For ex, we wanted to use MySql as a source of truth and Elasticsearch to provide full-text search. If we try to persist the data in MySql and Elasticsearch from the application then it’ll lead to a fundamental problem called ‘dual write’. With this issue, data may become inconsistent between MySql and Elasticsearch due to reasons like a race condition, client failure, or any database failure. In order to mitigate this problem we can implement Change Data Capture(CDC) pipeline. This CDC approach tails the MySql log and applies these changes to Elasticsearch. These MySql logs are converted as events and pushed to Event Bus(Kafka). This CDC pipeline ensures that data is consistent between MySql and Elasticsearch. Since there will be latency in processing these CDC events, it leads to Eventual Consistency. 
Regarding the performance, since the database logs are used in creating events it doesn’t have any impact on existing application latencies.
@iamnoob7593
@iamnoob7593 Жыл бұрын
@@tharun8164 wow , thats very detailed . Thanks
@jibranjaved6165
@jibranjaved6165 2 жыл бұрын
So the system will eventually "inconsistent" as said read will not b possible right after "write", performance or segregation tradeoffs with data inconsistentcy... Apart from this why I would b interested from real world usecase POV that if user first add T shirt then delete T-shirt n add Pants to the cart n add one more Shirt n delete added Pants n added T-shirt again...ok we are writing these events to eventlog just to have record where user started???why I would b interested what was the system state at the time when this user started shopping??? What I want to achieve from that!??
@ITube4RealFun
@ITube4RealFun Жыл бұрын
The hand gesture is distracting and she talks too fast.
@bY6U5T4V0
@bY6U5T4V0 Жыл бұрын
there's a speed control tool embedded in KZbin that might help you understand her better.
Event Sourcing and CQRS Explained |  When should you use them?
12:36
Гениальное изобретение из обычного стаканчика!
00:31
Лютая физика | Олимпиадная физика
Рет қаралды 4,8 МЛН
Enceinte et en Bazard: Les Chroniques du Nettoyage ! 🚽✨
00:21
Two More French
Рет қаралды 42 МЛН
VIP ACCESS
00:47
Natan por Aí
Рет қаралды 30 МЛН
Event Sourcing Example & Explained in plain English
18:23
CodeOpinion
Рет қаралды 119 М.
Event-Driven Architecture (EDA) vs Request/Response (RR)
12:00
Confluent
Рет қаралды 181 М.
CQS and CQRS: Command Query Responsibility Segregation
4:16
Drawing Boxes
Рет қаралды 29 М.
Microservices with Databases can be challenging...
20:52
Software Developer Diaries
Рет қаралды 120 М.
Microservices explained - the What, Why and How?
18:30
TechWorld with Nana
Рет қаралды 907 М.
Event Driven Architecture EXPLAINED in 15 Minutes
14:55
Continuous Delivery
Рет қаралды 38 М.
Master Event Sourcing in Just 10 Minutes
10:48
ByteMonk
Рет қаралды 6 М.
Гениальное изобретение из обычного стаканчика!
00:31
Лютая физика | Олимпиадная физика
Рет қаралды 4,8 МЛН