Light database

  • Thread starter Alexander Muylaert
  • Start date
A

Alexander Muylaert

Hi

I'm looking for a small and light file structure for my app.

I need to store a bunch of small streams. It is always like key - data.
I need to be able to get, add, delete and update these streams. I also
should be able to iterate through the entire table.
No complex sql queries, etc...

Anybody knows an alternative. It doesn't have to be free, but if would be
affordable, that would help me. :)

Kind regards

Alexander
 
A

Arran Pearce

Store your data as XML in a file. If security is a concern then encrypt
the file.

And all for free :)
 
A

Alexander Muylaert

Okay

SPEED is really an issue. It needs to be very fast.

XML is totally the opposit :)

kind regards

Alexander
 
I

Ignacio Machin \( .NET/ C# MVP \)

Hi,

If you data is not binary you may use a XML file, later you can load it on
a DataSet with a single line of code, as well as write it back to XML.
If you data is not binary ( you call them "stream") you will need another
solution. If so access may be a good idea.


Cheers,
 
S

Stefano \WildHeart\ Lanzavecchia

I'm looking for a small and light file structure for my app.
I need to store a bunch of small streams. It is always like key - data.
I need to be able to get, add, delete and update these streams. I also
should be able to iterate through the entire table.
No complex sql queries, etc...

Try PERST: http://www.garret.ru/~knizhnik/perst.html
It does exactly what you want though it may not be immediately evident.
Check all the examples in the distribution archive concentrating in
particular (if I understand correctly your request) on the one about BLOBs.

Perst IS free, by the way. It's also still maintained and updated by the
author who is a nice and responsive guy. PERST is fast, simple and has a
very small footprint.
The only drawback is that PERST is single-process only so you may need to
add a bit of locking around it if you need your archives to be accessed
concurrently by multiple processes/computers.
 
A

Arran Pearce

Depends how much work your doing. You said that you only need to hold a
small amount of data. If that is the case it would not be too bad to
load the Xml in at the start of the application running. (XmlDocument)
and then read and write to the XML in memory and on application close
(or at points in your app) save the data to a file.
 
J

John Wood

Yes I can vouch for Perst, it's extremely useful.

Also it is thread-safe (but not multi-threaded, nor does it implement a
particularly granular locking strategy), so there is no need to put in
locking yourself.

The range of disk-based index technologies is what impresses me more than
anything... b-tree, t-tree, r-tree and more.

Plus it's entirely managed.
 
A

Alexander Muylaert

I didn't say I had only to hold small amount of data. I said I have to save
a bunch of small amounts.
The total sum is big and binary. That's why speed is an issue.

kind regards

Alexander
 
A

Alexander Muylaert

Yep

Exactly what I need.

Simple Key -Value Pairs with binary data and fast.

How is speed of perst?

Kind regards

Alexander
 
J

John Wood

It's certainly faster than other object databases...
And I'd say it's faster than COM's structured storage technology... but of
course it won't be as fast as commercial databases, simply because (a) it's
totally managed code and (b) it uses reflection to deserialize rows
(instances), which itself is quite slow.

Give it a go, it's fairly easy to get going with it. If you need any help
you can email me and I'll try and help. The author (Konstantin) is also very
helpful.
 
8

802.16a

Alexander said:
Hi

I'm looking for a small and light file structure for my app.

I need to store a bunch of small streams. It is always like key - data.
I need to be able to get, add, delete and update these streams. I also
should be able to iterate through the entire table.
No complex sql queries, etc...

Anybody knows an alternative. It doesn't have to be free, but if would be
affordable, that would help me. :)

Kind regards

Alexander

That sounds exactly like named-value pairs.
 
A

Alexander Muylaert

That sounds exactly like named-value pairs.

Yes, that's the obvious part.
But I was looking for a solution ;)

Kind regards

Alexander
 
8

802.16a

Alexander said:
Yes, that's the obvious part.
But I was looking for a solution ;)

Kind regards

Alexander

Well -- named-value pairs /is/ a data structure available to you in c#

It's built in.
 
J

John Wood

I think the key to what he's asking for is in the term 'file structure' in
his original message, and 'light database' in the subject. He's looking for
a disk based storage solution, hashtables/namevaluecollections etc. are all
in-memory.
 
8

802.16a

John said:
I think the key to what he's asking for is in the term 'file structure' in
his original message, and 'light database' in the subject. He's looking
for a disk based storage solution, hashtables/namevaluecollections etc.
are all in-memory.

He can serialize it.

That would create the most minimal object for the application.

Trying to futz with a database and XML is overkill.


(a) Use the NamedValueCollection
(b) Create the interface for the type of data he wants
(c) Load and serialize/deserialize the object as needed.
 
K

Klaus H. Probst

BerkeleyDB rocks for this. It's *exactly* what you're looking for.

All you need is to write a wrapper around the C API =(
 
A

Alexander Muylaert

Yes

You are also right.

I'm checking out this one too.

kind regards and many thanks

Alexander
 
A

Alexander Muylaert

So, anybody has a c# wrapper for berkely db?

Nobody on the net seems to have it.

Weird.

Kind regards

Alexander
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top