My application uses a RESTful api to receive requests from users and generate files on demand. When the file has been made, it responds back with a dl link to said file.
When this was on a single server setup, I didn't have to worry about selecting the correct server to upload the file, as the file was generated and stored on the same server.
But on a multi-server setup, the request could be sent to Server A, stored on Server A and the user connected to the dl link via Server B (which has no file).
So far I have thought of a couple ideas, but I'd like your advice on what to do and/or how other sites do this.
Ideas:
- Have all servers write said files to a dedicated "storage" server where the download link will be served up from.
- Attach a key to the end of the filename, representing which server the file resides on.