Announcement

Collapse
No announcement yet.

Moving attachments from filesys to Database

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Moving attachments from filesys to Database

    Hello,

    I'd like to move all my attachments that are currently in the file system to the database. One of my problems is that

    a) the attachment table is setup as a mediumblob - exactly how much data will that hold? I've got attachments up to 50megs in size

    b) I keep getting an error about mysql packet size, which I can fix without a problem, but I'm pretty concerned about a).

    Also, how do I go about resetting the attachments it has attempted to convert and then failed half way through? Also is there an interface to managing attachments once they are in the database?

    Thanks in advance.

    BTW - Great product

    Warren Rees

  • #2
    Why do you want to store the attachments in the database ? I think that's a bad idea for attachments of this size.

    Comment


    • #3
      Centralized backup, ability to have a single database and move the webserver to whichever machine by just copying the forum directory.

      Besides, there aren't many files that are 50meg, I just want the ability there.

      Originally posted by DaFire
      Why do you want to store the attachments in the database ? I think that's a bad idea for attachments of this size.

      Comment


      • #4
        This will have a huge impact on your servers performance. Instead of simply sending the attachment byte per byte the sql server will read the whole file into his memory, will transfer it to the web server (which will have a copy i n memory then) and transfer it to the client, so basically you have used 100 mb of ram for the transaction.

        Filesystem can cache files while the database transfer will occure on every request of the file again.

        Comment


        • #5
          Correct, however, with the limited amount of traffic that these attachments get, not to mention the fact that once it's downloaded, the memory is returned to the system, and the box that I have it on is more than capable of handling this, it's not much of an issue for me.

          In my case, the benefits outweigh the performance hit that the server takes, and I accomplish the portability that I require.

          Either way, I've found out that the mediumblob is indeed big enough to fit a 50 meg attachment in, which was my original question, and I've completed the conversion.

          Originally posted by DaFire
          This will have a huge impact on your servers performance. Instead of simply sending the attachment byte per byte the sql server will read the whole file into his memory, will transfer it to the web server (which will have a copy i n memory then) and transfer it to the client, so basically you have used 100 mb of ram for the transaction.

          Filesystem can cache files while the database transfer will occure on every request of the file again.

          Comment

          widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
          Working...
          X