Page 1 of 1

Storing assets as blobs in database vs file system

Posted: Sat Mar 03, 2012 7:49 am
by om.singh
In the current version all assets are stored in the database and then retrived as content on the first visit and stored on disk. Subsquently they are served from cache and not fecthed from the database.

Instead - it will be good to have the content stored on disk on the first place. This way its easier to promote content on edge devices or webservers - using custom shell scripts.

Let me know what you think.

Regards
Om

Re: Storing assets as blobs in database vs file system

Posted: Mon Mar 05, 2012 2:54 pm
by bpolster
Om,

The initial CMS implementation assumes that you will be using an edge server (e.g. Amazon/Akamaii etc.) for images. To facilitate this, requires to steps. First, you would update the asset.server.url.prefix property found in common.properties for at least the production environment. Second, when you are rendering images, use the UrlRewriteTag so that the prefix is properly prepended to your URLs.

This works for CDNs where you specify an origin server. The CDN will look up the image from BLC (which reads the blob from the DB) the first time only.

We are considering other image distribution approaches but nothing is on the immediate roadmap as we believe our current approach can be configured to handle most needs nicely. For those that don't want to use a CDN, they could use a local Apache proxy (e.g. using a squid server) as the image endpoint.