Allahbaksh Asadullah
Allahbaksh Asadullah

Reputation: 686

URL Rewrite Tomcat for File Upload

I am putting a file upload functionality where there is heavy business logic (Check whether the file has Virus, Split file, Upload it to Bucketed Storage etc.). I was looking at how to handle it efficiently.

One of the solutions is to use the different server for the file upload and different to serve the normal API. So I am planning to push the task of this on VertX. Will a URL rewrite from Tomcat consume memory? What would be the footprint of it if my file is around 5MB.

Upvotes: 0

Views: 139

Answers (1)

Christopher Schultz
Christopher Schultz

Reputation: 20862

The simple solution is to target your file-uploads at a different hostname, like uploads.example.com and don't try re-writing or proxying at all.

Re-writing is a server-side activity, and if you want to avoid server-side processing, using re-writing is counterproductive. If you used a proxy or url-writing (which would proxy, since you can't really redirect a file-upload), then your primary server would be held-up while the "upload server" did its work. That would mean you'd be tying up resource on both servers and failing to accomplish your goal.

Just upload directly to the other server.

Upvotes: 1

Related Questions