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...
Define what APIs are expected from the system...
This endpoint is used to create a new paste by sending the text content and user information.
POST/pastebin/storeapplication/json| Field | Type | Description |
text | string | The text content to be stored. |
userid | string | The unique identifier for the user. |
Example Request:
{
"text": "This is a new paste for the service.",
"userid": "user-12345"
}
201 Createdapplication/json| Field | Type | Description |
url | string | The unique URL for the newly created paste. |
Example Response:
{
"url": "[https://pastebin.example.com/abcdef123] (https://pastebin.example.com/abcdef123)"
}
This endpoint is used to retrieve the text content of a paste using its unique hash.
GET/{hash}200 OKapplication/json| Field | Type | Description |
text | string | The raw text content of the paste. |
Example Response:
{
"text": "This is a new paste for the service."
}
404 Not Found status.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...
In database design we have two things one we are going to store data in aws s3 and metadata in relational database.
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...
This is the core service that orchestrates the entire process. Its responsibilities are:
encoded_url in the database, and the final URL is constructed as domain/hash.The URL creation process is a key part of the service's design. The service combines two unique identifiers—a UUID (Universally Unique Identifier) and the User ID—to create a unique hash. This approach ensures that the URL is not easily guessable and is unique to a specific user and a specific "paste" session. The hash is then appended to the domain to form the complete URL, like domain/hash.
AWS S3 (Simple Storage Service) is an object store used to hold the raw text data. It's chosen for its key features:
The database's primary role is to act as a metadata store. It's crucial for the service's functionality and stores information such as:
encoded_url: The unique hash used in the URL.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...
This is the core service that orchestrates the entire process. Its responsibilities are:
encoded_url in the database, and the final URL is constructed as domain/hash.The URL creation process is a key part of the service's design. The service combines two unique identifiers—a UUID (Universally Unique Identifier) and the User ID—to create a unique hash. This approach ensures that the URL is not easily guessable and is unique to a specific user and a specific "paste" session. The hash is then appended to the domain to form the complete URL, like domain/hash.
AWS S3 (Simple Storage Service) is an object store used to hold the raw text data. It's chosen for its key features:
The database's primary role is to act as a metadata store. It's crucial for the service's functionality and stores information such as:
encoded_url: The unique hash used in the URL.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?