I work at a company that has made code and content deployment more formal. Content often can't wait for the normal twice monthly cycle so we do "hot fixes". We have some portions content managed so we can bypass the "process". There is one simple content feature that I'd like to content manage. It includes a few test items and an image. The image currently is deployed to multiple servers throught the code deployment process. I haven't stored images in a database but to eliminate hot fixes it might be the way to go. I am sure Marketing would love to respond better to executive management requests to change things in real time. Is there any concern about performance by doing this? A little background: Database: SQL Server 2000 (potentially moving to latest Oracle) Web Application Server: Coldfusion MX 6.1 (potentially mixxing with Java) Traffic: 20,000 visitors per day Servers: 8 behind a load balancer Caching: Net Cache for images and files (not sure if it would handle images from database)
Stupid question, but do you need to save the image as such? What I usually do is save the filename of the image, width, height, and occasionally alt tag in four fields in the database and then retrieve and display the information accordingly. This does work with SQL Server 2K and ASP, and will handle pretty well any level of traffic you throw at it. I'm not really familiar with ColdFusion myself.
I don't need to store the image in the database. I can access the production database with delay. Getting an image file to a production web server normally takes days since management has chosen to use twice monthly uploads. So if I can store and retrieve images from a database responsiveness to Marketings needs will be much better. You can think of ColdFusion as being similar ASP or ASP.NET, it generates web pages on the server side.
wouldn't it be easier to store the images on their own server, and reference them from a database as awd1 suggests? If you are storing a lot of images I belive it's faster to store them in small groups. eg if you have a file called: 123456789.jpg save it as /12/34/56/78/9.jpg
Yes, I think that's the best way to do it imo too. I follow this method (Storing file names in the db and referencing and displaying them) for two of my sites at work. Plus, I do something similar with my Photography site as well and have never had any performance issues.
Thanks for the feedback but you are missing the point. Our company (1000's of employees) adopted IBM's software development process which means beauracracy: what would be a one minute job for me to FTP an image to a web server is now a 5 day process starting with checking the file into a version control system on Friday and it gets passed around to various testing servers and then gets put on a production web server the following Thursday or Saturday night. This doesn't work when the CEO says "change pricing before tomorrow". The question is there any concerns about calling images from a database not a question about how to store a file name in a database.
It makes your database slow down, unless you can cache the image somewhere else. I guess there would be more server overhead depending on what your doing with the images - like constantly re-sizing them on the fly
What stuw said. I've also heard of cases where the image itself can cause corruption issues with the database. These are the reasons I asked the question and made the suggestion I did. Your response times will be much quicker and your DB will be smaller and more stable. But...it sounds to me like you're up the excrement creek without a paddle.
We are a big company (employees measured in thousands, business meausered in billions per month) and have more than enough web server and database server capacity and we use NetCache so the image can be cached outside the database.
ok if it is a big company, and theres no worry bout server loads cause its an intranet yes storing images as BLOBs is good idea now im not 100% on SQL server but im sure its almost same process for uploading images to database as mysql
I think the best thing you can do is take the image binary using php and store that in the database then use a few functions from the PHP GD library to build up the image from binary again.