Amazon System Design | Flipkart System Design | System Design Interview Question

Поділитися
Вставка
  • Опубліковано 29 вер 2024

КОМЕНТАРІ • 338

  • @ritukothariable
    @ritukothariable 4 роки тому +57

    Thanks for sharing this video. Really appreciate the clarity of thought in your explanation and flow of the design.

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

      Glad you enjoyed it!

  • @abhimanyunagpal3086
    @abhimanyunagpal3086 3 роки тому +26

    I have watched multiple videos on system design but the content you have is exactly what is needed to crack the interviews. You are among the best on youtube in terms of content !

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

      Thanks Abhimanyu!!
      Glad to hear this.
      Do spread a word about us amongst your friends. It helps everyone :)

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

      I want to know one thing. In which kind of use cases item database mongo-db will be used? as We have already search engine DB for searching items, inventory ? how inventory service and elastic search talk to each other

  • @vadirajjahagirdar9342
    @vadirajjahagirdar9342 3 роки тому +3

    This is at next level. I am making notes of all your videos and recently cracked a company. My best wishes to you brother :) :) God bless you :) :)

    • @randomguy4822
      @randomguy4822 2 місяці тому

      Bro I am also making notes , can we connect on linkedin

  • @FranciscoGomez-tw1ii
    @FranciscoGomez-tw1ii 3 роки тому +2

    I have my first interview tomorrow and i was so scared, thanks to your videos i no longer feel like that and i feel like im actually capable of showing of what i learned so far in my career tomorrow. THANK YOU

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

      All the best for your interviews!

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

    One of the best system design playlist out there. So underrated!

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

    This has been a clear vision for the process with multiple DB depending on the what type of data we are getting saved.
    It helped me a lot. I have designed one solution. If you have linkedin or similar can we connect.
    Just for a clarification, like MongoDB, Cassandra and Analytics tool can't we use any ERP based backend like SAP, ARIBA for purchase flow to make it more easy and smoother. These already have best Load balancing. I am a SAP consultant and looking for the similar solution that i have seen for multiple industry in my project experience.

  • @debs1991
    @debs1991 Рік тому +1

    You speak to common man! Really knowledge booster. Thanks you :)

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

    first person who doesn't teach just for interview purpose but in general how systems are designed, really appreciate you :)

  • @АнастасияБелова-ч4т
    @АнастасияБелова-ч4т 3 роки тому +27

    I work at Ozon (Russian equivalent of Amazon) and yes, our architecture is quite similar

    • @aashishsawant3150
      @aashishsawant3150 Рік тому +2

      Do you have idea about How item service communicate with Inventory service ?

    • @trishulcurtis1810
      @trishulcurtis1810 7 місяців тому

      Instead of Item service, you can just use inventory service I think@@aashishsawant3150

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

    You have explained the CAP theorem so easily which was really challenging to understand. Kudos!!! Keep up the good work.

  • @iitmvaibhav
    @iitmvaibhav 2 місяці тому

    crisp explanation and covered all aspects

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

    Its great explanation of system. I want to know one thing. In which kind of use cases item database mongo-db will be used? as We have already search engine DB for searching items, inventory & Order databases for transactions and Cassandra for historical based queries.

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

      Prashant, I have also the same question. If you got answer could please explain to me ?

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

    Sandeep, Excellent .... Thanks very much...THis is a very intuituve design I have ever
    seen...its pretty much covers almost all details....

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

    Great explanation and well organized content flow in the video. Nicely covered many components of system design. Thanks a lot for creating this video. .

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

    Very helpful video. Thank you so much.

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

    So many use cases covered, awesome design and explanation. Thanks mate!

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

    Great video as always. Thanks for this as it help developing thought process to architecting solution. One thing, no detail as about the Inventory service like from where it data get populated. As we have item service to keep product details. It will great if you put your thought on this to understand the flow. Inventory service is one of the service.

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

      I want to know one thing. In which kind of use cases item database mongo-db will be used? as We have already search engine DB for searching items, inventory ? how inventory service and elastic search talk to each other

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

    Very clear and well explained all the features.. thanks for sharing, I appreciate your efforts.
    Could you please make a video on how to design Database schema for e-commerce app in details?

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

    This is what I was looking for, really helpful video bro, thanks a lot for your effort

  • @krupaharan12345
    @krupaharan12345 3 місяці тому

    Thanks for the details.
    Could you clarify few doubts, Is Elastic Cluster stores all the item information or only newly onboarded ones ?
    Search Service doesn't need to talk with Item Store for collecting all the items ?
    Can you help me reg the differences btw Item and Inventory data Store ?

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

    Wow! This is very well explained. Thanks!!

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

    This is really so much helpful

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

    Video is really very helpful. But one suggestion if you can little bit slowdown while describing. :)

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

    Hi Sandeep, Thanks for the amazing videos. They have been very helpful. Would love to see more videos coming like Designing Dropbox, Pastebin, Web Crawler etc & system design patterns.

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

    could you please clarify if the inventory service updates its data by talking to Warehouse service or Item service DB? Is there also a Sync between warehouse service and Item Service? When supplies adds an item, does the event gets consumed by Warehouse, Item, Inventory services at the same time?
    Warehouse service does not have any database?

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

    Happy Learning Indeed Sandeep!!!
    Lot of good points discussed - you talk about choice of components right in the context of design than suggesting a read up.
    It is also better than a few paid subscription tutorials.
    One suggestion: I liked the write up on codekarle describing system design which you traded for closed captions/subtitles. Can you add them on your website? Easier for a 2nd go over...

  • @ravindrajonwal580
    @ravindrajonwal580 2 роки тому +2

    Thanks for the awesome video Sandeep.
    I have one doubt. why have we used 2 different databases for item service and inventory systems?
    Are items not part of inventory?
    or we are only storing count of items in inventory(mysql) and item details is stored in item db(nosql)
    Can you please clarify my doubt?

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

      I am also having the same doubt, are items not part of inventory?

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

      @ravindrajonwal580 yes you are correct i guess sandeep forgot or missed but inventory service is having item_id and count related stuff and actual details of that item is present in mongodb

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

    Thanks your videos are great. Can you do a video on Coupon Management & Donation website system design's too ?

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

      Thanks!! Coupon Management is on the TODO list. We'll try to do that soon :)

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

    Sir, can you also make one video on how to design Mutual Fund buy/Sell management Application.?

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

    Simple yet very efficient

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

    very good content. thank you!

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

    thanks for this. It really helps.

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

    item would be just single table?

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

    quite helpful...

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

    @codeKarle Can you please do a video covering Design Kafka

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

      Do you mean how to design a Queuing System? Honestly there cannot be anything better than the design of Kafka/RabbitMQ for this, but we'll try to cover this in some video.

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

      @@codeKarle +1 you cover a lot for Kafka can you give a video talking abt its design?

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

    Beautifully explained, why a particular techology for the given component is what Liked most

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

      Thanks!! Glad that it was helpful!!

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

    Thank you so much. One question: who is using the item service ? I don't see any link with the item service in the board.

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

      Item service is used to fetch details about the product. It is used by both recommendation and search service in order to display product details on the page. Item schema is non-structured, hence it uses mongo DB. Inventory service maintains availability of items and it stored structured data (item_id, sku_code, quantity), hence uses MySQL.

  • @vortexgamingtv0
    @vortexgamingtv0 11 місяців тому

    please make type ahead system design

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

    What does TAT stand for?

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

    please do a video on webcrawler

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

    Next on Zomato/Swiggy

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

    I think Wish List and Cart service should not be associated with Search service rather it can be directly connected to user pages once he/she is logged in.

  • @amareshsat
    @amareshsat 3 роки тому +61

    The improvement what I see in your videos is you keep everything drawn already on the board rather drawing it on the go. That would have been good as to know how you think through the whole system and how you approaching step by step. Also one more thing is the diagram could be more organized so when you talk you run through any flow it should be one functional flow from start to end rather than picking random components.

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

      Anyone has idea about How item service communicate with Inventory service ?

    • @neurocat6453
      @neurocat6453 Рік тому +1

      That would make some of his 1-hour videos 3-hours length though... When everything is prepared he is able to cover more aspects and go more in-depth in shorter time. Anyway, I am not sure if we will see new videos from him.

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

    @CodeKarle Nice explanation.
    Since the order, payment, and inventory are managed by separate microservices, we may need distributed transactions here. Thinking about cases like we reduced the inventory but the order service failed to persist the order. It would be great to discuss this issue along with different distributed transaction algorithms (Paxos, 2PC, 3PC, Saga etc) in your next video.

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

      Exactly my thoughts. As Sql doesn't provide distributed transactions, the statement made in video is little misleading

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

      Right..Also they whole order taking journey is synchronously spanning through multiple microservices. Would that not block the customer?

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

      Archit, Do you have idea about How ItemService communicate with InventoryService ?

    • @sudhanshukumar-yu7fj
      @sudhanshukumar-yu7fj 3 місяці тому

      Correct, SAGA is way forward here. 2PC and 3PC are quite slow in real world, besides making this process synchronized suffers from late response to the client. A better way in SAGA suggests that we provide an immediate response let the SAGA complete. Once completed or rolled back then confirm the order.

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

    Videos are good and intensive. Also please show rough estimates - traffic estimate, memory estimate, storage estimate etc

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

    1. I dont think we need to store items in mongoDB. we can store all the items in just elasticsearch and that can be our source of truth. The Item service can also be built on top of elasticsearch only.
    There won't be a lot of updates on the products added so we don't have to do reindexing in the elasticsearch. So, for the required use cases, elasticsearch should be sufficient.
    2. cart and wishlist service should be interacting directly with the load balancer. once we get the product id we should be able to directly call the cart service. we should not call the search service for adding items to the cart.
    3. what if the order service taking service itself fails before confirming an order. How can we handle those scenarios?
    4. do we really need to create created state in db for order service? Is it because we want to see these orders as cancelled orders in my past orders? Will this state be applicable in a food delivery app like swiggy?
    Thoughts?

  • @asg3hb
    @asg3hb 2 роки тому +10

    Great video as always. I found myself liking the videos in which you draw the system in real time. It gives a much better idea of a system being built to solve multiple levels of problems step by step. It also keeps the viewer more focused on the piece being worked on.

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

      Do you have idea about How ItemService communicate with InventoryService ?

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

    Thanks buddy for such a nice explaination. Since this is Amazon and hence global presence, I had few questions which may be asked in an interview
    1. How is the user service Db synched , e.g. user is in India however now he went to US and access US website. Will there be a master Db which will have info about all Users or how will the system sense where to fetch user info from ?
    2. If we say the DBs of all regions will sync with some Master DB, how will this sync happen ?
    3. Will there be a Load Balancer infront of REDIS (wherever its used ) ?
    4. Infact there can be a LB infront of every service component, if not then how are the requests routed as there could be multiple servers running that service ( e.g. Cart Service) ?
    Could you ( or any other user) please help to provide some guidance on this ? Thanks in advance.

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

      I want to know one thing. In which kind of use cases item database mongo-db will be used? as We have already search engine DB for searching items, inventory ? how inventory service and elastic search talk to each other

    • @sudhanshukumar-yu7fj
      @sudhanshukumar-yu7fj 3 місяці тому

      Thoda khud se bhi doondh le bhai

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

    At 18:59 Is it like the inventory table will be accessed and updated by only one transaction at a time?? if its so then how can multiple orders be placed during high traffic conditions?? How will we achieve parallel processing then?

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

    mysql speed insert ~ 8K rows/s
    speed update ~ 3k rows/s
    when request createOrder, updateOrder over rate limit this, do you share ideas hanlde this problem? thank you

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

    Shouldn't output of "Spark Cluster" be directly stored into Cassandra? How would "Recommendation System" know when to talk to "Spark Cluster"?

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

    How do these services communicate each other. Through RESTApi or through RPC or any other efficient approaches? Since these services are internal, communicating through REST is not an optimal approach.

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

      I would prefer some RPC framework like Thrift/gRPC for the internal communication and REST for external communication.
      That being said, if we just consider performance, REST is not too bad comparatively, there is just a little bit overhead, and in most use cases it won't make too much of a difference, unless you're building a mission critical time sensitive thing.
      This is the main reason why a lot of companies tend to use REST across their tech stack which helps them to avoid the learning curve, migration efforts, and complexity.

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

    Best explanation. Though i have one doubt for "USER PURCHASE FLOW"
    Instead of "ORDER TAKING SERVICE" and "ORDER PROCESSING SERVICE" can't we just have one "ORDER SERVICE" (which will do 2 things take orders and view live orders) as it seems too much of separation of concern OR is it done to segregate READ and WRITE traffic?
    Also let "ARCHIVAL SERVICE" talk to "OMS MYSQL DB" for getting orders which are in TERMINAL State.
    What are your thoughts?

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

    sir, why have you stopped uploading videos, we all are enjoying your knowledge so much! Please can you upload more of such videos, it will mean a lot to all of us.

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

    1) I think Wishlist and cart service flow should not go via Search Service. What do you think? 2) Spark ml data should get stored in database ( druid/cassandra) to get consumed by recommendation service

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

      You're right, the APIs to the services you meantioned would be independent anyway, just that the wishlisting/adding to cart usually is done by the users post search results are shown. That's why it follows the search results in the user journey. Functionally, they are totally independent.
      The recommendation logic can run as a Spark job which then then store the data in any datastore through Recommendation Service. The same service would then consume the data written in that data store to power various recommendation based functionalities.

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

      I want to know one thing. In which kind of use cases item database mongo-db will be used? as We have already search engine DB for searching items, inventory ? how inventory service and elastic search talk to each other

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

    How does the Serviceability + TAT service talk to Warehouse and Logistics Service for calculating the ETA? Can it talk to them directly offline? Serviceability + TAT service is a consumer of Kafka for events from Logistics and Warehouse service? How is it?

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

    Sandeep... design a Recommendation System and designing a distributed key value store would help... Possible to take these up in ur upcoming videos?? BTW.. every video is awesome Sandeep.. best System design videos I have seen so far... very clear and not over the top, very precise yet very detailed.. Awesome work Sandeep..

  • @soumik76
    @soumik76 2 місяці тому

    I have a couple of issues with order taking service.
    Firstly it's doing way too many things, including talking to multiple services and caching.
    Each is a distributed transaction, how are we handling failures?
    What happens if inventory decrement happens and redis caching failed?
    Are you planning on using 2-phase commits? That presents its own complications like coordinator being a spof. Additionally 2pc is slow.
    Can we not follow a event driven architecture? Publish events to Kafka and let the microservices handle the events as they want.

  • @nehasingh-ld7bn
    @nehasingh-ld7bn 10 днів тому

    How and when is the inventory DB getting populated? And once an order is placed, shouldn't it decrease the number of items from product DB as well as Elastic search cluster?

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

    How is wishlist service db partitioned?
    Can’t be based on geography as that may put a lot of load on one node and rural vs urban area issue. Can’t be based on a product as then for the same user to get all the info multiple nodes will be hit which is not a good design.
    IMU we may be able to do so based on the country + user. In that way we may not need to scale all the data servers belonging to all countries. Also we may small countries with population in a range all together.

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

    Suggestion - Please start with a brute force way to design a system, it gives more confidence to one

  • @AmanGarg95
    @AmanGarg95 3 роки тому +45

    I worked at Flipkart and the architecture described here provides good insights into what we do. Good one. We're more on HBase than Cassandra though.

    • @codeKarle
      @codeKarle  3 роки тому +3

      That's great to hear!!

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

      @codekarle how can we implement the discount that Flipkart provides that vary time to time

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

      Can i get your contact info ???

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

      @@rahulsinghai3033 rule engine 🤔

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

    It's not like I am trying to make some comparisons here but I usually prefer watching multiple videos for the same design topic and I can easily say that I find Sandeep's tutorials the most comprehensive and lucid at the same time. Awesome job there Sandeep.

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

    Great video. Can you please do a follow up video covering OMS system built top of this architecture. Can you also discuss some tradeoff and improvement which can be done. Ex: scalability wise? Thanks.

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

      Sure, we'll try to make that.

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

      @@codeKarle thank you. Can't wait to see your follow in-depth design. As always great content. One suggestion: can you also discuss future improvements and tradeoffs of the design and architecture for upcoming videos. I think, that's important to understand as well. Ex: If we go serverless by using lambda, stepfunction, etc

  • @tyapka
    @tyapka 3 роки тому +5

    I really liked the breakdown on how to lock items in inventory and how to deal with expired orders.

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

      Do you have idea about How itemService communicate with InventoryService ?

  • @SandeepAS-ov3fk
    @SandeepAS-ov3fk 2 місяці тому

    Y two repository of items. Item service with mongo for storing items and another searchite service with ES for search. Y not search from mongodb itself?

  • @RicardoBuquet
    @RicardoBuquet Рік тому +1

    Having worked in a super large system for 11 years (Groupon) I give this overview a 5 stars.

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

    If user information is in user service, item information is in item service, and they are having their own DB, then during order processing there shouldn’t need any db transaction that stores order?

  • @VY-zt3ph
    @VY-zt3ph 21 день тому

    This is not just a system design video. It as entire course on how to divide a usecase into a microservices arhchitecture.

  • @PawanSharma-le6hk
    @PawanSharma-le6hk 2 роки тому

    Thanks for your awesome videos, really appreciate the effort. Please create a video for the Google Drive kind of service also.

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

    Thank you for this great presentation. I still don't understand why Cassandra is the choice for archiving orders due to limited query patterns. Can't mysql accomplish the same goal as Cassandra for that use case? Is mysql just overkill for archiving?

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

      Since the data will keep growing, Cassandra scales much better than MySQL

  • @bhanuprakashrao1460
    @bhanuprakashrao1460 7 місяців тому

    Why are the wishList and Cart Services modelled on Relational Database(MySQL) and not a NoSQL like MongoDB?
    Any strong reason as to why or why not would have been good.
    I'm not seeing any need of ACID properties for wishlist or cart services, or scaling would be good if its NoSQL.

    • @JinilSasidharan
      @JinilSasidharan 5 місяців тому

      That make sense. I think a NoSQL key-value data store like DynamoDB would be more suitable.

  • @prajaktakhose9511
    @prajaktakhose9511 2 роки тому +2

    Amazing video ! I had one query regarding the first LB. Should API gateway be used for first LB shown in diagram which will take requests from users?

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

      He has abstracted that. It should be API gateway and load balancer behind that.

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

      @@coolchippy , Do you have idea about How ItemService communicate with InventoryService ?

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

      @@coolchippy want to know one thing. In which kind of use cases item database mongo-db will be used? as We have already search engine DB for searching items, inventory & Order databases for transactions and Cassandra for historical based queries.

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

      @@aashishsawant3150 Item database is for storing item details, description, images, url, etc. Each item will be different so no-sql is the best way to store. Everytime you open an item page on the portal, ItemService will be used to fetch item details.

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

      @@aashishsawant3150 ItemService is for fetching item details and InventoryService is for checking if item quantity is available to fulfill the order.

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

    Great video as always ! very clear thanks ! only one point of improvement if you can use a better mic as sound clarity is not the best

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

    how can we create the order or orderId before the payment gets processed, only after the payment, one gets the orderid right, and should make that entry into the db for order right in the payment service.

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

    Thanks for sharing this. One question. Why would wishlist and cart service have MySql specifically. Looks like a List to be maintained per user, Why not NoSql

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

      There is no right answer for these choices honestly. You can make that on top of a NoSQL as well.
      My reasoning for using RDBMS:
      1. Not huge traffic for addition/removal from cart/wishlist.
      2. We need ACID here. for ex: It'll look bad if an item disappears from cart after adding just because the get request got served from a different machine.
      I have created a video that will go over this in more detail @ ua-cam.com/video/cODCpXtPHbQ/v-deo.html

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

      @@codeKarle Thanks for sharing these videos. Hoping to see more content from you !

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

    Overall good video but very similar to the booking system design video you made. In terms of workflows.

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

    Awesome video. Really like your style of explaining the design. Seems very natural and incremental in approach and understanding.

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

      That's great to hear!! Thanks for the kind words :)

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

    Thank you. Very quality design, with most of components, edge case cover.
    Best system design material with real life issue/functionality.
    One feedback, it would be great if you can show yr whiteboard with diagram without you in between so that one can take screen shot and keep it for future reference.
    Thank you very much.

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

      I want to know one thing. In which kind of use cases item database mongo-db will be used? as We have already search engine DB for searching items, inventory ? how inventory service and elastic search talk to each other

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

    What happens when payment success and payment expiry callback gets triggered at the exact same time?

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

    Good stuff but if this is a system design interview video, you should build your design as you progress as opposed to describing a design that you have done in advance. Design interview is all about thought process, what you should teach someone is how to think about problems and how to come up with solutions. This is certainly a helpful video, but not really for a system design interview. I want to know where you started and how you progressed in your design process, the final design is not really relevant.

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

      If you dont like a video do not pose useless comments , this is one of the best videos in youtube

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

      @@shrinikethr3797 haha, why? aren't comments the means to express your thoughts about a video? Or, am I only allowed to post a comment if it reads "the best video on UA-cam"? lol.

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

      It's good to hear criticism, helps in the long run :)
      From what I understand, what you are suggesting is more of an iterative approach, where we improve the design one step at a time, maybe based on new things we encounter, or feedback from the interviewer. From what I noticed over the years is that it usually end-up being inefficient as we loose time.
      Alternatively, it's best to take one use case at a time, take care of whatever is required to fullfil that, and go through the whole user journey, making sure we focus on one usecase at a time. In the end we can connect the loose ends like analytics, or something that the interviewer wants to get into.
      If you try to follow this approach, this whole design comes naturally as you progress, and there are far lesser iterations. All you need to do is to spend two minutes thinking that are there any usecases that you want to club together.
      The only pre-work done in these videos was the drawings in the board, because doing it while presenting adds a lot of distraction. Had I tried to draw while presenting, it would have been very similar to what you expect I believe.

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

      @Shriniketh R, Thanks for the good words :)

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

      @@shrinikethr3797 I think either you have not given a system design interview or you don't know how such interviews should be approached. I loved the video but I also echo what
      @Pedram has mentioned.

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

    Hi Sir , Great Video learnt a lot. I have a question .So when we search an item , does item DB and Elastic Search DB interact ? Little confused with the use of Item DB

    • @sudhanshukumar-yu7fj
      @sudhanshukumar-yu7fj 3 місяці тому

      No, they don't need to. While searching we need to be able to remove out of stock items and filter out the unserviceable places which can be achieved by inventory db assuming it also has the addresses of the suppliers of the items.

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

    Thanks for this nice explanation, please clear this doubt.
    We have an order taking service and an order-processing service both are updating order entity and must be having one order table in the system . Now how these both service keep the order table consistent, What should be the DB strategy for this like master slave, replication etc.?

    • @sudhanshukumar-yu7fj
      @sudhanshukumar-yu7fj 3 місяці тому

      In reality order-processing service is nothing but an orchestrator service which makes sure that the order has passed through all the checks (passing through all the dependent services) and takes steps to rollback in case of failure. So yes, it's needed albeit the naming could have been better to avoid confusion.

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

    Why not Cassandra for Item DB? as queries are going to be only based on item id's!

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

    Why does wishlist service and card Service do not talk to the User Search Page? Why they call to the Search Service?

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

    Hi, thanks for the quick insite, it helped a lot in understanding the system design,
    I have a small question, if we have elastic search for viewing items then who are the consumers from item service(mongodb)

    • @sudhanshukumar-yu7fj
      @sudhanshukumar-yu7fj 3 місяці тому

      mongodb is the persistent store of the items. Elastic search does not guarantee persistence.

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

    Crystal clear thought process and explanation too. Thanks for the excellent video.

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

    hey how we can remove the products from mongodb. when the count became zero in mysql ?

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

    Thank you for the video. I had a question.
    If we have an inventory DB here, what is the use of the mongo based Item DB? How are they linked?

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

      Item service is used to fetch details about the product. It is used by both recommendation and search service in order to display product details on the page. Item schema is non-structured, hence it uses mongo DB. Inventory service maintains availability of items and it stored structured data (item_id, sku_code, quantity), hence uses MySQL.

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

    please do make a LLD video on how to approach a low level design for a given HLD system

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

    Very nice explanation. Appreciate your effort. Have a question. In your design I see multiple services sharing a database. In general, it's not considered a good practice to share a database across services. Is there any specific reason/justification for sharing databases?

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

      Usually I prefer to use one service-one DB model.
      Some exception to it are the usual Search flow, where I usually keep one service to support the queries of search and other service to support the data population. Intent there is to make sure I am able to scale them independently, incase the search traffic surges but the inflow remains the same.
      A few times I have done it in other videos as well, where one service is writing data(tweets for example) and other service is used for reading. Again the reason is to scale the read and write flows independently.
      Another place where I do it is where everyone is writing to Hadoop or Kafka, which I believe is not a problem.
      Can you please let me know which specific scenario you are referring to here so that I might be able to share the justification for that scenario.

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

    one question on payment. If the payment succeeds but the server calling the payment API is down. How can you address the issue?

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

      There would be a reconciliation system build that handles all such events. It would basically to a comparision between all the orders that were supposed to be paid for and all the payments that actually happened and then take corrective actions or refund if required.
      Ideally the service that gets the response from payment gateway would be a very light weight service, to reduce the probability of such a thing happening.

  • @shubhangipandey8712
    @shubhangipandey8712 5 місяців тому

    I have one doubt, can you please ans this - why are we creating item service and its db when we are doing all the crud operations in inventory management system?

    • @JinilSasidharan
      @JinilSasidharan 5 місяців тому

      Inventory service only handles the stock count. But Item service handles all the details of an item like name, price, description etc.

  • @Jeff.Wilson
    @Jeff.Wilson 3 роки тому

    Thanks for the content, it's very good. But for non-Indian, it's quite challenging to understand the strong accent (no offense intended). Don't take it personally, but I guess you'll be able to attract much more viewers if you'd work on your pronunciation.

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

    This is the very comprehensive and clear explanations of the concepts, I have seen so many videos in platforms like udemy, linkedin learning, Oreilly but I found this explanation and design best for the ecommerce platform.

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

    I think it would be better to populate elastic from events from the item server since it's the source of truth of all the seachable items.

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

      I want to know one thing. In which kind of use cases item database mongo-db will be used? as We have already search engine DB for searching items, inventory ? how inventory service and elastic search talk to each other

  • @psk2166
    @psk2166 3 місяці тому

    Thank you for sharing, I've learnt a lot from you :)

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

    Very well explained! This is a large scale platform. If we have a medium size platform. Can we use Rabbitmq instead Kafka? If we use rabbitmq what are some changes we need to make to the Architecture?

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

      Architecturally nothing would change. You can use rabitMQ instead of Kafka if you scale is low, but if you are not using any extra features that rabbit MQ provides I would still recommend to go with Kafka

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

      @@codeKarle why do you prefer Kafka over rabbit MQ?

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

      @@bowang1825 Multi-consumer and persistence, and also scale as you already mentioned.

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

    Why would Order Processing Service talk to KAFKA?

  • @MakrandGurav
    @MakrandGurav Місяць тому

    I've always found Sandeep's videos very detailed and info worthy. I like how he gets to the point and gets it going from there.
    Thank you!