cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joe Baldwin <jfbald...@earthlink.net>
Subject Re: How to map/model files?
Date Sat, 21 Mar 2009 21:49:18 GMT
Joseph,

> How to model/map files (with their content) e.g. in webapplications?
> What is the best practice?
> (1) To put their content as blob fully in the DB plus fields for  
> properties,
> or
> (2) to put the metadata about files only in the DB and the content
>   in a file system?
> or
> (3) other solution?
>
> The second one seems to be the most efficient, but than the entire  
> transaction
> support is lost :(.
>
> What's the best solution with Cayenne?

A lot of people have this question when investigating the current  
state of technology.  My opinion is based on the last time I  
investigated the same options.  With the new databases as well as  
Cayenne you could certainly manage BLOB's via the database.  The  
problem is not the storage issue, it is the usage issue once you  
retrieve the object.  The web languages are much more friendly to file  
system references and less friendly to blob references.  It can be  
done (and I have done it), but it is not pretty.  :)

My preference (and it seems to be fairly efficient), is to continue  
with the standard design pattern of storing metadata (file-path, etc)  
in the database and storing the file in the filesystem.  You can them  
make programatic references much easier.

> The second one seems to be the most efficient, but than the entire  
> transaction support is lost :(.

Not sure what you mean by "transaction support", so I can't comment on  
this.

If you have special needs for your users, then the best course of  
action is to build a end-to-end test with a simple representative  
object, and see for yourself which way works for you.

Joe



Mime
View raw message