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.
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.
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
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 ?
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
@@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.
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?
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?
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?
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.
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
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 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?
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 🙂
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.
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
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.
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
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 🙂
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.
@@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 from design perspective, it can follow similar architecture as autocomplete with small variation ua-cam.com/video/jFOR1LBEUgM/v-deo.html
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.
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.
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?
@@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.
@@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
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.
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.
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.
Great video, this looks apt for me and in 25 mins it covers all basic functionality that's really awesome
This channel was shared to me by a FAANG recruiter. It's kinda sad I didn't know about this. Great content!!
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
Thanks :)
Wooow
Hey man, I really appreciate your work. Thanks for these videos.
Glad these are helpful. Do like and subscribe and share with others 🙂
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 ?
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
@@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.
Thanks for your time.
Any payment gateway system design plan would help us to know a real-time application. Have a good day
Yes it is planned after design pattern series
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?
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?
Can directly connect to order database or call an api exposed by order service
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?
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.
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.
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
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?
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
@@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?
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 🙂
@@TheTechGranth yeah now it is cleared thanks😅
@@aakash1763 sometimes it gets tough to explain over comments 😂
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.
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
hey how we can remove the products from mongodb. when the count became zero in mysql ?
Thanks for new video.
Can you please make video on - design a online book store or something equivalent
thanks
Do you mean, some sort of library management system? Because just an online portal selling books will look something similar to this design.
Shouldn’t be there a microservice for operations team to get notified regarding the order and inform the seller ?
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.
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
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 🙂
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.
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
@@TheTechGranth OK!
Before order gets placed a real time inventory call will take place
cart service will talk to checkout service and checkout service will talk to payment service(very imp part u miss)
Are these any way will help a frontend developer ????
May be a bit, it may be asked just to check some problem solving skill or to check how you approach a problem
@@TheTechGranth for front end what type of problem ??? Generally it's asked for backend dev lrofile na
@@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
Make truecaller system design also :)
Thanks for the suggestion, will add it to my list :)
www.diva-portal.org/smash/get/diva2:684053/FULLTEXT01.pdf
@@TheTechGranth thanks :)
@@buildleadinnovate24 from design perspective, it can follow similar architecture as autocomplete with small variation
ua-cam.com/video/jFOR1LBEUgM/v-deo.html
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.
can you share complete architecture diagram in single screenshot
Well That is supposed to be a homework for viewers :) you can come up with your own design as well to improve on mine.
NIce 👍
Hope it was helpful. Do like and subscribe and share with your friends!!!
@@TheTechGranth Done. Thank you for sharing your knowledge and hope you will come up with many more such useful content ✌️
@@financekacharcha1419 Yes for sure, each like, comment and subscription motivates a lot. Please share as much as you can
Thanks
Hi..are u an ex-employ of product based company
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.
Payment service should not talk to inventory or filter service. That's not good design.
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?
@@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.
@@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
@@AnkitChaudhary2601 do subscribe and like the video and share with your friends :)
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.
Can you name some of those?