System Design | Amazon System Design | System Design Interview | E-commerce | System Design Tutorial

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

КОМЕНТАРІ • 67

  • @mehtavijapur
    @mehtavijapur 4 роки тому +12

    You should discuss about the non functional requirements - Consistency and Availability.
    Also, adding some back of the envelop calculation would help design the backend system.

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

      All the components used are distributed components and services will be microservices which can scale horizontally. But I get your point, thanks for suggestion I will touch these points in my upcoming videos.

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

    Great video, this looks apt for me and in 25 mins it covers all basic functionality that's really awesome

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

    This channel was shared to me by a FAANG recruiter. It's kinda sad I didn't know about this. Great content!!

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

      Really glad to hear 😀 Do checkout the tutorials, like and subscribe and share with others.
      Hope the content was useful.
      All the best for your interview

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

      Thanks :)

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

      Wooow

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

    Hey man, I really appreciate your work. Thanks for these videos.

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

      Glad these are helpful. Do like and subscribe and share with others 🙂

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

    Good system design. Neatly explained.
    Few clarifications required:
    1.) In Non Functional Requirement, it is mentioned for consistency and high availabillity. But as per CAP theorem, it cannot be possible in case of partition failures. This system should aim for consistency.
    2.) For searching the product, DB used in diagram is the one which is populated by On board product service. But this DB doesnt contain info of how many items left for the product. Rather the DB used for searching the product should be the one filled/updated by Inventory service. Based on this count, user can determine whether the product can be purchased or not.
    3.) How do we handle a return of a product ? Should there be a separate front end service for handling this ?

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

      1) not true for all components, may be for payment and inventory
      2) it does not matter how many products left, as long as your request is served for the quantity of product selected, if request can't be served then it will return null set and hence order can't be placed
      3) yes a new flow will be required which is not covered

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

      @@TheTechGranth what I feel for second point whenever search is happend it happend on product not on inventory quantity as we can show them out of stock also on product listing page.

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

    Thanks for your time.
    Any payment gateway system design plan would help us to know a real-time application. Have a good day

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

      Yes it is planned after design pattern series

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

    Great Video!
    One question- how to build the functionality of dashboarding for senior leadership to make important decisions based on the aggregated information? How can we connect to let’s say a power Bi db?

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

    Also to show the past buying of the particular user that responsibility will be also of UserService so it means in user database we will store all the orders details or UserService will contact with the order service?

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

      Can directly connect to order database or call an api exposed by order service

  • @nehasingh-ld7bn
    @nehasingh-ld7bn 3 місяці тому

    How and when is the Product 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?

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

    I see 2 flaws in the current design.
    1. You are applying filter service to return only those products, which can be delivered to user location
    2. what if the user is searching for a product, which needs to be delivered to a diff location. may be sending a git to friend who lives in another city. in the current case user will not be able to see the product, as it will be filtered in the search.
    I suppose to avoid this scenario, it is better to return all the products and once the product is finalised, then allow the user to apply the delivery pin code to check ( same as amazon) if the product can be delivered to that place. in this case, the filter service can be renamed as delivery check service and will kick in when the user checks the same.

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

    Hi , I like your tutorial , can you please tell me a better idea to start preparing as a beginner till good system design export for job interview.

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

      You can start with the basics check out my videos on cap theorem, load balancer, rate limiter etc followed by high level design and then low level design

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

    one doubt inventory service database you said it would be SQL database as inventory service is listening to an event and it will add the details of the seller and the product details so product details data is unstructured as you mentioned so wouldn't inventory service database be NOSQL type please clarity?

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

      No both product and seller data will be structured. You can always create a table for product assign a product id and categorise product based on type

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

      ​@@TheTechGranth Thanks for the reply still not able to get your point.
      I think I didn't ask the question correctly.
      My question was that when some seller onboard a new product he will add quantity and product details and product details will be unstructured data so onboard service will have Nosql data.
      and after saving this thing in Nosql database it will push an event to inventory service about this product like its quantity, description, seller and its address etc. so will inventory service will be Nosql because there also we are storing product information or you are saying that onboarding service's database would be SQL and there will be only structured data like its id, quantity, sellerId, seller address and rest of the details we will fetch it from onboardingservice's nosql database because we have stored product id in the SQL database?

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

      Your last point in the reply is correct understanding, Inventory service database will have the extract of the products in a structured way like product id, seller id, category, quantity etc. If you want to display the details of a product fetch it from onboarding service database or have the onboarding service expose and api. No point duplicating the data here. I hope I am clear now 🙂

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

      @@TheTechGranth yeah now it is cleared thanks😅

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

      @@aakash1763 sometimes it gets tough to explain over comments 😂

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

    Hi, I really enjoy your video. can you make a video on how to design a property listing site? nterviewer wanted me to write all the classes, apis, database tables and relationship.

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

    The Tech Granth can you explain how reservation happens for product in ecommerce like two people add same product and third one came at the same time so we need to show him out of stock like that scenario

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

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

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

    Thanks for new video.
    Can you please make video on - design a online book store or something equivalent
    thanks

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

      Do you mean, some sort of library management system? Because just an online portal selling books will look something similar to this design.

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

    Shouldn’t be there a microservice for operations team to get notified regarding the order and inform the seller ?

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

    Payment service should not call invetory service that is of no use if any user comes aftr two three days also it will first go to cart page only so we can only call inventory service from there that will check wether it is still out of stock or available second inventory service should not fully responsible for the thing that wether it should be deliverable or not we can make use of one more service that is carier engine service that can give you estimated dates and wether it is serviciable or not. Payment service should only handle the payment related things.

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

    Hey,
    I'm towards designing a multiple functionality site featuring ecommerce+social media like TikTok
    Plz, some recommendations in system designing of my project
    Thanks

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

      You can check this video for ecommerce. I will be publishing video on system like instagram reels or tiktok soon. Do like and subscribe and share with others 🙂

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

    One Question which I have in my mind is that, what if the stocks get empty in inventory but cache still shows it. that the product is available. Is it good to have such thing into our system? or it is a problem which has some solution not discussed in this video.

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

      That will be a usual case for products in high demand, as i mentioned, before payment we will do a check if the item is available in inventory

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

      @@TheTechGranth OK!

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

      Before order gets placed a real time inventory call will take place

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

    cart service will talk to checkout service and checkout service will talk to payment service(very imp part u miss)

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

    Are these any way will help a frontend developer ????

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

      May be a bit, it may be asked just to check some problem solving skill or to check how you approach a problem

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

      @@TheTechGranth for front end what type of problem ??? Generally it's asked for backend dev lrofile na

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

      @@abhishekpradhan7824 I have not appeared for a front end role so can't tell from experience but generally DS and System Design is asked if you have 5+ years of experience and for front end developer, you may be asked questions from reactJs or angularJs based on your past experience and job description

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

    Make truecaller system design also :)

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

      Thanks for the suggestion, will add it to my list :)

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

      www.diva-portal.org/smash/get/diva2:684053/FULLTEXT01.pdf

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

      @@TheTechGranth thanks :)

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

      @@buildleadinnovate24 from design perspective, it can follow similar architecture as autocomplete with small variation
      ua-cam.com/video/jFOR1LBEUgM/v-deo.html

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

    No , if the payment failed , ur cant straight away put item back in inventory .Its a disaster. U will let the customer know the payment failed and ask him to update payment method or retry payment. U give him some time . Further, y u r so eager to alter the inventory database ? use first come first serve and change the database only when the item was shipped out. Further u need a central database in which sellers database update complete information and ur elastic search database can contact it periodically ( say 15 mins ) and update the contents info.

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

    can you share complete architecture diagram in single screenshot

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

      Well That is supposed to be a homework for viewers :) you can come up with your own design as well to improve on mine.

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

    NIce 👍

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

      Hope it was helpful. Do like and subscribe and share with your friends!!!

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

      @@TheTechGranth Done. Thank you for sharing your knowledge and hope you will come up with many more such useful content ✌️

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

      @@financekacharcha1419 Yes for sure, each like, comment and subscription motivates a lot. Please share as much as you can

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

    Thanks

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

    Hi..are u an ex-employ of product based company

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

      Yes Gaurav, I have worked in product based companies, but not FAANG. I hope you like the videos and it helped you. Do like share and subscribe. Let us know if you found videos helpful.

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

    Payment service should not talk to inventory or filter service. That's not good design.

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

      Before you ask someone to pay, you need to cross check if the item is still present in your inventory or not else we might run into the situation like the flipkart's 1st big billion day :) What do you think?

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

      @@TheTechGranth yes, I agree you need to do validation. But not at payment layer. Payment service is just to do payment processing and business logic for validation should be at another layer, let's say order management system/service. This service will take care of order generation, and will be talking to inventory service. Inventory service can have db constraints like count of item cannot go negative. Order management service will do soft reservation of items by reducing item count in inventory service. Then order management service will call payment service to process payment.
      Now if payment is successful, all good.
      If payment fails then OMS has to revert item count by calling inventory service. Here we need some sort of expiry/TTL which OMS will be observing in case of payment failure as you do not want to keep your item count low although item is available.
      Hope I am able to clarify my thoughts.

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

      @@AnkitChaudhary2601 you are right, it is my fault with naming convention. What you are referring to as oms I referred as inventory. But agreed, even with oms we can refactor and have a separate inventory service

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

      @@AnkitChaudhary2601 do subscribe and like the video and share with your friends :)

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

    I would be careful in an interview not to go in to detail about functional requirements you haven't listed. I think it's fine to mention them, but maybe in passing.