DBlobCache
Ruby on Rails Work
Yes, you hear well, store files in database.
DBBlobCache Is a DRb (Distributed Ruby) server that cache database blobs in filesystem, aiming to lighttpd/Apache quickly serve static files.
Instead of generate ActiveRecord dinamic content at high cost database performance, DBBlobCache only retrieve data from database the first time is used and when it's updated.
#svn co svn://iquis.com/dbblobcache/trunk/ dbblobcache
To make svn external to our rails app
#cd /path_to_rails_root/
#svn propedit vendor/plugins
add:
dbblobcache svn://iquis.com/dbblobcache/trunk/
#database.yml entry
dbblobcache:
root: public
directory: files
table: items
blob: image
adapter: mysql
database: example_database
username: username
password: password
host: database_host
port: 3306
#The controller must to start client binding to drb server (now localhost)
def initialize
DRb.start_service
@dbblobcache = DRbObject.new(nil, "druby://:8880")
#@dbblobcache = DRbObject.new(nil, "druby://lithty:8880")
end
tag("img", :src=> @dbblobcache.get_image(item.id,"",item.extension,item.date), :border=>0)
#./vendor/plugins/dbblobcache/dbblobcache
Files are for filesystem and data is for database, i get the better of two.
Is completely alpha code, please try it, and help to inprove it.
In future the answer maybe yes, like file_column but taking care of database
Is a great idea, but at the time, is a must to check and bench this approach.
Well first i must read plugin doc :P
Contact: GTalk GMail at juanpedro.paredes AT gmail.com