Using sagas to maintain data consistency in a microservice architecture by Chris Richardson

Using sagas to maintain data consistency in a microservice architecture by Chris Richardson

Devoxx

7 лет назад

300,050 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@user-si8gf7ql4v
@user-si8gf7ql4v - 16.11.2023 13:47

Thanks for sharing

Ответить
@chessmaster856
@chessmaster856 - 21.07.2023 00:54

This does mot work where ot maaters. It will eventially work where nobody cares.

Ответить
@absolutejam
@absolutejam - 10.07.2023 22:27

Really enjoyed the talk, but imagine if they these talks used a richer language like F#, Rust, Scala, etc that have enums and traits instead of all the class based fluff ❤

Ответить
@stanleychan2099
@stanleychan2099 - 01.05.2023 23:25

surprisingly interesting talk and could really relate. great learning reference

Ответить
@florianwicher
@florianwicher - 31.03.2023 00:10

Great talk! One question though: If you use a DB table to buffer the messages to be sent to the message broker, haven't you just moved the problem of exactly-once-delivery? What if the mechanism that dispatches the messages from your table to the broker crashes/rolls back?

Ответить
@danishrockz1
@danishrockz1 - 24.03.2023 01:58

how can I get that PPT ??

Ответить
@hamedhatami4831
@hamedhatami4831 - 21.12.2022 16:05

It's been really informative demonstration about how the Saga works entirely, when it comes to publish a message to the message broker (queue) in order to make them transactional , we can design them to get ACK back then consider it as done thus give it a go

Ответить
@maximecaron3133
@maximecaron3133 - 22.10.2022 18:43

for peuple watching in 2023. don’t use saga!
use a database that support multi/shard transaction!

Ответить
@7th_CAV_Trooper
@7th_CAV_Trooper - 11.10.2022 21:32

how awesome would it be to get an architectural/code review from Chris Richardson?

Ответить
@BipinOli90
@BipinOli90 - 11.10.2022 12:35

Excellent talk. Learned a lot. Thanks

Ответить
@songoku4271
@songoku4271 - 26.09.2022 05:17

Why not use TC/C ?

Ответить
@jfordgaming9615
@jfordgaming9615 - 05.08.2022 10:13

I'm using gateway api as a middleman for my microservices

Ответить
@benyazidanass
@benyazidanass - 14.05.2022 17:44

Very interested presentation thnx,
i want to give my idea concerning the saga code source demo, the speaker send a command reserveCredit. i think it's will be better to publish the orderCreated Event. sending Commands to a remote services create dependancies between each others instead of throwing events and let's interested subscribers consume event and translate them to a commands ( onOrderCreated --> translate OrderCreated to ReserveCreditCommand)

Ответить
@mohammadbarbast6524
@mohammadbarbast6524 - 04.05.2022 18:45

excellent, I have looking for something like this for days. really thanks to Chris Richardson

Ответить
@NiravPatel1989
@NiravPatel1989 - 28.02.2022 08:19

For the last part, "Transactional messaging", why can't we utilize out of the box solutions like Kafka instead of using database commit log tailing?

Ответить
@vikrantsai7
@vikrantsai7 - 07.02.2022 00:45

why are we trying to do this ? to make systems less complex , to have a smaller focused development teams ? to reduce time to production ? I feel we are making systems more complex , we are adding many more smaller databases , we are re-inventing the transaction mechanism such a waste of time , please do a video where you really need to have microservices and where not, its become a fashion to bounce the terms microservices , REST, K8S

Ответить
@hun73rentertainment76
@hun73rentertainment76 - 03.01.2022 04:54

This is dope 😍

Ответить
@rambo4014
@rambo4014 - 20.12.2021 20:31

Choreography looks much better to me and more loosely coupled

Ответить
@rambo4014
@rambo4014 - 20.12.2021 19:11

Chris the way you are referring to implicit orchestration through events, I am confused then what is choreography?

Ответить
@alexright7549
@alexright7549 - 03.12.2021 21:20

Hi, i understand that 2PC is out of the scope between two microservices, but inside a single microservices you can use it. For example when you have to write a record on DB and send a message to a broker to start another micorservice.

Ответить
@kevinwang9495
@kevinwang9495 - 02.12.2021 03:45

MassTransit to the rescue 2021

Ответить
@willd1mindmind639
@willd1mindmind639 - 06.11.2021 17:40

The problem here is that in today's world of commerce, most times the credit service and payment service(s) are totally and separate from the order service and customer service and not controlled by the organization domain. So this kind of orchestration would not be required. Typically what happens is the front end layer calls the third party service to handle the customer credit and/or payment and once that is done there is data sent back to the front end. That data is then used as input to the order service and there is absolutely no direct dependency between the two at all. Even if there is a payment service within the domain it still would operate independently of the order service with the expectation that the order would not be submitted until the payment is successful.

A better example of this kind of pattern is a modern web based dashboard that a user logs into where they have various kinds of sub applications that they can drill down into and do various things. All of those sup applications would be the prototypical microservices that are independent and have their own separate stacks for whatever functionality that they perform. And the UI layer is doing most of the orchestration in terms of authentication and messaging between them.

Ответить
@austecon6818
@austecon6818 - 24.09.2021 13:28

Great talk. Really useful

Ответить
@marvinalone
@marvinalone - 07.09.2021 03:15

the money transfer case, I think this kind of function should be designed as in one microservice and done inside a single DB transaction. If there is no option to do so, then probably an intermediate cash pool (fake, intermediate account) is needed

Ответить
@mariaguinsburg5092
@mariaguinsburg5092 - 05.09.2021 05:49

Had to set it to 1.5 speed make it more consumable

Ответить
@DiamantineRakib
@DiamantineRakib - 28.08.2021 17:55

pro tips 1.25x sounds normal.

Ответить
@user-mj8ms2xn5h
@user-mj8ms2xn5h - 19.08.2021 22:11

I readed alot about Saga design pattern and I developed two years a system than implement Saga design pattern and I still learned new things from this video. Thank you.

Ответить
@MaxPicAxe
@MaxPicAxe - 15.08.2021 22:39

Microservices isn't an architecture. Decoupling is. Microservices is nothing new. Decoupling has been around forever.
(This is nothing related to the video, just felt like saying it.).

Ответить
@emdadulsadik861
@emdadulsadik861 - 09.08.2021 12:56

If there's an eventual consistency (achieved using the messaging system like queue or pub-sub), what's the need for a saga (after all transactions are for consistency)?

Ответить
@ram62836
@ram62836 - 05.07.2021 18:28

10mins and still didn't found saga.

Ответить
@greneroom
@greneroom - 19.06.2021 23:24

Very interesting talk!

One question I had near the end of the talk — it seems like using the DB’s change log as the mechanism to publish to the message broken has a large drawback: it tightly couples the internal DB scheme to the API a service exposes to the Saga (which defeats one purpose of microservices, since you want to avoid leaking your DB).

I didn’t quite follow why having each individual service coordinate a 2PC between its own DB and a message broker was problematic. This seems much less bad than using distributed TXNs to implement the entire Saga, since the 2PC is an implementation detail of each service. The only single point of failure is the message broker, and I think this is true regardless of your approach?

Ответить
@iirekm
@iirekm - 12.06.2021 11:01

Unfortunately the approach presented here is not perfect when comes to scalability: Order.state == PENDING is basically a database write lock in disguise.

Ответить
@ahmaddeveloper7595
@ahmaddeveloper7595 - 05.06.2021 10:22

great talk, got a lot of useful information

Ответить
@ismile47
@ismile47 - 04.06.2021 19:15

Excellent, it took last 15mints to understand 1hour repeat and see. Its 4 years before, now i want to see what are latest changes or implications update in saga, any suggestions?? Please replay to comment

Ответить
@AychinGasimov
@AychinGasimov - 16.05.2021 18:10

These are very old and good known problems of any distributed system. Main point is when you go from monolith to microservoces you go from single instance to distributed with all of its problems and complications.

Ответить
@ronnie5966
@ronnie5966 - 04.04.2021 11:24

You could have a Saga Service that handles all sagas?

Ответить
@risebyliftingothers
@risebyliftingothers - 01.04.2021 16:44

I stopped watching when he says use database as a temporary message queue. WTF

Ответить
@ivantapia9966
@ivantapia9966 - 01.03.2021 21:45

Thanks buddy :D

Ответить
@roshankumarmutha7389
@roshankumarmutha7389 - 21.02.2021 12:37

It's better to understand the current

Ответить
@vinodprabha1
@vinodprabha1 - 10.02.2021 20:06

Thank you very much

Ответить
@landkasupada
@landkasupada - 12.11.2020 23:03

This is a real talk on real use cases on real problems

Ответить
@JuanVercellone
@JuanVercellone - 25.10.2020 13:11

So much repetition of the phrase "microservice architecture". Just say microservices! XD

Ответить
@alexknn15
@alexknn15 - 03.10.2020 18:29

Great talk, like that you explained very important part as processing data and sending event atomically. Other resources usually do not explain this important part. But I want to mention one moment, as usually messaging systems guarantee “at least once” delivery, we have to think about idempotency. And if we implement it, we don’t need complicated atomic save and send mechanism anymore, we now can save data and then try to send message to the next queue and ack/commit current queue. For example If we have server failure after saving to DB and before sending to next queue and acking current, then the other instance will get and process current message (here idempotency come into play as we already saved data to DB and another instance will do the same processing cycle with the message - save to db and send to next queue)

Ответить
@anildatt8103
@anildatt8103 - 22.09.2020 17:22

Old wine in new bottle. I have been doing this design pattern of State Machine Orchestrator in my SOA EDA , with compensating transactions to rollback what services had done till the point of failure. The failure event is either broadcast to all the services or to the Orchestrator so it can co-ordinate the cancellation. As I listened to the talk it was like going through my design document.
Message table to message broker has a drawback when the load is high. As it is DB spefic to pull data out to push on message broker it introduces a bottleneck in the DB. Ideal for this is using a distrbuted cache DB or like he mentioned the replication and use the replicated data to message broker.

Excellent talk. It touched all the touchpoints

Newbies to Micorservices without much experience may think this is something rocketscience, but it as been there for long in a different avatar.

Ответить