Conclusion
Nowadays, binary data routinely is modeled using XML files. The overhead of XML is usually not of too much concern, particularly since network bandwidth is increasingly plentiful. The XML overhead adds only a small amount of excess baggage to the data in transit.
What might be surprising to some readers (it was to me) is that relational databases are fully equipped to handle the problem of storing binary data. The SQL language and the commercial and open source database engines can easily solve the most demanding binary-data storage problems.
Management of unstructured data with Java is pretty easy. Perhaps one of the most difficult aspects lies in determining the size of your BLOB columns. Still, the technology is very accessible and powerful. One obvious application not discussed here is storing the BLOBs in a network server version of Derby. With that approach, clients could access the BLOB data by creating local file copies as described in Listing 5. The BLOB data could then be consumed as required by applications. In the case I’ve described here, the application was the storage and retrieval of recorded audio.
As I’ve mentioned in a few recent articles, I always believe in helping programmers move up the value chain—a topic I discuss at length in my eBook [4] and recent article [5] on the topic; for details, look at these and similar resources.
References
[1] "Getting Started with Derby" by Stephen B. Morris
[2] "Using Derby as a Network Database Server Engine" by Stephen B. Morris
[3] Source code discussed in this article (source.zip)
[4] Digital Short Cut eBook Moving Up the Value Chain by Stephen B. Morris
[5] "Moving C++ and Java Programmers Up the Value Chain" by Stephen B. Morris