Professional Web Applications Themes

HTML storage - MySQL

Hello, I am writing a web application and trying to decide how to best store/reference HTML: Do I store just store filenames/paths in mySQL, and just use them as references? Or, should/can I store all of the HTML text as single string variables within individual mySQL fields? Any advice on this is greatly appreciated, and feel free to discuss the respective pros/cons. Thank you very much in advance. -S...

  1. #1

    Default HTML storage

    Hello,

    I am writing a web application and trying to decide how to best
    store/reference HTML:

    Do I store just store filenames/paths in mySQL, and just use them as
    references?

    Or, should/can I store all of the HTML text as single string variables
    within individual mySQL fields?

    Any advice on this is greatly appreciated, and feel free to discuss the
    respective pros/cons.

    Thank you very much in advance.

    -S

    MidiBot@gmail.com Guest

  2. #2

    Default Re: HTML storage

    [email]MidiBot[/email] wrote:
    > Hello,
    >
    > I am writing a web application and trying to decide how to best
    > store/reference HTML:
    >
    > Do I store just store filenames/paths in mySQL, and just use them as
    > references?
    >
    > Or, should/can I store all of the HTML text as single string variables
    > within individual mySQL fields?
    >
    > Any advice on this is greatly appreciated, and feel free to discuss the
    > respective pros/cons.
    >
    > Thank you very much in advance.
    >
    > -S
    >
    Your question doesn't make a lot of sense unless you tell use what
    you're trying to do.

    --
    ==================
    Remove the "x" from my email address
    Jerry Stuckle
    JDS Computer Training Corp.
    [email]jstucklexattglobal.net[/email]
    ==================
    Jerry Stuckle Guest

  3. #3

    Default Re: HTML storage

    > I am writing a web application and trying to decide how to best
    >store/reference HTML:
    >
    > Do I store just store filenames/paths in mySQL, and just use them as
    >references?
    Web servers generally serve *files*. You can use a database with
    active scripts, but this tends to cause more overhead per hit and
    makes the client's browser less able to cache static content.
    > Or, should/can I store all of the HTML text as single string variables
    >within individual mySQL fields?
    Consider your application and maintenance. How easy is it to *edit*
    and *preview* HTML stored in a single database field?

    My feeling is that databases are good at storing tables of relatively
    short rows and filesystems are good at storing potentially much larger
    files. You should use each for what it's good at. There are intermediate
    cases where it is reasonable to go either way.

    Filesystems are not generally good at storing large numbers of small
    files (thousands to millions and up) in a single directory. The
    lookup is slow, and the minimum block size wastes a lot of disk
    space. You can use a hierarchy for this (e.g. the mailbox for
    gordonb is stored as g/o/gordonb.mbox), or you can use a database.

    Databases may get slow (lots of disk seeking) with large records,
    especially if there is a lot of access that doesn't involve the
    large field in the record.
    >Any advice on this is greatly appreciated, and feel free to discuss the
    >respective pros/cons.
    Are transactions an issue? How important is it that the description
    for item #938784 change in all locations at *exactly* the same time
    (which still won't guarantee that the user's browser won't fetch some
    pieces before the change and some after)?

    Gordon L. Burditt
    Gordon Burditt Guest

  4. #4

    Default Re: HTML storage


    Hi Gordon,

    Thank you very much for your reply.

    I think you convinced me that I should store references to files in my
    database, instead
    of the actual file text. While I don't think transactions would be
    really be an issue, I am counting on having at least a couple thousand
    rows, and the text files could potentially be very large.

    thanks,

    -S

    Gordon Burditt wrote:
    > > I am writing a web application and trying to decide how to best
    > >store/reference HTML:
    > >
    > > Do I store just store filenames/paths in mySQL, and just use them as
    > >references?
    >
    > Web servers generally serve *files*. You can use a database with
    > active scripts, but this tends to cause more overhead per hit and
    > makes the client's browser less able to cache static content.
    >
    > > Or, should/can I store all of the HTML text as single string variables
    > >within individual mySQL fields?
    >
    > Consider your application and maintenance. How easy is it to *edit*
    > and *preview* HTML stored in a single database field?
    >
    > My feeling is that databases are good at storing tables of relatively
    > short rows and filesystems are good at storing potentially much larger
    > files. You should use each for what it's good at. There are intermediate
    > cases where it is reasonable to go either way.
    >
    > Filesystems are not generally good at storing large numbers of small
    > files (thousands to millions and up) in a single directory. The
    > lookup is slow, and the minimum block size wastes a lot of disk
    > space. You can use a hierarchy for this (e.g. the mailbox for
    > gordonb is stored as g/o/gordonb.mbox), or you can use a database.
    >
    > Databases may get slow (lots of disk seeking) with large records,
    > especially if there is a lot of access that doesn't involve the
    > large field in the record.
    >
    > >Any advice on this is greatly appreciated, and feel free to discuss the
    > >respective pros/cons.
    >
    > Are transactions an issue? How important is it that the description
    > for item #938784 change in all locations at *exactly* the same time
    > (which still won't guarantee that the user's browser won't fetch some
    > pieces before the change and some after)?
    >
    > Gordon L. Burditt
    MidiBot@gmail.com Guest

  5. #5

    Default Re: HTML storage

    > I think you convinced me that I should store references to files in my
    >database, instead
    > of the actual file text. While I don't think transactions would be
    >really be an issue, I am counting on having at least a couple thousand
    >rows, and the text files could potentially be very large.
    If that also means a couple of thousand files, try not to store all
    of them in a single directory. That has performance issues as well.

    Gordon L. Burditt
    Gordon Burditt Guest

Similar Threads

  1. Form Storage
    By Seth in forum MySQL
    Replies: 3
    Last Post: August 10th, 03:49 AM
  2. temporary storage
    By alternative in forum Macromedia ColdFusion
    Replies: 3
    Last Post: March 14th, 08:54 PM
  3. Film Storage
    By Azazel in forum Photography
    Replies: 15
    Last Post: August 12th, 12:08 PM
  4. storage of HTML Code
    By Rajupeta Prasanna in forum ASP.NET General
    Replies: 1
    Last Post: July 25th, 10:47 AM
  5. XP Pro Net thru VPN - Not enough server storage...
    By Rush in forum Windows Networking
    Replies: 3
    Last Post: July 3rd, 05:56 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139