Requirements


Functional Requirements:


  • Allow users to upload and store text or code snippets.
  • Generate a unique shareable URL for each paste.
  • Enable retrieval of paste content by URL.
  • Support expiration and TTL for pastes.
  • Allow paste owners or the system to delete a paste before its natural expiration.



Non-Functional Requirements:


    List the key non-functional requirements (eg low latency, scalability, reliability, etc.)...


API Design

Define the APIs expected from the system. This is your chance to analyze and define the read and write paths so that you can come up with the high-level design...


POST input: sending the text or code output: a link that points you to the snippet and a accept message

GET input: the url that you clicked on: ouput: the snippet of code or message

DELETE input id: the id of the url that gets deleted, returns a comfirmation that the content was deleted and the url is deleted


High-Level Design

Describe the overall system architecture. Identify the main components needed to solve the problem end-to-end. Use the diagramming tool to create a block diagram.


The overall system architecture starts with the client where the user goes to a link to open pastebin. Then they paste in text or code and send it off. The informaiton is caught by the api gateway which checks to see if the user is not hitting their limit and if the request can be accepted. Then the load balancer distributes to the request using the least connections algorithm. Then it hits the server where the actual creation of the url is done. Then the infomraiton about the data is stores in the database and the actual snippet of text or code is stored in the S3 bucket. when clicking on the url, the cache sees if it has the snippet or code and if it does it sends the information back. if it does not it fails and goes to the database.




Detailed Component Design

Deep dive into 2-3 key components. Explain how they work, how they scale, discuss tradeoffs, capacity, and any relevant algorithms or data structures.


The load balancer is in charge of distributing the requests so no one server is handling too much. this helps with speed and performance. It usees the least connections algorithm to see which server is handling the least amount of work. The cache is crutial because it is in charge of holding quick to get information and makes the system run quicker by having the information the user will need. this way the request won't need to touch the database. The s3 bucket is in charge of holding the large amounts of data and code. We do not want to have this data sit in the database because it will take up too much memory