List functional requirements for the system (Ask the chat bot for hints if stuck.)...
List non-functional requirements for the system...
Estimate the scale of the system you are going to design...
the capacity design we can use horizontal scaling so we can keep on adding new servers if the limit exceeds. So, whenever the limit exceeds the server, whenever the user count limits the server limit. So, we can notify it by cutting as severity to the team to add new horizontal servers. And why horizontal servers so that we are able to maintain the existing server without disturbing them. Now, in the event of any catastrophe, if the user is only situated in a single country, then we can put in many states of the country. And if there are multiple countries, we can put in multiple countries. And whoever is and those, wherever the server is kept in that country, the closest it will it should be able to connect to the closest user. So, yeah, and if it is in different countries, if this pastebin is in different countries, we can put in also different countries.
Define what APIs are expected from the system...
For API design we will be using mainly POST and GET method. POST method is used when we click the save button and we will be checking if there is any duplicate present in the database or not, we will be generating a random URL and putting it on a database if it is not present else we keep on generating until it is not present. If the random url is not present then we will map it to the database as key and the body contains the text and a unique user ID which will be again random. So the main key is the random URL that we are generating. So it should have an expiration date which is set by the user which will be 5, 10, 30 or 60 days and after that the data should automatically get deleted. Now for a GET method, the user has to have the URL and then it should have a look at the database and if the data is already deleted we should be able to give them a no found message else the text should be visible in the UI. If the data is not there, this would be handled in the user interface. Yeah so and about the delete and update method we don't need it because we are not going to allow the user to update anything after it is created and we are not going to allow the user to delete, it will be automatically deleted.
{ "userId": "uniqueUserId", "text": "This is the content of the paste.", "expiration": "30" // Could be 5, 10, 30, 60, or 90 days}{ "url": "https://pastebin.com/example123", "message": "Paste successfully created."}{ "error": "Unable to generate a unique URL. Please try again."}url: The unique URL identifier for the paste (as part of the endpoint).{ "url": "https://pastebin.com/example123", "text": "This is the content of the paste."}{ "error": "Paste not found or has been deleted."}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...
You should identify enough components that are needed to solve the actual problem from end to end. Also remember to draw a block diagram using the diagramming tool to augment your design. If you are unfamiliar with the tool, you can simply describe your design to the chat bot and ask it to generate a starter diagram for you to modify...
Explain how the request flows from end to end in your high level design. Also you could draw a sequence diagram using the diagramming tool to enhance your explanation...
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...
Explain any trade offs you have made and why you made certain tech choices...
Try to discuss as many failure scenarios/bottlenecks as possible.
What are some future improvements you would make? How would you mitigate the failure scenario(s) you described above?