> Clearly most replies are opinions but it[color=blue]
> is nice when people post the
> rational behind.[/color]
Agreed. It's always nice to get a bit of an explanation for solutions to
problems.
[color=blue]
> but I intended to ask him what he thought
> the advantages might be for storing them in the database[/color]
Again, my bad for not asking the them to be a little more specific about the
requirements before posting my reply.
[color=blue]
> I can't think of many...[/color]
What advantages or disadvantages there may be depend on the requirements,
something that wasn't explained to either of us. I might have been wrong to
give pros and cons without the requirements (or providing my own explanation
for the pros and cons), but "I can't think of many..." is bordering on one
of those 15 second answers you mentioned (see why at *** below)
[color=blue]
> how does he get 10,000 images into the database attached to the
> proper records?[/color]
The same way he gets 10,000 records in the database to point to the correct
files (although a bit slower because of the data transfer).
[color=blue]
> I would have guessed from the short
> description that users wouldn't directly
> upload files. So that's interesting.[/color]
I don't know your experience with applications that do this, but I guess I
was swayed because I recently implemented a solution to upload files to a
central location and chose to go the database route.
[color=blue]
> I don't think I get this. But anyway, I
> would guess that a user could
> select only from records in the database.[/color]
Yes. The solution I implemented stored the documents on a server. To view a
list of the available documents, the user queries the database (not the file
system) for descriptions of the files. If there isn't any record for the
document, there is no way to get the document (unless you stored outside the
db and could get to the file going "behind the scenes" of my server
application).
I guess the two different types of applications that could be implemented
are as follows (regardless of where the files are stored):
1) Where the database complements the files - i.e. The user has a set of
files and then an auxiliary database designed to provide descriptions of the
files.
2) Where the database controls the files - i.e. The user has a set of files,
but wants to *copy* them to a central location. The database stores
descriptions of the files and provides the only index to the location of the
copied files.
[color=blue]
> If it isn't in the database then
> it doesn't qualify for downloading
> and/or viewing. It doesn't matter if the
> an image is sitting in folder... I have
> images sitting in folders on my
> webserver, you can't get them :-)[/color]
This depends on the pattern implemented (1 or 2). If pattern (1) is
implemented, then there is no point storing the files in the database and
copying them needlessly. If pattern (2) is implemented, then there are both
advantages and disadvantages to storing within the database. Depending on
the requirements, the disadvantages may outweigh the advantages, or vise
versa. In any case, pattern (2) requires that the files be copied - if they
are stored in the database or on the server's file system doesn't matter to
the user - as far as they are concerned, they copied the file and the only
way to get to it is by querying the database.
Pattern (2) also requires that the database and files be kept in sync all
the time. If you're worried about deleting an image, but loosing the actual
image data, then you shouldn't delete the row from the database - simply
mark a "Deleted" field as true or something.
[color=blue]
> That's why I'm doubtful that storing
> the 10K images directly in
> the database is a good idea.
> To be sure, it might be a great idea I just
> (so far) don't think so.[/color]
It depends on the requirements and how you weigh up the pros and cons based
on those requirements.
[color=blue]
> I see now... it was intended to be an
> invitation for discussion. Rather
> than post "I think this... or that"
> I thought I might find out what the guy
> with problem had thought about so far.[/color]
*** I see that now, but your post could easily have been taken for one of
those 15 second answers (as I took it by mistake). Maybe a direct question
would have been better...
[color=blue]
> It isn't you Trev... it is the way people post
> stuff in general.[/color]
It was partly me... I posted a response based on wide ranging assumptions.
That's another type of posting I'd like to see an end to.
[color=blue]
> That's one of the reasons
> "which computer language is best" type
> questions generate so
> much heat and so little light.[/color]
lol. I never heard anybody put it better. We've all seen too many of those
posts lately (and I've always tried to narrow my answer down to "base your
choice on your requirements").
Thanks again for the discussion.
Take care,
Trev.
"Tom Leylan" <gee@iamtiredofspam.com> wrote in message
news:eGD31V28DHA.3648@TK2MSFTNGP11.phx.gbl...[color=blue]
> "Trev Hunter" <hunter_trev@hotmail.com> wrote...[color=green]
> > Cheers, but some of the first words in my post were "IMHO" ;)[/color]
>
> Clearly most replies are opinions but it is nice when people post the
> rational behind. Situations are different and therefore perhaps the
> conclusion.
>[color=green]
> > I admit, I was wrong to make so many assumptions about what the final
> > product will be doing and how it will do it. I based my assumptions on[/color][/color]
an[color=blue][color=green]
> > app that I recently wrote that stores documents of all types in a[/color][/color]
central[color=blue][color=green]
> > database. I was wrong to assume that the OP's application was similar
> > without more information. I did happen to notice your first post made[/color][/color]
the[color=blue][color=green]
> > opposite assumption that there isn't any advantage to storing the images[/color]
> in[color=green]
> > the database though...[/color]
>
> It is great that you have experience with it. I was going to suggest to[/color]
the[color=blue]
> OP that he seek out people doing this type of thing (whatever it is he is
> doing) so that he didn't just get responses based upon people taking 15
> seconds out to reply. I'll admit that believe he will be at least "as[/color]
well[color=blue]
> off" by keeping the images outside but I intended to ask him what he[/color]
thought[color=blue]
> the advantages might be for storing them in the database. I can't think[/color]
of[color=blue]
> many... that doesn't mean that we can't post "it will be easier" but is[/color]
that[color=blue]
> in fact a "fact"?
>
> Perhaps... how does he get 10,000 images into the database attached to the
> proper records?
>[color=green]
> > 1) The Application will be used to store documents in a central location
> > (this can apply to a web server, email application, windows application
> > etc). This will involve users selecting a document from their local[/color]
> machine[color=green]
> > and "uploading" it to the server.[/color]
>
> I would have guessed from the short description that users wouldn't[/color]
directly[color=blue]
> upload files. So that's interesting.
>[color=green]
> > 2) When the user wants to view the file, they query the server. At this
> > point, if there is no record in the database, the user can't get the[/color][/color]
file,[color=blue][color=green]
> > so effectively there is no file anymore (even if there is a orphan file
> > somewhere on the server that had its record deleted).[/color]
>
> I don't think I get this. But anyway, I would guess that a user could
> select only from records in the database. If it isn't in the database[/color]
then[color=blue]
> it doesn't qualify for downloading and/or viewing. It doesn't matter if[/color]
the[color=blue]
> an image is sitting in folder... I have images sitting in folders on my
> webserver, you can't get them :-)
>[color=green]
> > 3) If a user deletes a file from the server, it is deleted from the[/color]
> server,[color=green]
> > not the location that they originally uploaded it from.[/color]
>
> Seems reasonable to me.
>[color=green]
> > To respond to your comments:
> >[color=darkred]
> > > Synchronization for instance...
> > > if you delete the record you have
> > > effectively erased the image. Are we
> > > certain destroying the image is the goal?[/color]
> >
> > See point (3) and again, sorry for the assumption.[/color]
>
> We don't know that user routinely (if ever) keeps the images. Once
> submitted they are "safely stored in the image archive" so what's the[/color]
point?[color=blue]
> Are the users working inhouse or subscribers to some service? I don't[/color]
know[color=blue]
> who owns the images.
>[color=green][color=darkred]
> > > If images are duplicated (the
> > > "no image available" image for
> > > instance) then you have stored
> > > (possibly) hundreds of copies of that image.[/color]
> >
> > I would expect a bit of common sense on the part of the database schema[/color]
> and[color=green]
> > application design to handle these situations. To handle no image[/color]
> available,[color=green]
> > store Null and have a default image elsewhere. To handle multiple copies[/color]
> of[color=green]
> > the same image, implement the schema with a join table and implement the[/color]
> UI[color=green]
> > so that the user gets prompted if a similar image exists (based on other
> > data about the image).[/color]
>
> Seems reasonable.
>[color=green][color=darkred]
> > > Do you want to store
> > > .jpeg, .gif and .png in
> > > three separate columns?[/color]
> >
> > Again, a little bit of design intelligence would do here.[/color]
>
> Perhaps but maybe I didn't explain it correctly. I can choose (from a
> number of websites) to view movie trailers in one of three distinct[/color]
formats[color=blue]
> and often in low or high bandwidth versions. This means they have 6
> different copies of the same film stored. If it is an image database such
> that people can purchase and download the images it isn't hard to imagine
> that a thumbnail would be required. Probably a larger image and possibly
> another hi-definition version.
>
> see:
http://pro.corbis.com/
>
> for information on image storage see:
>
http://sunsite.berkeley.edu/Imaging/Databases/
>[color=green][color=darkred]
> > > Would you suggest the same thing if the
> > > guy was storing 20,000 video files?[/color]
> >
> > Probably not. They *did* state their requirements on this point in the
> > original post though. The reason why I wouldn't recommend it is because[/color][/color]
of[color=blue][color=green]
> > one of the con's mentioned in my first post (the part about maintaining[/color][/color]
a[color=blue][color=green]
> > large single file for backups etc.) would far outweigh the benefits of
> > storing in the database.[/color]
>
> I agree. That's why I'm doubtful that storing the 10K images directly in
> the database is a good idea. To be sure, it might be a great idea I just
> (so far) don't think so.
>[color=green][color=darkred]
> > > To conclude something
> > > with as little information as
> > > has been posted isn't typically a good idea...[/color]
> >
> > Point taken and I'll be more careful in the future. I hope you can do[/color][/color]
the[color=blue][color=green]
> > same before posting responses like your original one:[/color]
>
> Sorry, I thought yours was the thoughtful response. Again I probably[/color]
didn't[color=blue]
> make myself clear on that. You gave "reasons" and so many times people[/color]
just[color=blue]
> post "opinions" never offering a basis for why they think what they think.
>
> Which computer is best? <Blah Corp.> Oh that's great... why?
>[color=green][color=darkred]
> > > I can't see any particular
> > > advantage to storing the
> > > images in the database
> > > can you? I can think of
> > > a number of key reasons not to.[/color][/color]
>
> I see now... it was intended to be an invitation for discussion. Rather
> than post "I think this... or that" I thought I might find out what the[/color]
guy[color=blue]
> with problem had thought about so far. He could be doing this for a large
> corporation with a dedicated server and SQL Server or he could be putting
> something together for the "dungeons and dragons" role-playing game he[/color]
hosts[color=blue]
> on a free internet site. I have no idea the kind of money or equipment[/color]
(or[color=blue]
> expertise) he has at his disposal.
>[color=green]
> > Thanks for the discussion. Hopefully I'll learn not to make assumptions[/color]
> like[color=green]
> > this in the future.[/color]
>
> It isn't you Trev... it is the way people post stuff in general. That's[/color]
one[color=blue]
> of the reasons "which computer language is best" type questions generate[/color]
so[color=blue]
> much heat and so little light. Few people ask "what do you want to do[/color]
with[color=blue]
> it" before mentioning the language they know.
>
> Take care,
> Tom
>
>[/color]