Software Architecture Fundamentals - Episode 8 - Maintaining data consistency - Saga vs. 2PC

preview_player
Показать описание
Are you a software developer who wants to understand better software architectures? In this stream, we discuss all the needed software architecture basics you need to know.

Don't forget to follow me on Twitter @laurspilca or LinkedIn for more posts and discussions.
Рекомендации по теме
Комментарии
Автор

We can also implement State design pattern with memento which store the previous action on the object which change the state...afterwards we can retrieve the previous action and simple undo the action and bring back object state to original state...can this be simplest form of implementation to handle distributed transactions ?

SandySachhu
Автор

Hi Laurentiu
Since you slightly treated the subject of transaction isolation inside 1 microservice, I have a question. So when you use a restrictive isolation level such as repeatable_read or serializable, what exactly happens to the threads that attempt to read data from SQL tables? I always assumed that the threads would simply wait until they were cleared to use the tables. However I recently got into a deadlock situation when I used Spring's @Transactional with Serializable isolation level. The code was some sort of a scheduler (via Executors) which I tried to upscale in kubernetes pods. For simplicity, I'll just say the scheduler simply loops through all rows in a table and mutates data. Obviously it is working fine when running it in just 1 pod, but as soon as I upscaled it (even though I used @Transactional with a restrictive isolation level) it just went straight into a deadlock. I just thought that if I put @Transactional on top of the method doing the loop, it would make the pods run the same scheduler (the same code) sequentially, but instead ended up with a deadlock so what am I missing in this scenario?
I know it's quite vague what I'm asking and I don't know if it's all that clear, but I'm hoping it's something you can venture to take a guess at least

BinSlayer
Автор

Hello and thanks for this awesome serios of lectures! I wanted to ask something about implementing Saga... i saw in that book of Chirs Richardson - Microservices Patterns that he use Eventuate framework for implementing Saga, but i found out that there is Axon Framework tho, each of them have advantages and disavantages, what should i use, or how it's the best use case to implement Sagas? Thanks for you time answering for this!

gon