Detailed component design
Dig deeper into 2-3 components and explain in detail how they work. For example, how well does each component scale? Any relevant algorithm or data structure you like to use for a component? Also you could draw a diagram using the diagramming tool to enhance your design...
Database design
Defining the system data model early on will clarify how data will flow among different components of the system. Also you could draw an ER diagram using the diagramming tool to enhance your design...
Uh for the detail design. For the detailed part we need. Uh I think we can discuss about. How the design of the other service works so first user should create an order? Servers so to prevent To prevent the user to purchase the same ticket we should have a database transaction with the order status. So basically when user click reserve the tickets we should have a transaction to update and change the ticket status and uh to pending and create an order expendix that is for. And uh it should have a timeout. For example 30 minutes and when we. Uh purchase that we should try to. So we should try to. Was it trying to make it a single transaction so you have to use it they are. Doing the same transaction. Uh they want to hold the same ticket there will be a transaction log. So Do to make sure only one of them wins? So when we are doing the payments so if that did not mean the way we will only have one single user entering the pending or the pending page and in the log code or list hold in 30 minutes. Then during this process the user will be entering the payments page so the payments page we will have the. The payment service to handle the credit card and all the information and the payment service should group transaction of the payments with the order table and the ticket tables that is updates so once the in a single transaction so once the transaction is finished. Which try to just update? Was we would just update in. Take your status and knowledge status to complete in a single transaction. Uh and Then there's the taking ordering. If the payment failed then we should also update the order table and ticket table accordingly. On the payments there should be a limit that if. If we have the. Other table or take a table the order in time log expired and even some other user claim that we should just fail the transaction this should the constraint should be a part of the transaction limit. So that's the first one so that's in that way with those DB transactions we can guarantee that order can only be placed once and the second part of this is as we discussed previously. The order I want to discuss about the scale for example the we will have a very high. Uh qbs For the right? For the level right we will have a very high qbrs for the hotspot I think one of the important if we there are few ways the first way is we can Implement the very limited front end to ask user to wait in the queue when there are a lot of user entering the ticket page so we should just Implement the service or your way image to make sure they are. 2 000 users To In a single at the same time to enter the same event page so that's the first way the second way is we can have a database shorted by events and even that probably is not enough so we can. Try to shut it shut the events in in depth for example we shouldn't put the same event. Uh all of the tickets of the same event. On the same DB. Instead we can short it by have some sort of a short small shot in logic to shut the ticket table by. Maybe the seed. Seat ID or C location Uh our ticket I Or something like that that's basically shot by 100 and this distributed no one or everything uh to a hundred different server so in that case even whenever we could have like 60 kbps on the big white we should still be able to hand handle hand over and handlenets. Uh that scale of transaction and make sure things works. Uh so NASA to detail then I want to discuss And uh for For the real limiting I think I briefly mentioned a little bit that we should have a real limit on the front end user should not click on. The order a lot of times. Uh you have to just after yourself I think they created the order the front hand button should green out and also the red API Gateway should and other service should have the restriction and we limit to only make sure you only have one. Or animals to to order open at the same time. Uh to avoid the duplicate order especially uh probably just one and one order for a single event. And for the API Gateway there should also be rate limit. Uh to make sure we won't have a lot of traffic to get. Okay get into our event and other service and overload our system! So So we need to make sure in that. So so for the U.S service because we have a look inside cache. And we also read how many decades are there remaining so it could be updating like it shouldn't be up there like real time but. The information can be a little bit gets there like two or three seconds stairs and it's okay so we should have a look inside cash with maybe like two seconds TDL and every time they want to know the how many rows are there we should just just have a quick select of the how many. Uh what's the current status of each tickets and when we do this the lag we should never. Uh I have the log making it unlock the DB so it should be just me I read without logging. The every row. So that's how he works uh overall I think in my opinion.