Storing assets in server or Database?

Hi Threejs enthusiasts,

I’m wondering what would be the best methodology to store large 3D models (gltf) and display them to users in an web app/platform.

Following some research online, my current understanding is that the best way to go about this is to save 3D models as static files in server and store the links (url) in the database (MongoDB for example).

If this is the case, each user would have a folder (named based on userID) in the server where the model would be located ? How about if many users share the same model/gltf file ? Should we group users per some attribute (say per country) and display the 3d models per attribute (one country, one model for example)… That way we eliminate redundancy.

Any details of such architecture would be much appreciated

Thanks a lot,

That sounds like a more generic server side question not really related to Three. But yeah you would store them just statically and not pumped into a database, the way to reduce redundancy is also rather depending on the platform design, however some platform share files under the hood when they are exactly the same, like typically images. I wouldn’t make that a visible “sharing” feature, otherwise people might start reuploading other files just for the sake of being “registered as holder” or such.

the best way to store large file is in the hosting server

Agreed, store the file once and save reference to it, either in external json, database entry, cookie or state.

Thanks for your input. Much appreciated !
As far as multiple users sharing the same resource, the best way I can think of is to include authorizations to view/edit these files.
There is really no point in storing multiple identical gltf/glb files in the user’s folder in the server.
In case of MongoDB for example, one would have a “USERS” Collection and each user would have an array of 3D scenes (gltf file) that they can/allowed to access with the corresponding url (url where the gltf is located in the server).