High-Level Design
he execution flow consist of 3 major flows
- Creation of the paste and generate the unique paste-id
- User send a request with the required details and the request first hit to the API Gateway.
- API Gateway Route the request to the appropriate service and the service instance.
- Once request reach to the service first it create the unique paste-id with the combination if User Id and time stamp.
- The paste content will be push to Object Storage and the Object storage Id will be mapped to Paste-id.
- The metadata will be persisted into the database.
- Once all the above operations completed successful commit the transaction and the paster-id and data will be push to Cache with expiry time.
- User will get the URL to access the paste created.
- Retrieval of the paste by id
- Any user can access the paste content by URL.
- Once user send a read request it first goes to the API gateway and API gateway route the request to the appropriate service and a service instance.
- Once Request reached to the service it first lookup for a paste-id in the cache.
- If match found then retrieve the result from cache and response to the user and in case of cache miss it first lookup for the paste-id in the database from the paste metadata it will retrieve the object storage id get the paste content.
- Before returning it to the user it first put the paste into cache and then return it to the user.
- Delete the paste by user request or batch processing.
- To delete the existing paste user need to request with the paste-id.
- The entry with provided paste-id will be deleted from the database and also removed from the Object storage.
- Once Entry from the Database removed it also invalidate the respective entry from the cache
- There will be the scheduled batch job which is responsible to trigger after every specified interval and lookup for the paste which is expire.
- The Expire jobs will be delete from the database and also those will be mark as invalidate from cache.