Store user profile pictures on disk or in the database?

前端 未结 2 2072
说谎
说谎 2021-02-12 11:46

I\'m building an asp.net mvc application where users can attach a picture to their profile, but also in other areas of the system like a messaging gadget on the dashboard that d

2条回答
  •  迷失自我
    2021-02-12 12:13

    Store references to the files on a database and store the files themselves on disk.

    This approach is way more flexible and easier to scale.

    You can have a single database and several servers serving static content. It will be much trickier to have several databases doing that work.

    Flickr works this way.

    Hope it helps.

提交回复
热议问题