When designing a website, I find it mentally less challenging to use a database as opposed to a database + bunch of files. For example, if I have a table called PLAYER
then I prefer to have all aspects of that player centralized
in a table instead of say, having the players picture on disk somewhere and having the player's name as a column in the table. This to me has many advantages:
- Creating a new player is not a hybrid task of adding a database row and managing a file hierarchy for him
- I dont have to keep track of two different access policies
- of course player deletion is fairly straightforward too.
Now the disadvantage is that it is much harder to get the client to cache image data (say of the player's picture) when I am serving it out of a database based on a query string instead of when the browser is making a call to the full URL to the image.
Is there an easy way to recoup the two? One thing which comes to mind is path translation:
really gets served by an Apache handler ala:
SELECT pic FROM player WHERE username = 'bobo';
but I dont have the luxury of such a handler because I am being hosted somewhere where I only have CGI access.
Are you posting in the right place? Check out Where do I post X? to know for sure.
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
Want more info? How to link
or How to display code and escape characters
are good places to start.