[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

Creating Databases in Ruby

Will Mueller

11/29/2007 2:48:00 AM

Hello All,

I was wondering how exactly is the best method for creating
databases in Ruby. I mean databases in a sense of small or large
quantities of information stored.

With Thanks,
--
Will Mueller
wce.page.tl
will.liljon@gmail.com

32 Answers

Mikel Lindsaar

11/29/2007 4:00:00 AM

0

Note: parts of this message were removed by the gateway to make it a legal Usenet post.

Unless you had a really good reason to do it, this is a fairly solved
problem.
One totally engineered solution is using ActiveRecord by itself with sqlite3
as a DB on the back. This then gives you a nice portable and bundleable
database inside any rails application.

_why had a good post about using sqlite in ruby...

Anyway, 2c

Mikel
http://lin...


On Nov 29, 2007 1:48 PM, Will Mueller <will.liljon@gmail.com> wrote:

> Hello All,
>
> I was wondering how exactly is the best method for creating
> databases in Ruby. I mean databases in a sense of small or large
> quantities of information stored.
>
> With Thanks,
> --
> Will Mueller
> wce.page.tl
> will.liljon@gmail.com
>
>

Axel Etzold

11/29/2007 2:43:00 PM

0


-------- Original-Nachricht --------
> Datum: Thu, 29 Nov 2007 11:48:26 +0900
> Von: "Will Mueller" <will.liljon@gmail.com>
> An: ruby-talk@ruby-lang.org
> Betreff: Creating Databases in Ruby

> Hello All,
>
> I was wondering how exactly is the best method for creating
> databases in Ruby. I mean databases in a sense of small or large
> quantities of information stored.
>
> With Thanks,
> --
> Will Mueller
> wce.page.tl
> will.liljon@gmail.com

Dear Will,

what "best" means is maybe a matter of taste or related
to some particular feature one needs ... :)

There are many relational database management systems

http://en.wikipedia.org/wiki/Relationa...

... and Ruby has bindings to many of them:

http://raa.ruby-lang.org/search.rhtml?searc...

Just choose one you like :)

Best regards,

Axel


--
Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
Ideal für Modem und ISDN: http://www.gmx.net/de/go/s...

Kyle Schmitt

11/29/2007 3:02:00 PM

0

One or two things to remember: if you aren't dealing with a huge
amount of data, and really just want to store it when you're done (or
periodically), and re-load it when you come back, Marshalling your
data to a file may be a better solution.

If you have data you want transactional file backed, but doesn't map
perfectly to relational models, you may want to try Pstore.

Relational Databases (SQL) are not the panacea of data storage, :)
remember your other options!


--Kyle

Clifford Heath

11/29/2007 10:29:00 PM

0

Kyle Schmitt wrote:
> If you have data you want transactional file backed, but doesn't map
> perfectly to relational models, you may want to try Pstore.

Sorry to be a pedant, but Atomic != Transactional.

Transactions require the ability to maintain all 4 ACID semantics
even if you pull the power plug in the middle, and even if someone
else is updating an overlapping set of objects. MyISAM is *not*
transactional, for example.

> Relational Databases (SQL) are not the panacea of data storage, :)
> remember your other options!

A proper relational database will give you transactions, and PStore won't.
If that matters to you :-).

Clifford Heath.

Robert Klemme

11/30/2007 12:41:00 PM

0

2007/11/29, Will Mueller <will.liljon@gmail.com>:
> Hello All,
>
> I was wondering how exactly is the best method for creating
> databases in Ruby. I mean databases in a sense of small or large
> quantities of information stored.

As the other answers demonstrate this cannot be answered at such a
high level. What kind of data do you want to store? How much of it?
What do you do with the data - is it mostly read only or modified a
lot? With answers to questions like these you will receive much
better targeted replies.

Kind regards

robert

--
use.inject do |as, often| as.you_can - without end

Dimitri Aivaliotis

11/30/2007 12:46:00 PM

0

On Nov 29, 2007 3:48 AM, Will Mueller <will.liljon@gmail.com> wrote:

> I was wondering how exactly is the best method for creating
> databases in Ruby. I mean databases in a sense of small or large
> quantities of information stored.

I've always liked KirbyBase[1]. From its Rubyforge project page:

KirbyBase is a small, plain-text, DBMS written in Ruby. It can be
used either embedded or client/server.
It aims to be as "Ruby-ish" as possible. For example, queries are
specified using Ruby code blocks,
rather than SQL strings.


- Dimitri

[1] http://www.netpromi.com/kirbybase...

Gerardo Santana Gómez Garrido

11/30/2007 11:49:00 PM

0

On 11/30/07, Dimitri Aivaliotis <aglarond@gmail.com> wrote:
> On Nov 29, 2007 3:48 AM, Will Mueller <will.liljon@gmail.com> wrote:
>
> > I was wondering how exactly is the best method for creating
> > databases in Ruby. I mean databases in a sense of small or large
> > quantities of information stored.
>
> I've always liked KirbyBase[1]. From its Rubyforge project page:
>
> KirbyBase is a small, plain-text, DBMS written in Ruby. It can be
> used either embedded or client/server.
> It aims to be as "Ruby-ish" as possible. For example, queries are
> specified using Ruby code blocks,
> rather than SQL strings.

If you like KirbyBase's interface, you may like Sequel too

http://code.google.com/p/ru...

which gives you a Ruby-ish interface, but for your RDBMS of choice.
--
Gerardo Santana

Will Mueller

12/1/2007 2:08:00 AM

0

Robert,

I simply would like to store regular ruby files. An example of this
would be below:

def w
puts "Test"
end

Except I would like to include multiple ruby files. Furthermore having
the ability to bring up the files, such as possibly typing "File."

On Nov 30, 2007 6:41 AM, Robert Klemme <shortcutter@googlemail.com> wrote:
> 2007/11/29, Will Mueller <will.liljon@gmail.com>:
> > Hello All,
> >
> > I was wondering how exactly is the best method for creating
> > databases in Ruby. I mean databases in a sense of small or large
> > quantities of information stored.
>
> As the other answers demonstrate this cannot be answered at such a
> high level. What kind of data do you want to store? How much of it?
> What do you do with the data - is it mostly read only or modified a
> lot? With answers to questions like these you will receive much
> better targeted replies.
>
> Kind regards
>
> robert
>
> --
> use.inject do |as, often| as.you_can - without end
>
>



--
Will M
wce.page.tl
will.liljon@gmail.com

Robert Klemme

12/1/2007 10:12:00 AM

0


Please do not top post.

On 01.12.2007 03:08, Will Mueller wrote:
> Robert,
>
> I simply would like to store regular ruby files. An example of this
> would be below:
>
> def w
> puts "Test"
> end
>
> Except I would like to include multiple ruby files. Furthermore having
> the ability to bring up the files, such as possibly typing "File."

What does "bring up" mean? What's wrong with using a file system for
this? I don't get your use case...

Kind regards

robert

Will Mueller

12/1/2007 10:59:00 PM

0

First of all, what do you mean by "top post"? Do you mean reply on an
email such as this?

And what I mean by "bring up" is simply like the method defined below.
If I would have typed the code I used below, I would be able to see
the text "Test" if I typed "w."

With Thanks,
Will

On Dec 1, 2007 4:15 AM, Robert Klemme <shortcutter@googlemail.com> wrote:
>
> Please do not top post.
>
> On 01.12.2007 03:08, Will Mueller wrote:
> > Robert,
> >
> > I simply would like to store regular ruby files. An example of this
> > would be below:
> >
> > def w
> > puts "Test"
> > end
> >
> > Except I would like to include multiple ruby files. Furthermore having
> > the ability to bring up the files, such as possibly typing "File."
>
> What does "bring up" mean? What's wrong with using a file system for
> this? I don't get your use case...
>
> Kind regards
>
> robert
>
>



--
Will M
wce.page.tl
will.liljon@gmail.com