File database less than 10-20 MB

  • Thread starter Thread starter Nully Girl
  • Start date Start date
Hi Nully,

Using an MS Sql server you can use the image data type for the Value column.
Then simply store the file data as a byte[] in that column. The Key column
would then typically be the name of the file. The Image data type is limited
to max 2Gb of data per file.
 
Morten said:
Hi Nully,

Using an MS Sql server you can use the image data type for the Value column.
Then simply store the file data as a byte[] in that column. The Key column
would then typically be the name of the file. The Image data type is limited
to max 2Gb of data per file.
Sorry cant user any relational database for this.

I only need to save key and a value. And I also need to read out values
from the file using the key...

any other recommendations?
 
Nully Girl said:
Morten said:
Hi Nully,

Using an MS Sql server you can use the image data type for the Value
column. Then simply store the file data as a byte[] in that column. The
Key column would then typically be the name of the file. The Image data
type is limited to max 2Gb of data per file.
Sorry cant user any relational database for this.

I only need to save key and a value. And I also need to read out values
from the file using the key...

any other recommendations?



Look at using System.XmlSerialization.XmlSerializer.
http://msdn.microsoft.com/en-us/library/system.xml.serialization.xmlserializer.aspx
 
Family said:
Nully Girl said:
Morten said:
Hi Nully,

Using an MS Sql server you can use the image data type for the Value
column. Then simply store the file data as a byte[] in that column.
The Key column would then typically be the name of the file. The
Image data type is limited to max 2Gb of data per file.
Sorry cant user any relational database for this.

I only need to save key and a value. And I also need to read out
values from the file using the key...

any other recommendations?



Look at using System.XmlSerialization.XmlSerializer.
http://msdn.microsoft.com/en-us/library/system.xml.serialization.xmlserializer.aspx
Thats good mike, how will the performance be if I have a xml file with
20 MB of data with key and value, I am thinking of when I only want the
value which have key=9999992. Performance?
 
Nully said:
Morten said:
Hi Nully,

Using an MS Sql server you can use the image data type for the Value
column. Then simply store the file data as a byte[] in that column.
The Key column would then typically be the name of the file. The
Image data type is limited to max 2Gb of data per file.
Sorry cant user any relational database for this.

I only need to save key and a value. And I also need to read out values
from the file using the key...

any other recommendations?

It really depends on the amount of data you want to store. Given the
speed of processors these days, for a small amount of data even a text
file will do the job.

Zach.
www.thinkbones.com
 
Sorry cant user any relational database for this.

I only need to save key and a value. And I also need to read out values
from the file using the key...

any other recommendations?

SQLite; it's small, embedded, and quite ideal for what you're doing, it
sounds like.

--- Mike
 
Nully Girl said:
Family said:
Nully Girl said:
Morten Wennevik [C# MVP] wrote:
Hi Nully,

Using an MS Sql server you can use the image data type for the Value
column. Then simply store the file data as a byte[] in that column.
The Key column would then typically be the name of the file. The Image
data type is limited to max 2Gb of data per file.


Sorry cant user any relational database for this.

I only need to save key and a value. And I also need to read out values
from the file using the key...

any other recommendations?



Look at using System.XmlSerialization.XmlSerializer.
http://msdn.microsoft.com/en-us/library/system.xml.serialization.xmlserializer.aspx
Thats good mike, how will the performance be if I have a xml file with 20
MB of data with key and value, I am thinking of when I only want the value
which have key=9999992. Performance?


What I was suggesting was that your objects in memory are saved as necessary
via XmlSerialization. They then can be loaded as necessary this way as
well. Your queries would still be against the object in memory. There are
ways to do queries against the XML, such as with LINQ to XML, but I'm not
sure you need that.
 
AFIK performance is rarely an issue for large XML files when you control yor
own server as you can throw as much RAM at the task as needed. It really
only become a probelmwhen being hosted. Once the file is in memory only
those needed fragments need to be grabbed and sent to a page or whatever.
Finally, for two and only two fields of data this is one instance I might
consider an mdb file which of course is generated by the JET database and
only because it is file based, portable and easy to use with code noting the
same RAM considerations cannot be avoided. AFIK



Family Tree Mike said:
Nully Girl said:
Family said:
Morten Wennevik [C# MVP] wrote:
Hi Nully,

Using an MS Sql server you can use the image data type for the Value
column. Then simply store the file data as a byte[] in that column.
The Key column would then typically be the name of the file. The
Image data type is limited to max 2Gb of data per file.


Sorry cant user any relational database for this.

I only need to save key and a value. And I also need to read out values
from the file using the key...

any other recommendations?



Look at using System.XmlSerialization.XmlSerializer.
http://msdn.microsoft.com/en-us/library/system.xml.serialization.xmlserializer.aspx
Thats good mike, how will the performance be if I have a xml file with 20
MB of data with key and value, I am thinking of when I only want the
value which have key=9999992. Performance?


What I was suggesting was that your objects in memory are saved as
necessary via XmlSerialization. They then can be loaded as necessary this
way as well. Your queries would still be against the object in memory.
There are ways to do queries against the XML, such as with LINQ to XML,
but I'm not sure you need that.
 
Hi, I need to create a file database, need to save 2 columns (key,
value), does someone know how to implenet this is c#. Please keep
performance in mind

Thanks
Nullyhttp://www.hd720i.com

Hi,

You can use a DataSet and serialize it, there is nothing simpler than
that :)
 
Family said:
Nully Girl said:
Morten Wennevik [C# MVP] wrote:
Hi Nully,
Using an MS Sql server you can use the image data type for the Value
column. Then simply store the file data as a byte[] in that column.  
The Key column would then typically be the name of the file.  The
Image data type is limited to max 2Gb of data per file.
Sorry cant user any relational database for this.
I only need to save key and a value. And I also need to read out
values from the file using the key...
any other recommendations?
Look at using System.XmlSerialization.XmlSerializer.
http://msdn.microsoft.com/en-us/library/system.xml.serialization.xmls...

Thats good mike, how will the performance be if I have a xml file with
20 MB of data with key and value, I am thinking of when I only want the
value which have key=9999992. Performance?

It's going to be slsower than with SQL. and more memory intensive (you
will have the ENTIRE table in memory).
The best part is that to test the solution is VERY simple, just write
a random number of records in your Dataset and see how well it performs
 
What should I look for if I want to deploy a webapp based upon asp.net and
sql lite to a shared hosting provider?
 
Back
Top