This popped up on my feed and I actually enjoyed watching it. It's a realistic interview where the interviewer can ask some unexpected questions that make you nervous. Gaurav is pretty experienced but he's also nervous here. It's better than watching rehearsed System Design videos.
For the first time Gaurav looked bit nervous in his videos as he was the candidate here and Yogita looked confident :-) . For the inventory design part I feel Gaurav should have started with the Source of Truth itself i.e how to store the items data either in a RDBMS or in a No-SQL DB like Mongo DB or Cassandra rather than starting to think about Elastic Search for the searching part first. Always start from DB side and then move upwards in the system's layers. Very nice video.
But for a system designing first we need to look into the matter as customer centric rather than an engineer centric way. Although he appeared here for a low level solution architect but to give this discussion the initial perspective, high level search requirements needs to be put into table at the beginning. Engineering details should come once we delve deeper into technical details.
ES also shouldn't be used as a source of truth since writes go in-memory first before they are flushed to disk, making ES less durable than a regular database
This was an amazing interview. The interviewer asked some really good questions and Gaurav was able to explain things from all angles. Thanks for collaborating. My first video on this channel and already subscribed.
This design still need some parts which is essential. 1) Space estimates and capacity estimates 2) DB design which cover store link of photos, videos etc 3) Monitor metrics need proper name like QPS, error rate, latency(50% , 75% , 90% percentile) 4) data partition 5) High level design with LB, Cache etc
Yes definitely....but yes the interview will be only 45 min so they have skipped many things. But when candidates will prepare they need to think about every part because you never know in which part interviewer will be interested
@@sayantanbhaduri3874 This!! Depending on the job/Interview they may not care Caching, LB or NoSQL (new Start up). Unfortunately, "we" have to know about everything. Some Interviewers may just ask very detail questions on DBs or spend 20 mins on Networking protocols. The questions could be based on your resume only. The list goes on!!!
This was really a good discussion , really liked it. Since you have emphasized more on inventory, I was waiting your explanation, "how inventory can be managed in a distributed system" which is essentially adding an existing products, consuming this products, locking on data and provide correct inventory while user search on this product. If you can create some thing details on inventory would be awesome. Also don't forget to build another video on event-driven approach for this same use case. Lastly thank you both of you for your effort to help people.
Finally , Thanks a lot for the most awaited video on full system design , Please also introduce some LLD questions as well . Thanks a lot for such an amazing content.
3:56 I spot an error he said "denormalize" and then went writing a normalized image catagory table .... think he tried to say normalized image details from product table
It was really cool to see Gaurav clarifying the requirements and making sure that Yogita is also on the same page. Also the way Yogita was explaining the scenarios and driving the interview was truly awesome. Thanks for the video!!!
Very nice discussion! Gaurav very well maintained balance between product focus and diving too deep in details; In other words - zoom in and zoom out during the discussion is amazing. Also, questions from Yogita are very pragmatic and based on real world scenarios & challenges.
Hi Yogita, Instead of considering RDBMS as a single source of truth, can we remove RDBMS and instead make a cluster of ElasticSerah and make it a single source of truth? By doing this we can remove the overhead of updating RDBMS and ElasticSearch at the same time. The other services can read from the slave/master ES instance and user service can read from master/slave?
Dude elastic search is expensive. You can’t just dump all the data just like that. I was bit disappointed when Gaurav said - “I don’t see a problem when the millions of users start using it”. Rest everything was great. Thank you both for doing this.
yogita, gaurav. Thankyou, thankyou soooo much. you can't believe what this video has given me in my career. God bless you both. allah aap dono ko salamat rakhay. ❤❤❤❤
Very realistic video. :). It goes to show that regardless of how well you can do a design on your own, once you get into the interview situation, you get nervous and then you often times make mistakes that you would have never done on your own. :)
Fan of both of you! TikTok design was way awesome, you started with monolith and scaled it for DAU. Thanks to both of you for system design lectures, I got selected in PayPal as SDE-2. My system design round was awesome because of some great contents you guys have created. 🙂
To Be Honest! In my real experience, interviewer was never listening to me while I just say I will use Elastic Search let say... They would dig deeper into every how. And always complicate even simplest thing. I remember in one of my interview where most of the part was spend on HOWs of loadbalancer.... For me this is not even close to how my system design interviews went 😪
It’s not a hard and fast rule. There can be trade offs, if the org and engineers are aware of those trade offs and risks, it can be their decision at the end.
Great video and many many things got clear. Another thing that we could cover in the debugging part is when 2 or more user purchases the same product and quantity of the product was 1. So some sort of locking would work!.
I love the videos you do with people but please choose the people you are doing the interview with carefully. VIdeos that you have done with Gaurav Sen are great because both of you have great knowledge about the topic. Please don't pollute your videos doing interviews with people who are just trying to prove they know but they don't. This video actually helped me learn a lot. It was a very relevant video even after 2 years of it being created. Also please try to go into more detail or make a playlist for this type of problem which are lengthy.
What about short video retrieval of the product when the consumer searches for a product ? Will it come from S3 directly to the user's front end ? How will you address latency issues of video retrieval ? Also , what about product reviews by the consumers ? I feel , the MVP should have at a basic feature for product review for any E-Commerce solution .
Thanks for the interview itself. It was so much insightful at the same time so much fun to watch, also many concepts are covered up in the smartest manner. Thanks once again to both of you. Gods Of Systems Design 👨🏻💻🥰
If only design interviewer are that descriptive. I can always add two lines to descriptive questions but the whole point of this interview is to come up with problems, tradeoffs, solutions ourselves. No cache? no images? Monitor metric names look so naive.
Monitoring -Instead of the cron job, let's define the status as processed and fire event if the processed status is not updated within a timestamp. Also sending slack message to fire event notification cannot be considered for bulk jobs as it will consume the resources of the system. Alerts can be added using platforms like datadog. Health check every 5 seconds - Rather let's have a dead letter queue for failed event and fire an alert if the queue gets failed record. It will save the system resources.
Great video. But please keep in mind, you cannot keep adding items to Elasticsearch and expect it to reflect immediately. As Elasticsearch index needs to be rebuilt inorder to reflect the newly added items since the last index build. May be we can periodically rebuild the index and while it is down for that period, serve the response from a slave node of Elasticsearch.
@@sudocode I guess ES should be on a different server. Here RDBMS is the producer and ES is the consumer. Although event-driven mechanism will work fine.
Nice, What about image of different sizes for preview and thubnails. We should store them separately. Or change size within a service using server code so that to make sure that we are not sending high resolution images in product catalog.
Can you please share similar discussion or system design for Banking domain to follow? Like architecture, event driven approach, database to choose, and many more things.
you guys are talking about start development with monolith design but different deployment for each service.....so i want to understand if you are deploying individually then how it can be monolith application ?
What do we do if the payment is done but PayPal fails to send a response? We have the status "purchasing" and it gets stuck there. How do we finally send a success response to the customer?
This actually gave a feel of system design interviews, liked it a lot. Just wanted to clear a doubt regarding the search use case. Shouldn't SOLR be a better option here instead of elastic search as the search items which are the products related data would be mostly static?
I think CDN should be put in front of S3 if the images need to be delivered to whole world without much latency. But it is not file storage, S3 or something like that is very much needed
I guess Auto scaling feature might be highlighted in this blog once . Elastic Search the unique one I found & Product ID & Image Id description is also great to hear .
what you will do incase of hotSKU sells / flash sale / mega sale where you will have only few stocks and there are millions of customers are searching for same. How do you show correct inventory ?
good job, now please made these in depth videos for adding and removing items in cart and delivery tracking, This seems part one of a super awsome anime series.
One feedback gaurav your videos are amazing just that white board makes it difficult to watch because of lightings If possible could you do something about it like use a tablet or online tools that will help better to see it visually and follow along
Gaurav great presentation! Yogita your videos are always much appreciated and your way of simplifying and relaying information is like no other! I would love to see your system design solution for this requirement if not too much trouble :) Once again thank you both!
Great discussion, but not great as an interview due to the lack of structure and missing important pieces like: did not discuss non functional reqs, dove too deep in some areas but missed complete components to talk about. Time management needs to be accounted as well get the full system high level design, then detailed system design and then ask the interviewer where do they like to deep dive
A little misleading, the beginning was a bit off. The interviewer won't be telling this much in the beginning. A viewer should keep in mind that this is not a mock interview.
This is the common mistake developers do. Going for monolith and thinking that it can be converted to microservices in the future. Believe me if you do not get time initially to make it microservices base, how will you get time in the future to convert? Going for MVP is the thing PO uses to put the product in the market as soon as possible but it does not mean we go with something for now and thinking it can be improvised in the future. I take interviews in Europe and believe me it does not go well always!
Enjoyed it, like the rest of the videos. Future mein agar aap hindi mein content banaoge toh bahut hi useful hoga jinko angrezi samajhne mein takleef hai. I know lot of young techies(some reporting to me) very talented, but unable to follow us to the full, when we have our meetings in English :(. Just a small suggestion, for future :). I would then defintely guide all of them to your videos as you really know how to break down complex stuff into easily digestible pieces
subscribed...great I found this channel...I had 1 question though referring to 17:20, so here we discuss about using an RDBMS to store new products or update the existing inventory after every purchase against a product and then merging those updates to the NoSQL DB(Elastic Search) from time to time as the NoSQL DB would be used for searching and display of products to the users real time. But what if an user searches a product, gets the details as well as the count of the stock and just after that NoSQL DB is refreshed with new update for that product from RDBMS and stock becomes 0 for that particular product. How to handle that? Would you use some distributed transactions or JTA transaction manager or something for consistency? The tradeOff definitely would be that it would slightly slow down the system.
You don't use ES as your source of truth for stock numbers. ES just holds general details of the inventory. The RDBMS would hold the true stock numbers. While your situation is valid (stock goes to 0 after adding it to your cart) it has nothing to do with ES and it's something you have to verify at check out or by reserving stock when it's in your cart (with an expiry time). If this were my design, I wouldn't have the product service update ES directly. The product service would queue a job to update ES.
the comment section of every sudocode video is extremely technical and complex. Meanwhile, Me currently learning DSA and Webdev for Campus placement:. isko toh ab jaldi finish karna padega, abhi toh bohot kuch padhna baaki hai to become a SWE. 😲
Amazing content. Love you both. Have a question here since select * like %string% does a Full table scan. Is not the optimum solutions when you are talking about a huge inventory. Is there a better optimised way to do that?
where clause had name & description columns where name was supposedly indexed in which case the SQL optimiser will not go for a full table scan due to the presence of a indexed column.
Thank you for nice videos, can you make a video on system design on Forex trading platform where live exchange rates and instant order execution is a must requirement
I am an interviewer at Microsoft I’ve done close to 500 interviews. Few things to keep in mind - there is no right or wrong answer for a System Design Question! The questions you ask for clarification matters a looot! Don’t ask just for the sake of asking. Don’t ask templated questions. Be genuinely curious! Always always focus on simplest end-to-end scenario first. Don’t try to talk about ALL optimizations at once. Keep making points like - We can have xyz optimization here, let’s come back and address it.
Yogita was superb though out the interview she had great insight . Not sure what happened to Gaurav, he keeps jumping one design/though over other, until chimed by Yogita. Great mock interview though 🙏
He was thinking out loud and that’s exactly how system design interviews take place. It’s upto the interviewer if they want to dig deep on one design or hear multiple views. He managed to cover a lot of depth in a short 45 minute interval 😊
I think the idea of going monolith to get an MVP out is a bit confusing. I would still go with a distributed system even so the team is small and we have an MVP time which is strict. Breaking down a monolith and reworking on the system after the MVP is out is not a great idea. I have seen this not work in the past and BLOATING the system and increasing the overall deployment times. I would still break this into Microservices each doing what needs to be done. Monitoring can also be done easily then
This popped up on my feed and I actually enjoyed watching it.
It's a realistic interview where the interviewer can ask some unexpected questions that make you nervous. Gaurav is pretty experienced but he's also nervous here.
It's better than watching rehearsed System Design videos.
For the first time Gaurav looked bit nervous in his videos as he was the candidate here and Yogita looked confident :-) . For the inventory design part I feel Gaurav should have started with the Source of Truth itself i.e how to store the items data either in a RDBMS or in a No-SQL DB like Mongo DB or Cassandra rather than starting to think about Elastic Search for the searching part first. Always start from DB side and then move upwards in the system's layers. Very nice video.
But for a system designing first we need to look into the matter as customer centric rather than an engineer centric way.
Although he appeared here for a low level solution architect but to give this discussion the initial perspective, high level search requirements needs to be put into table at the beginning.
Engineering details should come once we delve deeper into technical details.
yes. he looks nervous this time…
Thank you guys without editing any part of it . Thanks for being realistic :)
Wow good interview session, I really liked how she asked those questions that makes you think whether you are doing things right or not.
Brilliant job actually by Yogita in identifying and raising many technical risks and scale issues with a basic MVP design approach. Nice work guys👍
ES also shouldn't be used as a source of truth since writes go in-memory first before they are flushed to disk, making ES less durable than a regular database
This was an amazing interview. The interviewer asked some really good questions and Gaurav was able to explain things from all angles. Thanks for collaborating. My first video on this channel and already subscribed.
Why didn't I find this sooner!!!!! This is amazing content! I just love systems engineering/design.
Welcome 🎉
This design still need some parts which is essential.
1) Space estimates and capacity estimates
2) DB design which cover store link of photos, videos etc
3) Monitor metrics need proper name like QPS, error rate, latency(50% , 75% , 90% percentile)
4) data partition
5) High level design with LB, Cache etc
They had Time constraints I guess.
Yes definitely....but yes the interview will be only 45 min so they have skipped many things. But when candidates will prepare they need to think about every part because you never know in which part interviewer will be interested
@@sayantanbhaduri3874 This!! Depending on the job/Interview they may not care Caching, LB or NoSQL (new Start up). Unfortunately, "we" have to know about everything. Some Interviewers may just ask very detail questions on DBs or spend 20 mins on Networking protocols. The questions could be based on your resume only. The list goes on!!!
This was really a good discussion , really liked it. Since you have emphasized more on inventory, I was waiting your explanation, "how inventory can be managed in a distributed system" which is essentially adding an existing products, consuming this products, locking on data and provide correct inventory while user search on this product. If you can create some thing details on inventory would be awesome. Also don't forget to build another video on event-driven approach for this same use case. Lastly thank you both of you for your effort to help people.
Finally , Thanks a lot for the most awaited video on full system design , Please also introduce some LLD questions as well . Thanks a lot for such an amazing content.
3:56 I spot an error he said "denormalize" and then went writing a normalized image catagory table .... think he tried to say normalized image details from product table
It was really cool to see Gaurav clarifying the requirements and making sure that Yogita is also on the same page. Also the way Yogita was explaining the scenarios and driving the interview was truly awesome. Thanks for the video!!!
Hi Yogita,
Was the functional and non-functional requirements part missed in this video?
Very nice discussion! Gaurav very well maintained balance between product focus and diving too deep in details; In other words - zoom in and zoom out during the discussion is amazing. Also, questions from Yogita are very pragmatic and based on real world scenarios & challenges.
Why RDMS I feel we can go with DynamoDB. We can scale more when we go for large data
metrices can be built by Prometheus, Grafana stack.
Hi Yogita,
Instead of considering RDBMS as a single source of truth, can we remove RDBMS and instead make a cluster of ElasticSerah and make it a single source of truth? By doing this we can remove the overhead of updating RDBMS and ElasticSearch at the same time.
The other services can read from the slave/master ES instance and user service can read from master/slave?
Dude elastic search is expensive. You can’t just dump all the data just like that.
I was bit disappointed when Gaurav said - “I don’t see a problem when the millions of users start using it”.
Rest everything was great. Thank you both for doing this.
Really great!
Thank you so much :)
yogita, gaurav. Thankyou, thankyou soooo much. you can't believe what this video has given me in my career. God bless you both. allah aap dono ko salamat rakhay. ❤❤❤❤
this video gave u something in ur career?
Very realistic video. :). It goes to show that regardless of how well you can do a design on your own, once you get into the interview situation, you get nervous and then you often times make mistakes that you would have never done on your own. :)
true.. it gives me confidence to my onsite interview tomorrow…
Fan of both of you!
TikTok design was way awesome, you started with monolith and scaled it for DAU.
Thanks to both of you for system design lectures, I got selected in PayPal as SDE-2. My system design round was awesome because of some great contents you guys have created. 🙂
Yogita can refer us in Careem and Gaurav in Uber 😉
Bhai low level design kha se kari. Aur ye machine coding round ka kaise kara
I feel index will not be applicable in case if we use wild cards like %
Thank you for the awesome video Yogita and Gaurav! Waiting for more valuable contend!
Cheers!
We were using Magento as CMS and were pumping data to Elasticsearch for indexing within fixed intervals.
To Be Honest!
In my real experience, interviewer was never listening to me while I just say I will use Elastic Search let say... They would dig deeper into every how. And always complicate even simplest thing.
I remember in one of my interview where most of the part was spend on HOWs of loadbalancer....
For me this is not even close to how my system design interviews went 😪
second you !! not even remotely close
21:00 - I once heard in Hussein Nasser's BE engineering video, that a primary DB should never be a NoSQL DB
It’s not a hard and fast rule. There can be trade offs, if the org and engineers are aware of those trade offs and risks, it can be their decision at the end.
Bhai ye core field walo k liye nahi. Now days commerce people also coming in these IT firms. So let it be.
Interesting so many details covered , thanks a lot 🙏 @Gaurav and @Yogita
How many 1st of all do you have?
Great video and many many things got clear. Another thing that we could cover in the debugging part is when 2 or more user purchases the same product and quantity of the product was 1. So some sort of locking would work!.
Looks very like a real interview, thank you very much guys!
I love the videos you do with people but please choose the people you are doing the interview with carefully. VIdeos that you have done with Gaurav Sen are great because both of you have great knowledge about the topic. Please don't pollute your videos doing interviews with people who are just trying to prove they know but they don't. This video actually helped me learn a lot. It was a very relevant video even after 2 years of it being created. Also please try to go into more detail or make a playlist for this type of problem which are lengthy.
What another service can be used for storing the product images apart from S3 or any cloud storage as they are charging much for the data transfer?
This is wonderful and so insightful. Thanks
What about short video retrieval of the product when the consumer searches for a product ? Will it come from S3 directly to the user's front end ? How will you address latency issues of video retrieval ? Also , what about product reviews by the consumers ? I feel , the MVP should have at a basic feature for product review for any E-Commerce solution .
Thanks for the interview itself. It was so much insightful at the same time so much fun to watch, also many concepts are covered up in the smartest manner. Thanks once again to both of you. Gods Of Systems Design 👨🏻💻🥰
Yogita can refer us in Careem and Gaurav in Uber 😉
Thanks alot Didi . Thanks for your system design course .
I have learnt alot of system design from your vidoes .
Btw your teaching is really good.
Great video. One question though…arent the images served from cdn.?or typicAlly always frm backend file store?
In mysql, Indexing does not work if you are using "%TEXT%"
Cart implementation ?
If only design interviewer are that descriptive. I can always add two lines to descriptive questions but the whole point of this interview is to come up with problems, tradeoffs, solutions ourselves. No cache? no images? Monitor metric names look so naive.
Both of you have done better videos . This unfortunately is not one of your best . But appreciate the effort you guys took . Thanks for that .
We will keep trying to do better.
Gaurav, you have not failed, bro … even if you do, we love you and your content.
Yeah. We love him too :)
Is S3 the S3 bucket on AWS ? @sudocode plz clarify or some other kind of similar storage service?
Yes
This is an excellent resource, thank you!
love it. u guys do great job of educating ppl like myself.
Monitoring -Instead of the cron job, let's define the status as processed and fire event if the processed status is not updated within a timestamp. Also sending slack message to fire event notification cannot be considered for bulk jobs as it will consume the resources of the system. Alerts can be added using platforms like datadog.
Health check every 5 seconds - Rather let's have a dead letter queue for failed event and fire an alert if the queue gets failed record. It will save the system resources.
Can you make a video about how elastic search works?
Great video. But please keep in mind, you cannot keep adding items to Elasticsearch and expect it to reflect immediately. As Elasticsearch index needs to be rebuilt inorder to reflect the newly added items since the last index build. May be we can periodically rebuild the index and while it is down for that period, serve the response from a slave node of Elasticsearch.
Store image urls in dynamoDB instead of RDBMS.
28:40 she is asking how to check slowness of queries and bhaiya is explaining about heart beats
Why we are waiting for the RDBMS response before sending the product details to elastic search ? Way it is bad to send them together ?
RDBMS is the source of truth. We need to ensure a successful transaction from RDMS before we can index it in ES.
@@sudocode ohh .. Thanks for making these videos .. Its very helpful ..👌👌👌
@@sudocode I guess ES should be on a different server. Here RDBMS is the producer and ES is the consumer. Although event-driven mechanism will work fine.
Locking on data and provide correct inventory while user search on this product.
Simply awesome :)
Nice, What about image of different sizes for preview and thubnails. We should store them separately. Or change size within a service using server code so that to make sure that we are not sending high resolution images in product catalog.
insightful and fun at the same time. I laughed a lot along with learning :)
Thanks Jyoti
Thank you Yogita and Gaurav. Both of you're awesome. Take so much love from Bangladesh.
A really good video. Thanks for sharing.
Can you please share similar discussion or system design for Banking domain to follow?
Like architecture, event driven approach, database to choose, and many more things.
you guys are talking about start development with monolith design but different deployment for each service.....so i want to understand if you are deploying individually then how it can be monolith application ?
What do we do if the payment is done but PayPal fails to send a response? We have the status "purchasing" and it gets stuck there. How do we finally send a success response to the customer?
This actually gave a feel of system design interviews, liked it a lot. Just wanted to clear a doubt regarding the search use case. Shouldn't SOLR be a better option here instead of elastic search as the search items which are the products related data would be mostly static?
For text searches we use elastic or Solr
It is so real. Seems Gaurav is bit nervous !!
U decided for S3 for image storage. What about CDN instead of S3?
Cdn is not a storage /file system it's just a delivery network
I think CDN should be put in front of S3 if the images need to be delivered to whole world without much latency. But it is not file storage, S3 or something like that is very much needed
Can you use serverless for any specific purposes /functions in this design?
I guess Auto scaling feature might be highlighted in this blog once . Elastic Search the unique one I found & Product ID & Image Id description is also great to hear .
So much learning at least for myself !
Cheers to you, guys 🍻
wonderful smile at starting :)
what you will do incase of hotSKU sells / flash sale / mega sale where you will have only few stocks and there are millions of customers are searching for same. How do you show correct inventory ?
loved it. Always get to learn something from you two.
This is a great video and the content overall is exceptional. Earned my sub !
Thanks Manideep
good job, now please made these in depth videos for adding and removing items in cart and delivery tracking, This seems part one of a super awsome anime series.
One feedback gaurav your videos are amazing just that white board makes it difficult to watch because of lightings
If possible could you do something about it like use a tablet or online tools that will help better to see it visually and follow along
This is very good. Thanks
Please have vedios on data centers.
Gaurav great presentation! Yogita your videos are always much appreciated and your way of simplifying and relaying information is like no other! I would love to see your system design solution for this requirement if not too much trouble :) Once again thank you both!
Great mock interview 💜
I didn't even see the timer and think I am also there at the same page.
You should do this collaboration again!
Great discussion, but not great as an interview due to the lack of structure and missing important pieces like: did not discuss non functional reqs, dove too deep in some areas but missed complete components to talk about. Time management needs to be accounted as well get the full system high level design, then detailed system design and then ask the interviewer where do they like to deep dive
Another question could have been how to handle image optimization for better page metrics
Fantastic Explanation
I wish you guys were there earlier
A little misleading, the beginning was a bit off. The interviewer won't be telling this much in the beginning. A viewer should keep in mind that this is not a mock interview.
In the 1st half the interviewee confused, didn't stick to, but in 2nd half you clicked and brought the climex :)
superb!!
at 19:00, I think what Yogita is asking for is CQRS
This is the common mistake developers do. Going for monolith and thinking that it can be converted to microservices in the future. Believe me if you do not get time initially to make it microservices base, how will you get time in the future to convert? Going for MVP is the thing PO uses to put the product in the market as soon as possible but it does not mean we go with something for now and thinking it can be improvised in the future. I take interviews in Europe and believe me it does not go well always!
Enjoyed it, like the rest of the videos. Future mein agar aap hindi mein content banaoge toh bahut hi useful hoga jinko angrezi samajhne mein takleef hai. I know lot of young techies(some reporting to me) very talented, but unable to follow us to the full, when we have our meetings in English :(. Just a small suggestion, for future :). I would then defintely guide all of them to your videos as you really know how to break down complex stuff into easily digestible pieces
Do you expect a junior dev to know all that information?
subscribed...great I found this channel...I had 1 question though
referring to 17:20, so here we discuss about using an RDBMS to store new products or update the existing inventory after every purchase against a product and then merging those updates to the NoSQL DB(Elastic Search) from time to time as the NoSQL DB would be used for searching and display of products to the users real time.
But what if an user searches a product, gets the details as well as the count of the stock and just after that NoSQL DB is refreshed with new update for that product from RDBMS and stock becomes 0 for that particular product. How to handle that?
Would you use some distributed transactions or JTA transaction manager or something for consistency? The tradeOff definitely would be that it would slightly slow down the system.
That's where an event driven design comes handy. As stock is refreshed, user is notified about the same.
You don't use ES as your source of truth for stock numbers. ES just holds general details of the inventory. The RDBMS would hold the true stock numbers. While your situation is valid (stock goes to 0 after adding it to your cart) it has nothing to do with ES and it's something you have to verify at check out or by reserving stock when it's in your cart (with an expiry time).
If this were my design, I wouldn't have the product service update ES directly. The product service would queue a job to update ES.
the comment section of every sudocode video is extremely technical and complex.
Meanwhile, Me currently learning DSA and Webdev for Campus placement:.
isko toh ab jaldi finish karna padega, abhi toh bohot kuch padhna baaki hai to become a SWE. 😲
Amazing content. Love you both. Have a question here since select * like %string% does a Full table scan. Is not the optimum solutions when you are talking about a huge inventory. Is there a better optimised way to do that?
I thought the same. Would be interesting to hear the remarks on this.
Does that do a whole table search or rather a single column in a table..?
where clause had name & description columns where name was supposedly indexed in which case the SQL optimiser will not go for a full table scan due to the presence of a indexed column.
Thank you for nice videos, can you make a video on system design on Forex trading platform where live exchange rates and instant order execution is a must requirement
10:10 phele chalna chaiye phir baad main dekhnge 🤣
I would like to appear for a mock system design interview !
Liked the tiktok video more. Thanks for it!
11:14 how would you make this extensible if you are making monolithic in the first place? @gaurav is exposed everywhere😂
I am an interviewer at Microsoft I’ve done close to 500 interviews.
Few things to keep in mind -
there is no right or wrong answer for a System Design Question!
The questions you ask for clarification matters a looot! Don’t ask just for the sake of asking. Don’t ask templated questions. Be genuinely curious!
Always always focus on simplest end-to-end scenario first. Don’t try to talk about ALL optimizations at once. Keep making points like - We can have xyz optimization here, let’s come back and address it.
Probably, that’s why he didn’t get a job! 😉
Yogita was superb though out the interview she had great insight . Not sure what happened to Gaurav, he keeps jumping one design/though over other, until chimed by Yogita.
Great mock interview though 🙏
He was thinking out loud and that’s exactly how system design interviews take place. It’s upto the interviewer if they want to dig deep on one design or hear multiple views. He managed to cover a lot of depth in a short 45 minute interval 😊
I think the idea of going monolith to get an MVP out is a bit confusing. I would still go with a distributed system even so the team is small and we have an MVP time which is strict. Breaking down a monolith and reworking on the system after the MVP is out is not a great idea. I have seen this not work in the past and BLOATING the system and increasing the overall deployment times. I would still break this into Microservices each doing what needs to be done. Monitoring can also be done easily then
That’s a completely acceptable approach if you have time and resources.