Loading...
 
Skip to main content

Features / Usability


Images : Path vs Database

posts: 1

Hello. I understand that it's possible to store image data in a database such as MySQL, for example, however from everything that i've learned about it-- i would be inclinded to choose the Folder-path option for image storage, instead of using a Database for images.

I noticed that the default image storage option is to use a database. My next question assumes that you have extrapolated the same idea as i, in that by having a radio-button checked by default, chances are that is the choice that the developer is either expecting you to make, or that he or she wishes you to select. So-- I'm curious if there is a particular reason for encouraging users to store images in a database vs a path?

Those of you who use the Database for storing images:
Do you find that it is a convenient way to manage your wiki images? have you experienced any performance degradation? is there anything in particular about using a database to store image data which you think is worthy of discussion?

Those of you who are using a folder-- the "normal" method for uploading / storing images:
did you deselect "store in database" for any particular reason? do you have horror stories of database-image-storage, or did you simply do it because it "seemed the right choice"?

i ask because i'd like to try the database method, but i'd like to hear some feedback on the issue. in fact, if i find that this is a viable option for image storage, i may decide to implement it into some of my own dynamic sites (hand-coded stuff where i find it challenging to manage the offering of "image uploads" for a custom gallery, for example)

thanks!

posts: 4664 Japan

The database method may have been decided on for the default because it makes backing up or moving a Tiki installation easier. Maybe it is "cleaner" or more consistent internally to have all the user data in one place. I don't really know for sure.

Personally I like storing images as files. For one thing, images really increase the size of the database, so backing it up can take a long time. Also, probably due to my ignorance, I've had trouble successfully backing up and restoring images stored in the database.

I think if you have relatively few images, or mostly small ones, maybe with database storage there is a neater organization. But if you have a lot of images, and especially if they are large, then I think file system storage is the way to go. IIRC, others here have said basically the same thing. I don't think there's a significant difference in terms of server performance.

-- Gary

posts: 6

What kind of trouble are you having backing up and restoring images in the database?

I am looking at TikiWiki and I have a lot of images (mostly documents) to store. The program will be run on my home machine (P3-800 Mhz 512Meg RAM). I have no idea for growth potential... My goal is to keep the database under 4Gig so I can back the whole thing up to a DVD and put it in a safe deposit box.

-JJ


posts: 113 Ireland

I always choose the file system. My reasoning:

1) I may want to change my hosting site, and dumping a database with images makes for a much larger file. And importing the SQL may have issues (sql limits, php limits, ...) on the new hosting site. I have had this problem and try to avoid it.

2) I may have a small upload limit (in Apache) for files and have to ftp them directly. If I store the images in the file system, I can manually add them to a gallery (create stub image upload and then move the real file to replace the stub file and thumbnail). I have never figured out how to manually do this if the files or images are in the database. Think about the case where the upload limit is 2MB and you have a 3MB image.

I do not have any performance measures. But even if I found a db performance that was better (and I can't see how a db reference would be faster than a file reference) I still would use the file system for the above reasons.

gary


posts: 18 United Kingdom

Hi

I recently bodged together a new theme based on the Kubrick theme - My new theme included a lot of graphics, and while I was working on it, I used the tikidb for image storage - It made it easier for me to work on the theme from home that way. However, I did find it very slow. I've since moved to the folder option, and find it a bit faster - It's not as quick as just having the piccies outside of tiki completely, but it seemed better to me.


posts: 6

What kind of trouble are you having backing up and restoring images in the database?

I am looking at TikiWiki and I have a lot of images (mostly documents) to store. The program will be run on my home machine (P3-800 Mhz 512Meg RAM). I have no idea what my growth potential is... My goal is to keep the database under 4Gig. Once I outgrow the computer due to speed constraints, or file size, I will need to move it to another machine and I would like to make that as painless as possible.

-JJ