Store HashTable in a database

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is it possible to store objects like HashTables in a database? How do I do
this?

The method I was thinking of is:
1. Serialize the HashTable.
2. Store the serialized data in XML.
3. To access the object, we deserialize the data and cast into HashTable.

Any suggestions to make this process more efficient would be appreciated.

Thanks
 
Yes it is possible. Also, there is no need to do XML, you could
binaryserialize the hashtable and save it as a blob instead (probably more
efficient).
The success of this whole thing obviously depends on the ISerializable
implementations of the objects you have thrown inside your HashTable.

Though I must say, I am almost of the inclination of storing them as memory
mapped files with unique filenames, and storing the filenames in the d/b.
That'd probably be better for the database. You might run into issues if
this operation is happening on a webfarm.

- Sahil Malik
http://dotnetjunkies.com/weblog/sahilmalik
 
Back
Top