I'm looking for advices about designing a "document server"
application. I'm developing n-tiers solutions in VB and I need to
provide all my applications a way to retrieve, edit and store any
kind of documents as BLOBs in a SQL Database. These documents could
be either Word or Excel Documents, as well as large binary files or
images. I used to do that using "regular" client-server techniques
(ADO recordsets), but now that we've switched to a multi-tier
architecture, the client software does not have any mean to access
ADO methods. Following the strict rules of this architecture, my
client applications know only how to parse a XML document.
I'd like your advice about the following : I've built up a COM+ Data
Object which extracts the data from the BLOB (through a stored
procedure), saves it as XML in a stream (ADO 2.5) and sends it back
to the client as a string. On the client-side, I simply parse this
XML string and extract the "node.typedvalue" for the binary field. I
then decode it and serialize it on the local disk to let the user
access it. It works but I then face two major problems :
1) this way of proceeding is particularly slow and I don't really
see how I could improve it. The size of the XML document generated
by ADO is about twice to third bigger than the original binary file
(due to the non-binary encoding). I could rely on my own algorithms
to extract the BLOB and binary-encode it but I'm affraid it could be
even slower (?).
2) What could be the best way to do the contrary, i.e. upload a
local file to the server to store it into the database ? I was
thinking about finding a good encoding for the data before sending
it to the server as a string, but maybe it's not the most efficient
to way to proceed ?
Has anybody already done that before ? Any idea about the best
encoding / uploading techniques ? Do you see any flaw in the general
architecture I've just described ?
Thx for your helps and advices,