just to be specific the database I will be using is mongodb and the files in question would be images.
My question is......... if you store your pictures inside a database instead of a regular static file structure... how does this work?
I guess you could store the link to the CDN file along with the picture in the database. so {"image": "cdnurl/fakefilelocation"}
so when a user requests the image they just get the CDN url
but how does the "pull" request work from the CDN? how do they get the images? Would you have to manually route their get request for a specific image to the actual picture instead of a link?
解决方案
I have never tried or tested such things by myself on a big production server, but I would need to come up with such decision I will read what people who has experience with this problem have been doing.
Here are few threads that I found really interesting: