[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

A wish: Simple database

Hal E. Fulton

3/2/2005 3:14:00 PM

Hi, all...

I sometimes wish for a very simple database with the
following features:

1. Distributed as part of Ruby
2. Need not store entire db in memory
3. No SQL requirement
4. No special efficiency requirement
5. Available cross-platform
6. Database files are readable cross-platform

Typically I use DBM in this case. But it doesn't
meet (5) and (6), since it's not there on Windows
and the files can't be moved even across Linux
systems.

A simple marshal would be fine, but it violates (2).
I believe PStore would also?

SDBM works by default on Windows, but it is severely
limited if not actually buggy. Probably violates (6)
and (5) also.

Does anyone have any recommendation? Or would a
"universal built-in database" make an interesting
addition to our world?

Not trying to bloat Ruby, just asking.


Hal




39 Answers

Bill Guindon

3/2/2005 3:22:00 PM

0

On Thu, 3 Mar 2005 00:14:14 +0900, Hal Fulton <hal9000@hypermetrics.com> wrote:
> Hi, all...
>
> I sometimes wish for a very simple database with the
> following features:
>
> 1. Distributed as part of Ruby
> 2. Need not store entire db in memory
> 3. No SQL requirement
> 4. No special efficiency requirement
> 5. Available cross-platform
> 6. Database files are readable cross-platform
>
> Typically I use DBM in this case. But it doesn't
> meet (5) and (6), since it's not there on Windows
> and the files can't be moved even across Linux
> systems.
>
> A simple marshal would be fine, but it violates (2).
> I believe PStore would also?
>
> SDBM works by default on Windows, but it is severely
> limited if not actually buggy. Probably violates (6)
> and (5) also.
>
> Does anyone have any recommendation? Or would a
> "universal built-in database" make an interesting
> addition to our world?
>
> Not trying to bloat Ruby, just asking.

Well, there's always xBase.
Yes, I am biased on the topic.

--
Bill Guindon (aka aGorilla)


James Gray

3/2/2005 3:34:00 PM

0

On Mar 2, 2005, at 9:14 AM, Hal Fulton wrote:

> Hi, all...
>
> I sometimes wish for a very simple database with the
> following features:
>
> 1. Distributed as part of Ruby
> 2. Need not store entire db in memory
> 3. No SQL requirement
> 4. No special efficiency requirement
> 5. Available cross-platform
> 6. Database files are readable cross-platform

I've wished for a similar thing myself. I've had a few different
desires though.

To me is would be handy if each object could be stored in its own data
file, or if I could control the serialization file scheme (not sure
quite how). This especially works if it uses something like YAML, so I
can tweak it a little externally, but still be able to treat it as my
DB inside of Ruby. Would probably be cool if I could choose my output
format too: YAML, XML, or whatever.

That's probably nothing like what you had in mind, but it sounds handy
to me. I've needed something similar more than once.

Anyway, getting back on topic, yes, I like the idea.

James Edward Gray II



Jamey Cribbs

3/2/2005 3:38:00 PM

0

Hal Fulton wrote:

> Hi, all...
>
> I sometimes wish for a very simple database with the
> following features:
>
> 1. Distributed as part of Ruby
> 2. Need not store entire db in memory
> 3. No SQL requirement
> 4. No special efficiency requirement
> 5. Available cross-platform
> 6. Database files are readable cross-platform
>
> Does anyone have any recommendation? Or would a
> "universal built-in database" make an interesting
> addition to our world?
>
Well, I have written a pure-Ruby dbms library called KirbyBase
(http://www.netpromi.com/kirb...).

It satisfies features 2 through 6 of your list.

I have recently updated the Ruby version of KirbyBase to 1.8 to keep it
in line with the most recent Python version. I hope to release the new
version soon.

HTH,

Jamey Cribbs

Confidentiality Notice: This email message, including any attachments, is for the sole use of the intended recipient(s) and may contain confidential and/or privileged information. If you are not the intended recipient(s), you are hereby notified that any dissemination, unauthorized review, use, disclosure or distribution of this email and any materials contained in any attachments is prohibited. If you receive this message in error, or are not the intended recipient(s), please immediately notify the sender by email and destroy all copies of the original message, including attachments.


why the lucky stiff

3/2/2005 3:52:00 PM

0

James Edward Gray II wrote:

> To me is would be handy if each object could be stored in its own data
> file, or if I could control the serialization file scheme (not sure
> quite how). This especially works if it uses something like YAML, so
> I can tweak it a little externally, but still be able to treat it as
> my DB inside of Ruby. Would probably be cool if I could choose my
> output format too: YAML, XML, or whatever.

See YAML::DBM, which comes with Ruby.

require 'yaml/dbm'
YAML::DBM.open( "/tmp/blog" ) do |db|
db['name'] = 'RedHanded'
db['url'] = 'http://redhanded.hobi...
db['contact'] = ['redhanded@hobix.com', 'why@whytheluckystiff.net']
end

YAML::DBM.open( "/tmp/blog" ) do |db|
p db['contact']
end
#=> ['redhanded@hobix.com', 'why@whytheluckystiff.net']

However, it's a layer on top of DBM, so it doesn't meet Hal's requirements.

_why


Bill Guindon

3/2/2005 4:04:00 PM

0

On Thu, 3 Mar 2005 00:37:31 +0900, Jamey Cribbs <cribbsj@oakwood.org> wrote:
> Hal Fulton wrote:
>
> > Hi, all...
> >
> > I sometimes wish for a very simple database with the
> > following features:
> >
> > 1. Distributed as part of Ruby
> > 2. Need not store entire db in memory
> > 3. No SQL requirement
> > 4. No special efficiency requirement
> > 5. Available cross-platform
> > 6. Database files are readable cross-platform
> >
> > Does anyone have any recommendation? Or would a
> > "universal built-in database" make an interesting
> > addition to our world?
> >
> Well, I have written a pure-Ruby dbms library called KirbyBase
> (http://www.netpromi.com/kirb...).
>
> It satisfies features 2 through 6 of your list.
>
> I have recently updated the Ruby version of KirbyBase to 1.8 to keep it
> in line with the most recent Python version. I hope to release the new
> version soon.

Interesting, I like the feature set, and the fact that it's pure
Ruby/text. And to top it off, the puppy is cute. :)

--
Bill Guindon (aka aGorilla)


Matt Mower

3/2/2005 4:06:00 PM

0

On Thu, 3 Mar 2005 00:14:14 +0900, Hal Fulton <hal9000@hypermetrics.com> wrote:
> I sometimes wish for a very simple database with the
> following features:
>
> 1. Distributed as part of Ruby
> 2. Need not store entire db in memory
> 3. No SQL requirement
> 4. No special efficiency requirement
> 5. Available cross-platform
> 6. Database files are readable cross-platform
>

I'm wishing for something like this right now.

I am using the WordNet database as part of my Rails application
however it seems like overkill to use ActiveRecord (the database isn't
going to change and the queries I want to do are very simple) not to
mention the WordNet database isn't really constructed with
ActiveRecord in mind. However the dataset is too large to use a YAML
file.

With the right database I'd hide the WordNet data behind a simple API.

Regards,

Matt

--
Matt Mower :: http://matt...


James Britt

3/2/2005 4:10:00 PM

0

Hal Fulton wrote:
>
> Does anyone have any recommendation? Or would a
> "universal built-in database" make an interesting
> addition to our world?

No recommendation (unless someone knows if sqlite files are portable),
but yes, it would make an make an interesting addition.

I'm inclined to think that a lightweight DB falls into the same whatever
category as YAML or XML processing: it's the sort of thing that many
developers will find useful in enough situations that there is an
argument for having it as part the standard library.


James


Shashank Date

3/2/2005 4:36:00 PM

0

Hi Jamey,

--- Jamey Cribbs <cribbsj@oakwood.org> wrote:

> Hal Fulton wrote:
>
> > Hi, all...
> >
> > I sometimes wish for a very simple database with
> the
> > following features:
> >
> > 1. Distributed as part of Ruby

<snip>

> Well, I have written a pure-Ruby dbms library called
> KirbyBase
> (http://www.netpromi.com/kirb...).

Cool!

> It satisfies features 2 through 6 of your list.

In which case, how hard would it be to make it
distributed using dRuby? Just a thought ...

-- shanko




__________________________________
Celebrate Yahoo!'s 10th Birthday!
Yahoo! Netrospective: 100 Moments of the Web
http://birthday.yahoo.com/netr...


Jamey Cribbs

3/2/2005 4:46:00 PM

0

Shashank Date wrote:

>Hi Jamey,
>
>--- Jamey Cribbs <cribbsj@oakwood.org> wrote:
>
>
>
>>Hal Fulton wrote:
>>
>>
>>
>>>Hi, all...
>>>
>>>I sometimes wish for a very simple database with
>>>
>>>
>>the
>>
>>
>>>following features:
>>>
>>>1. Distributed as part of Ruby
>>>
>>>
>
><snip>
>
>
>
>>Well, I have written a pure-Ruby dbms library called
>>KirbyBase
>>(http://www.netpromi.com/kirb...).
>>
>>
>In which case, how hard would it be to make it
>distributed using dRuby? Just a thought ...
>
>
>
It already is! :-)

There is a script in the KirbyBase distribution called kbserver.rb that
uses dRuby to turn KirbyBase into a client/server multi-user dbms.

The reason why I did not include Hal's feature #1 in my earlier email is
that I thought he meant "distributed as part of the standard Ruby
libraries". Maybe I misunderstood. :-)

Jamey

Confidentiality Notice: This email message, including any attachments, is for the sole use of the intended recipient(s) and may contain confidential and/or privileged information. If you are not the intended recipient(s), you are hereby notified that any dissemination, unauthorized review, use, disclosure or distribution of this email and any materials contained in any attachments is prohibited. If you receive this message in error, or are not the intended recipient(s), please immediately notify the sender by email and destroy all copies of the original message, including attachments.


Michael Neumann

3/2/2005 5:00:00 PM

0

Hal Fulton wrote:
> Hi, all...
>
> I sometimes wish for a very simple database with the
> following features:
>
> 1. Distributed as part of Ruby
> 2. Need not store entire db in memory
> 3. No SQL requirement
> 4. No special efficiency requirement
> 5. Available cross-platform
> 6. Database files are readable cross-platform
>
> Typically I use DBM in this case. But it doesn't
> meet (5) and (6), since it's not there on Windows
> and the files can't be moved even across Linux
> systems.
>
> A simple marshal would be fine, but it violates (2).
> I believe PStore would also?

Something like FSDB?

http://raa.ruby-lang.org/list.rhtml...

Theoretically, it could be imported into Ruby if the author and matz
would agree (and there's need for it in the base distribution).

Regards,

Michael