As we all know, BLOB sizes are limited to 4GB, which will suit most of us, but not all. If you're dealing with large, large files, you're gonna have to judge whether it'll fit into a BLOB. Friendly caveat.
As we all know, BLOB sizes are limited to 4GB, which will suit most of us, but not all. If you're dealing with large, large files, you're gonna have to judge whether it'll fit into a BLOB. Friendly caveat.
In my current project, we store all of our files in the filesystem and the references in the database.
What we did before choosing type of storage was:
1) Defined what types of images we had to deal with. With "types" I mean size.
2) How many images the system should be able to store.
3) Developed some test cases for storing as BLOB, BFILE(we use Oracle) or in the filesystem.
The tests showed that for very small images (<10k), BLOB was fastest. For images >10k<300k, BFILE and FS was best. For Images >300k, FS CLEARLY was the best!
First, most of ours pictures is quite big(>1Mb). That's one reason for us to choose FS for persistence.
Second, we have a LOT of images. For the moment, we have about 400 million of them and it increases with about 60-80 million per year.
If we should store all of the images in our database, well, we would get a REALLY BIG database to do backup(and maybe, restore) on!
Cheers
The main advantages of the filesystems (especially on linux machines) is that one can get a very advanced fs that supports journaling and is getting more and more close to db reliability. Ofc, one can't still do queries but as Wesslan pointed out, for files bigger then 300KB or for a large number of files, the advantages are compeling.
As for the 4GB limit - most filesystems have the same restriction; when dealing with such big data files, it's best to adjust the environment accordingly (imagine just what type of bandwidth is required to upload/download 4GB).
Costin Leau
SpringSource - http://www.SpringSource.com- Spring Training, Consulting, and Support - "From the Source"
http://twitter.com/costinl
Please use [ c o d e ] [ / c o d e ] tags
Is there a way to compress an image file size in Spring?
Sorry if this is way out of the thread, just can't get an answer to this.
Pls help![]()
You can compress data in Java but it's not a Spring thing. Try googling it.
Last edited by karldmoore; Aug 27th, 2007 at 02:36 PM.
Barracuda Networks SSL VPN Lead Developer
http://pramatr.wordpress.com
http://twitter.com/karldmoore
http://www.linkedin.com/in/karldmoore
Any postings are my own opinion, and should not be attributed to my employer or clients.