PHP to store images in MySQL or not?

前端 未结 16 2612
离开以前
离开以前 2020-11-28 05:56

I have built a small web application in PHP where users must first log in. Once they have logged in, I intend on showing a small thumbnail as part of their \"profile\".

16条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-11-28 06:01

    These are the pros of both solutions

    In BLOBS :

    1) pros : the easiness to mange clusters since you do not have to handle tricky points like file syncs between servers

    2) DB backups will be exhaustive also

    In files

    1) Native caching handly (and that's the missing point of previous comments, with refresh and headers that you won't have to redesign in DB (DB are not handling last modification time by default)

    2) Easiness of resizing later on

    3) Easiness of moderation (just go through your folders to check if everything is correct)

    For all these reasons and since the two pros of databases are easier to replicate on file system I strongly recommend files !

提交回复
热议问题