Do you know Distributed transactions?

Поділитися
Вставка
  • Опубліковано 19 січ 2025

КОМЕНТАРІ • 221

  • @Bernardo-v9g
    @Bernardo-v9g 3 роки тому +133

    "Monolithic architecture is old and gone". Be careful when you say that, because that's wrong. Well modularized and encapsulated monoliths can be better than having a miscroservices architecture. It all depends on the use case.

    • @manishghoshi3861
      @manishghoshi3861 3 роки тому

      exactly

    • @mdmozammilkhan4957
      @mdmozammilkhan4957 3 роки тому +11

      e.g. stackoverflow is still monolith and scales well

    • @TheLaucomm
      @TheLaucomm 3 роки тому +9

      In fact, for 99% of applications out there, a microservices architecture is the wrong approach as it comes with a lot of downsides (especially its high complexity and the fact that it is hard to debug as most distributed apps are) that are only worth dealing with if the very limited upside makes a huge difference for you (as for streaming services or extremely large websites like Amazon etc.). For the vast majority of apps out there, some kind of simple architecture, with or without layers, is still the way to go. Microservices are fascinating and hotly talked about and many people think because of that, that they should implement a microservice architecture, which is not the case. Introduce only as many abstractions/components/layers etc. as you actually need.

    • @chessmaster856
      @chessmaster856 2 роки тому

      Yes. Breaking database has a lot of consequences that may nor be worth the effort

    • @sasuki479
      @sasuki479 2 роки тому

      jus chill dude

  • @darrensapalo
    @darrensapalo 3 роки тому +13

    12:20 - "I'm not going to recommend anything as I haven't applied these on my projects yet, but this is what I've learned so far"
    That ladies and gentlemen, is a clear sign of an honest and generous person. Thank you.

  • @palpek1544
    @palpek1544 5 років тому +34

    These videos of yours are so good, and easy to understand, it's insane! You are a great teacher!

  • @shivamvishwakarma1475
    @shivamvishwakarma1475 4 роки тому +31

    12:46 when I am in an interview. BTW, nice explanation.

    • @VasileSurdu
      @VasileSurdu 3 роки тому +2

      nullpointer exception

    • @nammi895
      @nammi895 10 місяців тому

      🤣🤣🤣🤣 man u really have an eye of eagle & good sense of humour

  • @adamhughes9938
    @adamhughes9938 4 роки тому +13

    A great example of the tradeoffs one makes w/ microservices. Wish tech executives would understand this before they just decide that every system in a company is now going to be microservices.

  • @pubgbattleground9208
    @pubgbattleground9208 3 роки тому

    ek number bro, maza aagya, so simple and detailed explanation

  • @vaibhavsrivastava4645
    @vaibhavsrivastava4645 3 роки тому

    Awesome content. Thanks for sharing knowledge. Appreciating your hard work.

  • @raghuvardhansaripalli9636
    @raghuvardhansaripalli9636 4 роки тому

    superb video thammudu..
    @UA-camrs: THIS IS A MUST WATCH VIDEO for distributed transactions basics related to microservices.

  • @nreed7718
    @nreed7718 2 роки тому

    Kudos on a great overview and explanation.

  • @DattatrayaTembare
    @DattatrayaTembare 4 роки тому +2

    Apricate your efforts to put all this information together!
    I like your style of explaining the things using comparison. Most (old) people know how things work in monolith and it's easier for then to understand how it works differently in microservices.
    Thanks! for all these videos on microservices, keep doing your good work.

  • @ArjunKumar-zu2kl
    @ArjunKumar-zu2kl 5 місяців тому

    Nice explanation, thank you so much...🙏

  • @kumarc4853
    @kumarc4853 3 роки тому

    that knife attack on order microservice was a killer move!. Exxcellent video sir

  • @shabbir5638
    @shabbir5638 3 роки тому

    Thank you Sir. For making these videos and helping us.

  • @ameynaik1755
    @ameynaik1755 3 роки тому +1

    Can you please make a video on Coupon Management System? Thanks!

  • @shivaakrish
    @shivaakrish 3 роки тому +1

    Thanks for the nice explanation. Question : why cant order service call customer wallet serivce through api call and do the processing instead of having distributed transactions ?

  • @nreed7718
    @nreed7718 2 роки тому +1

    Thanks, I was unaware of how distributed transactions are handled in microservices because quite honestly, I've never seen any of these in the systems I've worked on. Either transactions were handled in a relational database or there was no need for transactions.
    In the last scenario (sagas), I think we can imagine what might happen after a successful wallet check: Create a message that can be used to fulfill the order (eg. sufficient funds). Presumably, there are workers that pull these messages from the queue, and there is another set of services for order fulfillment, inventory, etc.

  • @abhaysoni8631
    @abhaysoni8631 3 роки тому +1

    can u please make a video over grpc , why and when to use it, its pro ad cons and how is it compare to rest api

  • @IshantSharma29
    @IshantSharma29 3 роки тому +19

    @Narendra Nice video. One correction though: In 2PC, If Prepare Phase is successful and then during Commit phase one of the parties cannot commit it, the co-ordinator retries that. The service that is not able to perform commit has lost it's right to say NO to this transaction. The Coordinator will keep on pushing the transaction to this service. Even if the service went down, when it comes up, it will be forced to apply this commit. This is one of the drawbacks as well.

    • @vijayrajan5792
      @vijayrajan5792 2 роки тому +1

      Thats why one has timeouts.

    • @nreed7718
      @nreed7718 2 роки тому

      @@vijayrajan5792 I would imagine you can define a retry policy, too (num attempts, timeout).

  • @lamanaghabayova2704
    @lamanaghabayova2704 2 роки тому

    Great explanation, thanks!

  • @HLTSoftwareSolutions
    @HLTSoftwareSolutions 3 роки тому

    Very practical understandable enjoyable thanks

  • @SANDIPKUMAR-es7qh
    @SANDIPKUMAR-es7qh 4 роки тому

    Nice explanation... Thank you !!

  • @arunsinghk1
    @arunsinghk1 3 роки тому

    Great explanation. Thank you

  • @ravitiwari2160
    @ravitiwari2160 3 роки тому

    Hey, Thank you so much all your knowledge sharing. I am able to perform very nice in all my interviews. Keep up the good work. More power to you.
    Keep rocking!!!

  • @numbergame4414
    @numbergame4414 5 років тому +5

    Narendra, Thanks for producing unique and original content

  • @nagadityapenumerthy9951
    @nagadityapenumerthy9951 4 роки тому +1

    Thank you for explaining the distributed transaction management in various ways.

  • @SaifulIslam-fs2li
    @SaifulIslam-fs2li 4 роки тому +11

    What will happen if the ok wallet commit returns "ok" but the ok order commit doesn't return "ok" ? How do you undo the ok wallet commit as it is already committed ?

    • @snehasharma4601
      @snehasharma4601 3 роки тому +1

      I think they are keeping a count for the number of commits on the basis of prepare statements, if the count matches(in this case it would be 2) then complete the txn else rollback. This is just my assumption, I could be wrong also.

    • @harvendrasinghrathore2848
      @harvendrasinghrathore2848 13 днів тому +1

      Yes, ideally it should roolback the complete transaction or maybe retry on the failed one.

  • @funnybugsbunny
    @funnybugsbunny 4 роки тому

    very good topic. Well covered

  • @parthec1
    @parthec1 2 роки тому

    thanks for making video,,,

  • @saikumarnakirekanti1982
    @saikumarnakirekanti1982 4 роки тому

    superb .. nice explanation

  • @narendrakumariitb
    @narendrakumariitb 3 роки тому

    Great explanation thanks 🤗

  • @tarvindersingh1928
    @tarvindersingh1928 3 роки тому

    Thanks its really helped me to understand the concept

  • @smritiverma8990
    @smritiverma8990 4 роки тому

    Please elaborate more on SAGA, which is most popular and useful.

  • @ShohraAfaque
    @ShohraAfaque 5 років тому +5

    In the SAGA example, what happens if
    - There are multple `Customer Wallet MS` hosts, scaled horizontally.
    - And two different Orders from message queue (q) for same customer is received by two different `Customer Wallet MS` hosts at the same time.
    - I guess we are again back to the same lock situation where same customer wallet will be tried to be read-write and may result in data coruption.

    • @sanketpatel4350
      @sanketpatel4350 5 років тому

      I think that's why he mentioned that messages in the Queue are sequential, let say, for example there were 10 shirts in the inventory, Customer 1 placed an order to buy 1 shirt, so Message will be placed in the queue (bought:1, remaining: 9) this message will be picked by Wallet service 1 and processed. In the mean time Customer places another order to buy 1 more shirt, at this time, 2nd message will be placed in the queue (bought:1, remaining 8) and this messages will be picked by Wallet service 2 and processed. This still will work without locks. In case of failures in Wallet Service, the service which handles failures will update the inventory by (failed:1, remaining: 9). does this make sense ?

    • @ShohraAfaque
      @ShohraAfaque 5 років тому

      @@sanketpatel4350
      Lets assume 2 customer place order at the same time (eg: 02:10:33 AM) two messages will be placed in the queue (bought: 1, remaining: 9), (bought: 1, remaining: 9). And then two different Wallet service host comsumes these two message independently. How this situation will be handled?

    • @sanketpatel4350
      @sanketpatel4350 5 років тому

      @@ShohraAfaque good point, this won't be possible though as Order micro service will use transactions for the DB it manages. so only one order can go through at any given time, one of those requests will win. in the end, it will put 2 messages (bought:1, remaining:9) and (bought:2, remaining:8). does it make sense ?

    • @ShohraAfaque
      @ShohraAfaque 5 років тому

      @@sanketpatel4350 Going with transaction lock on db will have some consequences. Lets consider the scale of Amazon, there 1000s of host in Order service. Each time you are placing an order you cannot make a transaction lock on the db table. It will have very bad consequences as there are more than thousands order placed every second. If you make a transaction lock at every db entry the latency of placing order will shoot up like crazy. The solution for this can be using a distributed lock, hashed on product ID but isn't it similar to 2 phase or 3 phase commit, my question is how saga help without placing a lock? We already have 2 or 3 phase commit which uses lock.

    • @sanketpatel4350
      @sanketpatel4350 5 років тому +3

      @@ShohraAfaque first of all, databases are shareded, Also, secondly doesn't lock the entire table, it just locks a single row in a single table. companies like visa, mastercard and other banks processes thousands of transactions as well.

  • @maven7650
    @maven7650 8 місяців тому

    I recently implemented SAGA pattern, can you kindly implement the 2-phase commit with example

  • @eliseumds
    @eliseumds 5 років тому +14

    Oh, that's interesting. I had no idea about this extra microservice to deal with roll-backs for a saga. Makes sense.

    • @yousuffmalik
      @yousuffmalik 4 роки тому +14

      The extra service is not really needed as the order service can also listen to the failure events on the queue

    • @amitmhatre35
      @amitmhatre35 4 роки тому +4

      What is the point of creating new microservice which will eventually point to same db

    • @milindkhurd
      @milindkhurd 4 роки тому +3

      @@amitmhatre353rd ms will make it anti pattern, wound'nt it?

    • @sreddy8141
      @sreddy8141 3 роки тому

      @@amitmhatre35 may be jus to meintain the single responsibility design principle, jus guessing, im not sure though 🙂

  • @makixie9151
    @makixie9151 3 роки тому +6

    First, I very much appreciate the video, but with 2 suggestions: I don't think the advantages of 3PC over 2PC are well-elaborated, and it would be better if the comparisons (pros and cons) of the 3 patterns are compared.

  • @ashwinsingh1561
    @ashwinsingh1561 3 роки тому

    Good Content!

  • @soudaminipanda
    @soudaminipanda 4 роки тому

    You explain really well. It is very rare for somebody to explain so clearly going through the ideas step by step.

  • @toabhijeetsingh
    @toabhijeetsingh 4 роки тому

    @Tech Dummies : Wonderful video. You have a very easy explaining style. Keep it up.

  • @vipinkoul9129
    @vipinkoul9129 4 роки тому +2

    Thanks for the nice video. I have a few questions:
    1) Does each micro-service commit to their DB or it is done by the Co-ordinator?
    2) For the "commit" part, assume CustomerWallet MS give "ok commit" whereas Order MS didn't report commit/fails; how does it work then?/
    3) Is Co-ordinator a generic component or custom made? who is providing it? I am aware of, in the context of the J2EE, it is provided by the Application server. Since we may not be using Application-Server all the time, who' providing the co-ordinator?

  • @rockingdude8383
    @rockingdude8383 4 роки тому +4

    Thanks Narendra for this wonderful explanation. I have a question, What happens in 2phasecommit if let say in your example the commit order fails? Is the customer wallet rolled back?

  • @rplusgdj
    @rplusgdj 5 років тому +6

    Nice video, thanks a ton. For next video, can you please pickup this subject "How to protect your distributed system, or how to protect your endpoints from DDOS, i.e. security aspects of system design."

  • @shreyashosur9578
    @shreyashosur9578 9 місяців тому

    Hi Narendra,
    You have explained it very well.
    I have few doubts here. I browsed these doubts all over the internet and I did not get proper answer in GPT as well.
    1. What if the paricipants have multiple replicas ? How co-ordinator will make sure the prepare and commit request will always hit the same replica ?
    2. I am thinking out this doubt in Java/Spring Implementation. I know transactions can be created using Transaction Annotation and a same thread will work until the transaction is committed.
    Once participant creates local transaction, it must be in a new transaction thread.
    So how this transaction thread is stopped from committing and how it commits after receiving the external request(http thread) from co-ordinator since both threads are different. In simple terms, how the two different threads are communicated ? one is new http thread(prepare or commit) and already created transaction thread ?
    I hope the understanding of doubt is clear. Please let me know if there is a problem. I will elaborate maybe.
    I am badly searching for the doubts.

  • @adamhughes9938
    @adamhughes9938 4 роки тому

    Not super clear how Saga solves the distributed transaction problem since the example only considered a single microservice, but solid information. I can learn more myself now, thanks.

  • @johnchenault7933
    @johnchenault7933 3 роки тому

    One note on your SAGA example. I opine that a decline message from Wallet goes to the original Order service ( not some other new service). The order service likely needs to understand creating, deleting, modifying, etc orders. You don't build a separate microservice for each function about orders, you have a service that understands all of the 'order' function.
    In the same way, I question the Wallet service responding to a successful order by replying to the caller. How does the wallet service know enough information to talk to the caller? All it should understand is how much money is in the wallet, and be able to add / subtract amounts. An 'OK' message should go to the Order service and let it tell the user that the order was successful.

    • @singireddybharath3583
      @singireddybharath3583 4 місяці тому

      Yeah, for place order request that will be the response, is it accepted or created??

  • @aatifnazar8203
    @aatifnazar8203 4 роки тому +4

    I was recently asked in an interview how do you rollback transaction in a microservice architecture and my answer was to wait for the response for an interval and if you don't get it it means your transaction has failed and use another microservice to roll back. Turns out thats what Saga actually does! I feel pretty cool now bcos i knew nothing about saga before this video!

    • @keerthikanthchowdary2676
      @keerthikanthchowdary2676 4 роки тому +6

      sagas actually rely on eventing mechanism, not timeouts. In case of a failure downstream, you will get a failed event over message broker, which is then consumed by the service to take an appropriate action (which is roll back in our case). Sagas increase the overall application complexity, but the problem of distributed transactions is solved.

  • @chessmaster856
    @chessmaster856 2 роки тому

    If resources are not locked means dependent actions can happen before rollback is issued. So if you buy 100 ,before it is completed, sell of 50 is issued. How do we make sure that sell of 50 is not processed without waiting for distributed completion of previous action.that means something has to be synchronous. Some things can not be asynchronius.. commit or rollback must be synchronous or in the same queue in the same sequence before next sale of the same. Or before any dependent action. You can't have a rollback k in some async fashion without preventing dependent actiobs

  • @leonidus101
    @leonidus101 5 років тому

    One of the best videos on this topic I have seen on youtube, very good explainations!

  • @krishind99
    @krishind99 3 роки тому

    Saga, does solve the complexity in 2 or phase commit. But if a front-end is waiting to update the customer on an order, will it be polling a Queue/Datastore for update directly or indirectly through another microservice? Either ways, that also seems to be problematic????

  • @friohao5398
    @friohao5398 4 роки тому

    Excellent job!Learned a lot from your video!

  • @phssyk2
    @phssyk2 4 роки тому

    Thanks so much for the videos, really good explanation on a very complex topic

  • @rettipatti
    @rettipatti 3 роки тому +7

    Nice explanation. Thanks. A question- The co-ordinator we are talking about for 2 phase and 3 phase commit is nothing but doing orchestation work. Correct ? Or do we see any difference between co-ordinator and orchestrator?

    • @VarunKeshav
      @VarunKeshav 3 роки тому

      One difference that comes to mind is that an orchestrator doesn't directly involve itself in data processing. It only "manages" the services assigned to/created by it. The co-ordinator on the other hand actually gets involved with some level of business logic implemented into it.

  • @MaxPicAxe
    @MaxPicAxe 3 роки тому

    What a great video!

  • @snowy0110
    @snowy0110 5 років тому +4

    Narendra, isn't microservices and SOA defined by different authors differently? As I tried to investigate the differences between SOA and microservices, I came to the conclusion that there is no common agreement on what SOA is. Moreover, some people don't see the difference between SOA and microservices. Moreover, from my perspective, ideas are actually the same. Decoupled services that are part of a system and provide small pieces of functionality.
    To be honest, software development in 2019 is full of not-strictly-defined terms which really bugs me.

  • @muqiturrehman6577
    @muqiturrehman6577 4 роки тому

    great explanation, but I did not understand how response will send back to UI/client when we use second(queue) based approach. I mean suppose I am one micro service receives https request from browser and this micro service pass on the request other micro service than which micro service will respond to browser ?

  • @karan6551
    @karan6551 4 роки тому

    Awesome bro.. ❤️❤️

  • @chrsitina5363
    @chrsitina5363 4 роки тому

    This is a great video, thanks for sharing!

  • @Tommy-dd5pz
    @Tommy-dd5pz 3 роки тому +1

    In SAGA, what if customer wallet MS fails to send messages to queues, or the queue fails?

  • @dineshchandgr
    @dineshchandgr 3 роки тому

    amazing video

  • @ashishburnwal9010
    @ashishburnwal9010 5 років тому

    You have explained so clearly. Thanks.

  • @rishiraj2548
    @rishiraj2548 6 місяців тому

    Great thanks.

  • @rambo4014
    @rambo4014 3 роки тому

    Which systems use orchestration and which use choreography?

  • @vikasjindal3791
    @vikasjindal3791 3 роки тому

    Videos are very good. But all your videos have sound issue - low and unclear. Can you please work on this?

  • @bowang1825
    @bowang1825 4 роки тому

    whats your point of adding three phase commits? seems the whole point is message queue which hands the problem very gracefully.

  • @dataguy7013
    @dataguy7013 4 роки тому

    Narendra, great video. Keep it up.

  • @narendrakumariitb
    @narendrakumariitb 3 роки тому

    What was that pause for at 12:45 😆

  • @rkfarms3309
    @rkfarms3309 2 роки тому

    In SAGA pattern , what if customer MS fails, how the failure is handled and the order MS has been notified ? Also, what happened to the message in queue service?

  • @murali1790able
    @murali1790able Рік тому

    How does single db used by two micro services work? each micro service locks its own table and how can we ensure the transaction is valid when update involves in two or three different tables?

  • @Dave0Grave
    @Dave0Grave 5 років тому

    in the last example shouldn't the customer wallet publish a rollback message that is consumed by the Order MS? Otherwise how does the record in the Order MS get rolled back (or updated to be in some sort of failure state)? If it is eventually rolled back by a message that is published by the Rollback MS what is the purpose of the Rollback MS? Would love to understand the benefits of an additional service if there is one:)
    one more nit: from what I understand only certain message/queue technologies such as Kafka have the capability of processing messages in order out of the box. do you know of many others or is there typically a way to add-on in-order processing to any queueing system? thanks for you videos!

  • @pengli7213
    @pengli7213 3 роки тому

    In saga patter, what if customer wallet ms also talks to a database and put the money into the database before sending message to next queue? I think the sequence should be like: 1. customer wallet ms writes to DB successfully. 2. customer wallet ms send message to output queue. 3. customer wallet ms commits offset in previous queue. Could you elaborate the failure model when a database is involved here?

  • @Amin-wd4du
    @Amin-wd4du 4 місяці тому

    He is the best

  • @raihanurrahmanjewel9873
    @raihanurrahmanjewel9873 6 місяців тому

    Please give me name of some book. For mastering system drsign. Remember, not for interviewing but learning.

  • @VikasGarg-jf1wq
    @VikasGarg-jf1wq Рік тому

    why did you put an orchestrator ? Orchestrator is overkilling or not?

  • @TheDibyendusarkar
    @TheDibyendusarkar 4 роки тому

    The statement that it blocks the row at 31:00 is entirely wrong. First if it locks the row no other transaction can happen for the same user in parallel, which is required in some cases, 2nd its a bad idea to let an external system to lock a row. Instead it should be something like reserve for sometime.

  • @2007faizi
    @2007faizi 4 роки тому +4

    What if last transaction commit failed how can we roll back rest of transaction in 2-phase
    commit

  • @SuperSatya09
    @SuperSatya09 4 роки тому

    In 2PC ,
    What you have prepared to commit in 1st phase.
    Will handle to that be available to commit
    In Second phase ? Which is completely different call .

  • @yifeixu1797
    @yifeixu1797 2 роки тому

    In the saga pattern, what if order service goes down after committing db changes. It means, order is created in db but no event fired, so wallet service won't be notified. How can the system recover?

  • @TechCornerWithAjay
    @TechCornerWithAjay Рік тому

    What happens if one of.the commit succed and other failed?
    How do we revert a committed transaction if it's completed?

  • @AnuragKumar-hr3hj
    @AnuragKumar-hr3hj 5 років тому +3

    How the rollback happens in 2 phase commit if a commit fails?

    • @vaneet0
      @vaneet0 5 років тому

      Yes i also could not understand this.

    • @IranForeverFree
      @IranForeverFree 5 років тому

      There is a WAL persisted at RM during prepare phase, the RM/follower tries to commit when it recovers or get a commit from TM after recovery. In general there is no fault tolerance with 2pc, for that you move to paxos commit or a more advanced protocol.

  • @deeproy2719
    @deeproy2719 2 роки тому

    for the saga pattern if there are more than one instance of microservice M1 listening to the event... it is very critical to maintain the order in this case (maybe those events were required to be in sequence, like we have partition keys for kafka) . What are your thoughts on this?

  • @sfontesv
    @sfontesv Рік тому

    Why do you need a "Customer Wallet Rollback" microservice? Why not just have the Order Service consume the "rollback event" directly?

  • @hyperborean72
    @hyperborean72 3 роки тому

    Does SAGA really brings any advantage in speed considering that if some service fails all other participants must rollback previously committed transactions?

  • @hrishabhg
    @hrishabhg 4 роки тому +1

    Microservices and Queue Servers need to be highly available in order to make the isolation work. For example, if the rollback message is stuck in the queue or not processed by the consumer microservice, there will be an inconsistent state for the system.

    • @tuanva6484
      @tuanva6484 2 роки тому

      total agree

    • @CiceronFelix
      @CiceronFelix Рік тому

      If you are using kafka then message is considered idempotentally consumed only after brocker had recieved and commited ack from service.

  • @LazzyProgrammer
    @LazzyProgrammer 9 місяців тому

    Microservices do not mean "small". Size is not at all the criteria to categorise if it is microservice or not.

  • @ayeshatahreem5479
    @ayeshatahreem5479 5 років тому

    In 2PC, why are you first checking customer wallet and then you are going for order creation? You should first create order and then check wallet like u did in SAGA Pattern.

  • @kanglei7807
    @kanglei7807 3 роки тому

    Hello, is there any book or paper recommendation on database storage/engine/transaction design? thanks?

  • @micamsr1
    @micamsr1 5 років тому +1

    Congratulations about this video!!! Thanks so much, man!!!

  • @iitgupta2010
    @iitgupta2010 5 років тому +2

    Great bro..so fast

  • @shivraj777
    @shivraj777 5 років тому +1

    Content is good. Would like to see this simple code example of order using saga or 2/3PC.

  • @iitgupta2010
    @iitgupta2010 5 років тому +2

    Thank. But if you see that application like IRCTC or any other where it’s highly concurrent both methods give major disadvantage.
    First of all n- phase commit is out of scope.( you cant make highly concurrent structures with this)
    Second even saga has issues.
    Lets take a simple example
    There are 5 seats available in a particular train.
    And in normal/rush hour 100’s of user try to book the ticket (only 5 are there) then saga would reserve the seats even though the payment service failed or not responded yet or just put the failure to a queue not processed yet (anything) meanwhile some other user came and try to book tickets
    What u think what happen?
    This all fails
    I think we should know how smartly web like IRCTC works.

    • @jpnr8
      @jpnr8 5 років тому

      Saga with horizontal scaling helps here??

    • @iitgupta2010
      @iitgupta2010 5 років тому +1

      @@jpnr8 I don't think so .. there must be some awesome thing done by IRCTC...
      I'm wondering if Narendra would make a video on IRCTC

    • @jpnr8
      @jpnr8 5 років тому

      @@iitgupta2010 okay.. lets explore.

    • @IranForeverFree
      @IranForeverFree 5 років тому

      That's why distributed transaction is a hard problem to solve, many corner cases and hard to get it correct. Adding scalability to the equation and it makes it a lot harder, that's why in general DT don't scale well, same reason systems like Casandra/DynamoDB go for high availability rather than consistency and don't even talk about harder problems like ACID.

  • @stoneshou
    @stoneshou 4 роки тому +1

    what are typical choices for the sagas queues?

  • @bharatchouhan9710
    @bharatchouhan9710 4 роки тому

    Nice video , I want to know how the amazon flash sale works? .can you make video on it in details? .Thanks in advance.

  • @anbesivamkamal
    @anbesivamkamal 4 роки тому

    Excellent!!!

  • @SANDIPKUMAR-es7qh
    @SANDIPKUMAR-es7qh 3 роки тому

    Awesome

  • @serenachan413
    @serenachan413 3 роки тому +9

    Hey Narendra, thanks for sharing this! But I still haven't 100% consumed the part of difference between 2-phase commit protocol and 3-phase commit protocol. Would you mind educating a little bit more on it?

    • @patdubus1
      @patdubus1 Рік тому

      From what I understood, the difference is with the canCommit and preCommit, so a new coordinator can decide to move forwards or roll back.
      canCommit tells the new coordinator how many are in the cohort (how many commits across nodes do we need to coordinate).
      When new coordinator checks the log, if number of canCommit == number of preCommit and at least one commit was sent, we can roll forwards from the last commit we sent since we know which direction we decided to go in. Otherwise, we should roll back (abort).

    • @CiceronFelix
      @CiceronFelix Рік тому

      ​@@patdubus1 so on a lock phase everything went good and then on commit phase something failed. Why bringing 1 more extra step solves a problem?

    • @CiceronFelix
      @CiceronFelix Рік тому

      Also instances of coordinator suppose to share a log storage which is mentioned as an anti-pattern.

  • @sandeepk9640
    @sandeepk9640 3 роки тому

    Thank u 🙏🙏

  • @straightup7up
    @straightup7up Рік тому

    In my experience, many developers building microservices today regard XA global transactions as dinosaur technology. They talk about SAGA and compensating transactions to undo previous commits but this requires building compensation services. Has anyone had success with SAGA? When I hear "compensating transactions" I think "rollback" which XA coordinator does automatically, so why bother building compensation services yourself is XA gives you that?

  • @jyotichoudhary2109
    @jyotichoudhary2109 4 роки тому

    In 3 phase commit- what if coordinator sent do commit to one participant only before failing.. And that participant becomes next coordinator.. How will the new coordinator identifes that other participants are still waiting for' do commit '

  • @hemsagarpatel8992
    @hemsagarpatel8992 3 роки тому

    Hi Sir, why it is not scalable is we are using single db we can db pods and increase the number of pods ?

  • @ThePradeep2010
    @ThePradeep2010 3 роки тому

    I have a project with choreographed event driven microservuce architecture (Kafka for communicating these events). We have a need to have transaction across database and kafka (eventually other services). We plan to use transactional outboxing pattern. Do you have better alternative?