What is Event Sourcing and CQRS? (EDA - part 3)

preview_player
Показать описание
As part of the Event Driven Architecture Series, in this video I explain Event Sourcing and CQRS.

What is Event Sourcing? What is CQRS (or Command Query Segregation Pattern)? How do they relate? And what do they have to do with Event Driven Architecture and Microservices? In this video I try to cover all these questions in about 8 minutes using examples.

Event Sourcing promotes to store data using Events, via an Event Log. This provides several features, allowing for greater scalability in the services but with some drawbacks like Eventual Consistency. CQRS combines really good with Event Sourcing to also offer more flexibility when scaling distributed services, but might be way more complex than typical/straightforward CRUD operations.

#EventSourcing #CQRS #Microservices #EventDriven

-----------------------
📘 Recommended books (incentivized):

🔖 Relevant resources:

-----------------------

-----------------------
Remember you can reach me here:

-----------------------
In A Dev' Story I explain Software Development related topics from my point of view. I'll be explaining different topics in "Chapters" according to the stage of the story I think they belong. Hope is as entertaining for you as it's fun for me to create these videos

Thanks again for watching! Feel free to like, comment, share and subscribe, it means a lot to me and helps the channel grow.
Рекомендации по теме
Комментарии
Автор

Your explanations are straight to the point with very clear examples. I ended up watching the series from Getting the Basics to Event Sourcing and CQRS. Thanks for sharing your knowledge.

laakolina
Автор

I've watched about 4-5 of this series so far and it's great! I love how succinct and clear you make the main points and the final presentations. Great job!

KyleRebstock
Автор

Thank you. Your EDA series helped me pass in an interview.

eduardoartil
Автор

You are a gifted Teacher. You sync between explanations and clean book diagram, just MindBlowing.

jhonsen
Автор

Super clear and simple explanations, thanks a lot for this series.

arick
Автор

Increíble el contenido que hay en esta serie de 3 videos, muy resumida y clara la información. Saludos desde México!!

gokug
Автор

Thank you very much, these explanations are awesome!!

etza
Автор

Thank you for excellent explanations and keeping simple.

abhisheknittala
Автор

I really much agree that at the end you said to limit the use of this pattern. Can be overkill most of the time

LawZist
Автор

Hello, thank you for your tutorial, can you make a tutorial axon framework with CQRS & SAGA PATTERN ?

politiquealgerie
Автор

Diagram is more intuitive and easier to understand, so thank you for this.

My question is: Imagine designing a backend system for a todo list application where data consistency across Redis, PostgreSQL, and Elasticsearch is essential. To achieve this while eliminating Dual Write, two distinct approaches can be considered:

Kafka with Separate Topics and Consumers:
Utilizing Kafka, this approach involves creating three separate topics ("todo-cache-ingestion", "todo-storage-ingestion", and "todo-search-ingestion"). If create API call to create a new todo would publish messages to these topics. Subsequently, distinct consumer processes would handle data storage in Redis, PostgreSQL, and Elasticsearch, respectively. and what is we fetch all or specific data here?

and second approach is Event Sourcing approach? But How? and what is the issue in first approach?

PrashantShekher
Автор

Would event sourcing be appropriate for this eccommerce checkout example? I would imagine that when a customer is checking out they would like an immediate response as to whether their order/payment was successful.

With this asynchronous model there's not a guarantee of this

JBoy
Автор

I want to ask about the Event Sourcing and CRUD. For example, an Authentication service has API to register new users and a News Feed service generates recommendation for that new user.

In this case, Auth service can send USER_CREATED to the Event Log to follow the event sourcing. However, in the case that Event Log is not reachable then you will need an outbox pattern where the Auth service stores events in its local database and send to event log later.

I want to ask if it is normal to not use CRUD in the register API and the register API will publish an REGISTER_USER event without storing the data, the auth service has an internal worker that will subscribe to the REGISTER_USER event to store data to its local database and then publish an USER_CREATED event for external services. In this case, no need to do an outbox pattern with the assumption that event log will be high availability.

quanhua
Автор

Cool videos! I would recommend you to buy a microphone as sometimes it hard to understand because of eco. Great work, can't wait for the next video!

sepio_
Автор

Hi can I mix a crud application with event sourcing? For example when I perfom an action into a Microservice A with http crud publish the event and microservice B make changes in a local cache?

yorozuya
Автор

I read on many blog posts that CQRS is not recommended for CRUD, now I am confused 😐

mohsanabbas
Автор

Hi guys, Can I call EventLog EventStore? Because I read many post and they mentioned EventStore.

andrewdo
Автор

Hi. Really good series as I'm starting to learn about Event-Driven architecture. I couldn't differentiate Saga-Choreography from CQRS. Ideally in Choreography we would send commands/events from one service to others. And those messages can be a get/put. In CQRS aren't we are doing the same thing ? Like sending a message for get/query and sending a message for post/command. I'm jumbled up with the terminologies and everything sounds similar to me. Sorry If I'm not making any sense.

phystem
Автор

Why on earth would the orders overview service query three different services instead of building its own internal state based on events from the other services? Seems like it would nullify the pros of using this pattern.

sorteslyngelk
Автор

Shouldn’t you have two different data stores?

deecm