Your explanation mainly caters to the audience who are already aware of SAGA. It would be great if you can go in depth considering newbies. This will really help.
Is this a good solution to the problem? The problem, imo, is the reliability of the transaction scope. My take from this was a score needs updating, and then ensure that its changed for anyone interested. I feel the implementation of a compensating transaction via an orchestrator isn't a great solution to achieve atomic consistency. Rather than distribute the score, I would have used virtual actors and a publish subscribe paradigm (which I think is halos architecture is today). A virtual actor is single threaded and can persist state (no concurrency issues). So we now have a way to update the score(persistence is queued and done async), but how to distributed it? All players (which are also virtual actors) listen to the games event source (event gridbin Azure), and listen for score updates that they are playing in.
Imo, saga pattern is more relevant to a workflow, where each step in the workflow, may have a human in the loop required. It allows for a transaction scope that needs to be managed over days, rather than a transaction scope of a few microseconds for a distributed transaction to be atomic.
Your story-telling way of writing technical blogs always amuses me. I am a huge fan of your articles. They always inspire me to deep dive into system design.
I have a proposal for you. I am interested in translating your blogs into Bangla in my free time. Would you please give me permission? It would help a lot of Bangladeshi developers who are weak in English.
Thanks for adding the reference. I think you need to describe what the compensation transaction is exactly and give an example. The current explain is quite vague. I.e. I don't understand what does it mean for one transaction to compensate another transaction.
The author of the article does not need to describe nor explain what saga is or what compensation transaction is because this is not what this article is about. The article is about introducing readers to the architecture behind the scene. Neo has since added links for people who are interested in learning more can have a starting point.
Yes, the author can do whatever he likes, however he likes. And what I'm saying is that I got disappointed that while reading the article, I didn't get the solution. Thus it looked like a click bait article to me.
The author could've just said - "Halo used the Saga pattern. References: ...". In which case I would've been OK by just providing the references. But the author took his time to write down part of the explanation of what the saga pattern is about. And since he took his time to do that, I took my time to write down that the explanation was partial and I didn't get the explanation.
However, I am glad that he provided a lot of references and I'm going through them at the moment. The references are explaining quite well what the saga pattern is. The references also lead to other quite useful articles.
Once I'm done with reading the references I might add a better comment. My comment was solely about the article itself.
super interesting design pattern. I love hearing of stories of SQL to NoSQL migrations for various reasons, and the simplicity of your writing :)
Great article Neo !
nice to see your comment, thanks - Uriel.
my pleasure Neo
Your explanation mainly caters to the audience who are already aware of SAGA. It would be great if you can go in depth considering newbies. This will really help.
thanks again, I'll improve my writing skills.
Hey neo, I agree with Zdravko. The current explanation is quite vague or incomplete. Please try to cover things in depth.
hey Rajat, thanks - I'm happy to receive your feedback.
I'll try to include more details in future articles.
SAGA in action, one of my favorites, Neo!
nice, thanks.
Awesome post! It gave me a lot of insights! Thanks Neo!
you're welcome + thanks
I love SAGA pattern. The great post.
thanks
I tried explaining E-commerce example with a flowchart, https://whimsical.com/saga-pattern-in-e-commerce-order-process-X1k3yx3tMaCdQNRzTLrTP4 The No path represents the compensating transactions in action.
Is this a good solution to the problem? The problem, imo, is the reliability of the transaction scope. My take from this was a score needs updating, and then ensure that its changed for anyone interested. I feel the implementation of a compensating transaction via an orchestrator isn't a great solution to achieve atomic consistency. Rather than distribute the score, I would have used virtual actors and a publish subscribe paradigm (which I think is halos architecture is today). A virtual actor is single threaded and can persist state (no concurrency issues). So we now have a way to update the score(persistence is queued and done async), but how to distributed it? All players (which are also virtual actors) listen to the games event source (event gridbin Azure), and listen for score updates that they are playing in.
Imo, saga pattern is more relevant to a workflow, where each step in the workflow, may have a human in the loop required. It allows for a transaction scope that needs to be managed over days, rather than a transaction scope of a few microseconds for a distributed transaction to be atomic.
could you explain a scenario where compensation tx fails ? how it is handled ?
Good share! But please add examples too..
Your story-telling way of writing technical blogs always amuses me. I am a huge fan of your articles. They always inspire me to deep dive into system design.
I have a proposal for you. I am interested in translating your blogs into Bangla in my free time. Would you please give me permission? It would help a lot of Bangladeshi developers who are weak in English.
thanks,
sorry - you cannot translate my articles and publish them outside my domain.
I own the copyrights.
I didn't understand where does the name "SAGA" come from?
I also didn't understand - what are these "compensation transactions" instead of the rollbacks of transactions?
To me, the whole article is a TL;DR; and I didn't learn anything from it.
The name Saga comes from the white paper named "Sagas". https://www.cs.cornell.edu/andru/cs711/2002fa/reading/sagas.pdf
Also thanks for asking about it, I included it in the references section.
Saga is a design pattern, so you can use it with components (microservices, databases).
And the databases used doesn't have to be SQL, instead it could be NoSQL.
So there's a chance that rollback transaction isn't supported by some databases.
I'm sorry to read this article didn't help you, what information do you think would have helped you better understand it?
Thanks for adding the reference. I think you need to describe what the compensation transaction is exactly and give an example. The current explain is quite vague. I.e. I don't understand what does it mean for one transaction to compensate another transaction.
The author of the article does not need to describe nor explain what saga is or what compensation transaction is because this is not what this article is about. The article is about introducing readers to the architecture behind the scene. Neo has since added links for people who are interested in learning more can have a starting point.
Yes, the author can do whatever he likes, however he likes. And what I'm saying is that I got disappointed that while reading the article, I didn't get the solution. Thus it looked like a click bait article to me.
The author could've just said - "Halo used the Saga pattern. References: ...". In which case I would've been OK by just providing the references. But the author took his time to write down part of the explanation of what the saga pattern is about. And since he took his time to do that, I took my time to write down that the explanation was partial and I didn't get the explanation.
However, I am glad that he provided a lot of references and I'm going through them at the moment. The references are explaining quite well what the saga pattern is. The references also lead to other quite useful articles.
Once I'm done with reading the references I might add a better comment. My comment was solely about the article itself.