[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

Best Database For Ruby

Butternut squash

3/25/2006 10:45:00 PM

I want to learn DB and SQL using Ruby

Project is not too big. Probably need 30 tables

Everyone at work tells me MySQL is the best... I used to use Informix a long
time ago. It doesn't look like I can get this for linux.

thanks in advance.
19 Answers

Robert Klemme

3/25/2006 10:52:00 PM

0

Butternut squash wrote:
> I want to learn DB and SQL using Ruby
>
> Project is not too big. Probably need 30 tables
>
> Everyone at work tells me MySQL is the best... I used to use Informix a long
> time ago. It doesn't look like I can get this for linux.
>
> thanks in advance.

As always, it depends on what you want to do. Postgres might be an
alternative - especially since it has proper transaction support, stored
procedures etc. significantly longer than MySQL.

Kind regards

robert

Daniel Harple

3/25/2006 11:27:00 PM

0

On Mar 25, 2006, at 11:48 PM, Butternut squash wrote:

> I want to learn DB and SQL using Ruby
>
> Project is not too big. Probably need 30 tables
>
> Everyone at work tells me MySQL is the best... I used to use
> Informix a long
> time ago. It doesn't look like I can get this for linux.

I suggest using http://ruby-dbi.rub... to help keep your code
database-independent.

-- Daniel


Gerardo Santana Gómez Garrido

3/25/2006 11:53:00 PM

0

2006/3/25, Butternut squash <rrrn@yahoo.com>:
> I want to learn DB and SQL using Ruby
>
> Project is not too big. Probably need 30 tables
>
> Everyone at work tells me MySQL is the best... I used to use Informix a long
> time ago. It doesn't look like I can get this for linux.

You can download Informix for Linux from here:
http://www14.software.ibm.com/webapp/download/search.jsp?go=y&...

and use it with Ruby with this:
http://ruby-informix.rub...

I'm running Informix on Solaris and Fedora Core 4 without any problem.

I've found Informix very nice.

>
> thanks in advance.
>
>


--
Gerardo Santana
"Between individuals, as between nations, respect for the rights of
others is peace" - Don Benito Juárez
http://santanatechnotes.blo...


Reid Thompson

3/26/2006 12:03:00 AM

0

Butternut squash wrote:
> I want to learn DB and SQL using Ruby
>
> Project is not too big. Probably need 30 tables
>
> Everyone at work tells me MySQL is the best... I used to use Informix a long
> time ago. It doesn't look like I can get this for linux.
>
> thanks in advance.
>
>
PostgreSQL www.postgresql.org

#for ruby db interaction....
gem install postgres
gem install postgres-pr
# http://n... http://www.nitrohq.c...
gem install nitro -y


PostgreSQL and Og work very well...

simple example -- playing around with ruby and postgresql on win XP..
10000 inserts in ~54 seconds ( pentium 4, 2+ghz, 1GB ram )

ogtest.rb
--------------------
require 'og'

class Comment
property :title, String
property :body, String
property :author, String
property :create_time, Time
end

og_psql = {
:destroy => false,
:store => :psql,
:user => 'rthompso',
:password => 'rthompso',
:name => 'testog'
}

Og.setup(og_psql)

puts Time.now
# save the object in the database
1.upto(10000) { |i|
c = Comment.new
c.title = 'Hello'
c.body = 'World'
c.create_time = Time.now
c.author = 'tml'
c.save
}
puts Time.now




Pat Maddox

3/26/2006 2:12:00 AM

0

On 3/25/06, Reid Thompson <reid.thompson@ateb.com> wrote:
> Butternut squash wrote:
> > I want to learn DB and SQL using Ruby
> >
> > Project is not too big. Probably need 30 tables
> >
> > Everyone at work tells me MySQL is the best... I used to use Informix a long
> > time ago. It doesn't look like I can get this for linux.
> >
> > thanks in advance.
> >
> >
> PostgreSQL www.postgresql.org
>
> #for ruby db interaction....
> gem install postgres
> gem install postgres-pr
> # http://n... http://www.nitrohq.c...
> gem install nitro -y
>
>
> PostgreSQL and Og work very well...
>
> simple example -- playing around with ruby and postgresql on win XP..
> 10000 inserts in ~54 seconds ( pentium 4, 2+ghz, 1GB ram )
>
> ogtest.rb
> --------------------
> require 'og'
>
> class Comment
> property :title, String
> property :body, String
> property :author, String
> property :create_time, Time
> end
>
> og_psql = {
> :destroy => false,
> :store => :psql,
> :user => 'rthompso',
> :password => 'rthompso',
> :name => 'testog'
> }
>
> Og.setup(og_psql)
>
> puts Time.now
> # save the object in the database
> 1.upto(10000) { |i|
> c = Comment.new
> c.title = 'Hello'
> c.body = 'World'
> c.create_time = Time.now
> c.author = 'tml'
> c.save
> }
> puts Time.now
>
>
>
>

I've never used og, but I suspect that'd drop to < 10s if you wrapped
it all in a transaction.


Reid Thompson

3/26/2006 4:36:00 AM

0

Pat Maddox wrote:
> On 3/25/06, Reid Thompson <reid.thompson@ateb.com> wrote:
>
>> Butternut squash wrote:
>>
>>> I want to learn DB and SQL using Ruby
>>>
>>> Project is not too big. Probably need 30 tables
>>>
>>> Everyone at work tells me MySQL is the best... I used to use Informix a long
>>> time ago. It doesn't look like I can get this for linux.
>>>
>>> thanks in advance.
>>>
>>>
>>>
>> PostgreSQL www.postgresql.org
>>
>> #for ruby db interaction....
>> gem install postgres
>> gem install postgres-pr
>> # http://n... http://www.nitrohq.c...
>> gem install nitro -y
>>
>>
>> PostgreSQL and Og work very well...
>>
>> simple example -- playing around with ruby and postgresql on win XP..
>> 10000 inserts in ~54 seconds ( pentium 4, 2+ghz, 1GB ram )
>>
>> ogtest.rb
>> --------------------
>> require 'og'
>>
>> class Comment
>> property :title, String
>> property :body, String
>> property :author, String
>> property :create_time, Time
>> end
>>
>> og_psql = {
>> :destroy => false,
>> :store => :psql,
>> :user => 'rthompso',
>> :password => 'rthompso',
>> :name => 'testog'
>> }
>>
>> Og.setup(og_psql)
>>
>> puts Time.now
>> # save the object in the database
>> 1.upto(10000) { |i|
>> c = Comment.new
>> c.title = 'Hello'
>> c.body = 'World'
>> c.create_time = Time.now
>> c.author = 'tml'
>> c.save
>> }
>> puts Time.now
>>
>>
>>
>>
>>
>
> I've never used og, but I suspect that'd drop to < 10s if you wrapped
> it all in a transaction.
>
>
yep - was just meant to show a simple usage with stats... but, since i'm
interested anyway...

Different machine - athlon 2500, 512MB RAM, windows XP -- postgresql
8.0.3 rather than PostgreSQL 8.1.3 and running ruby from cygwin rather
than natively....

Runs in 12-13 seconds -- entirely possible that the other box( p4,
2+ghz, 1GB ram, native ruby ) could drop it down under 10 seconds( or
even this box, if I took cygwin out of the equation ).

db =Og.setup(og_psql)
t1= Time.now
db.store.start

1.upto(10000) { |i|
c = Comment.new
c.title = 'Hello'
c.body = 'World'
c.create_time = Time.now
c.author = 'tml'
c.save
}

db.store.commit
puts Time.now - t1




Tom Allison

3/26/2006 4:48:00 AM

0

Reid Thompson wrote:
> Pat Maddox wrote:
>
>> On 3/25/06, Reid Thompson <reid.thompson@ateb.com> wrote:
>>
>>
>>> Butternut squash wrote:
>>>
>>>
>>>> I want to learn DB and SQL using Ruby
>>>>
>>>> Project is not too big. Probably need 30 tables
>>>>
>>>> Everyone at work tells me MySQL is the best... I used to use
>>>> Informix a long
>>>> time ago. It doesn't look like I can get this for linux.
>>>>
>>>> thanks in advance.
>>>>
>>>>
>>>>
>>>
>>> PostgreSQL www.postgresql.org

I think the debate between Postgres and MySQL is about as inflammatory as vi and
emacs. However I'm of the opinion that Postgres is ultimately a better database
if you are going to do real database things where the data is changing
frequently (INSERT, UPDATE, DELETE) as opposed to just reading it.

But I haven't any hard metric data to support any of this.

Unless there's something specifically ruby-esque to make the advantage clearer.

Postgres is nicely object oriented if you are into that sort of thing.


Zach Dennis

3/26/2006 4:49:00 AM

0

Butternut squash wrote:
> I want to learn DB and SQL using Ruby
>
> Project is not too big. Probably need 30 tables
>
> Everyone at work tells me MySQL is the best... I used to use Informix a long
> time ago. It doesn't look like I can get this for linux.
>

Alot of folks have already mentioned Postgresql. I hear there is iffy blob support if you use it
with ActiveRecord (and the rest of Rails). I can't say for Nitro/Og.

I use Mysql without any issue. It has served me well at work, at home and on the side.

Zach


Ara.T.Howard

3/26/2006 5:06:00 AM

0

Reid Thompson

3/26/2006 5:39:00 AM

0

Reid Thompson wrote:
> Pat Maddox wrote:
>> On 3/25/06, Reid Thompson <reid.thompson@ateb.com> wrote:
>>
>>> Butternut squash wrote:
>>>
>>>> I want to learn DB and SQL using Ruby
>>>>
>>>> Project is not too big. Probably need 30 tables
>>>>
>>>> Everyone at work tells me MySQL is the best... I used to use
>>>> Informix a long
>>>> time ago. It doesn't look like I can get this for linux.
>>>>
>>>> thanks in advance.
>>>>
>>>>
>>>>
>>> PostgreSQL www.postgresql.org
>>>
>>> #for ruby db interaction....
>>> gem install postgres
>>> gem install postgres-pr
>>> # http://n... http://www.nitrohq.c...
>>> gem install nitro -y
>>>
>>>
>>> PostgreSQL and Og work very well...
>>>
>>> simple example -- playing around with ruby and postgresql on win XP..
>>> 10000 inserts in ~54 seconds ( pentium 4, 2+ghz, 1GB ram )
>>>
>>> ogtest.rb
>>> --------------------
>>> require 'og'
>>>
>>> class Comment
>>> property :title, String
>>> property :body, String
>>> property :author, String
>>> property :create_time, Time
>>> end
>>>
>>> og_psql = {
>>> :destroy => false,
>>> :store => :psql,
>>> :user => 'rthompso',
>>> :password => 'rthompso',
>>> :name => 'testog'
>>> }
>>>
>>> Og.setup(og_psql)
>>>
>>> puts Time.now
>>> # save the object in the database
>>> 1.upto(10000) { |i|
>>> c = Comment.new
>>> c.title = 'Hello'
>>> c.body = 'World'
>>> c.create_time = Time.now
>>> c.author = 'tml'
>>> c.save
>>> }
>>> puts Time.now
>>>
>>>
>>>
>>>
>>>
>>
>> I've never used og, but I suspect that'd drop to < 10s if you wrapped
>> it all in a transaction.
>>
>>
> yep - was just meant to show a simple usage with stats... but, since
> i'm interested anyway...
>
> Different machine - athlon 2500, 512MB RAM, windows XP -- postgresql
> 8.0.3 rather than PostgreSQL 8.1.3 and running ruby from cygwin rather
> than natively....
>
> Runs in 12-13 seconds -- entirely possible that the other box( p4,
> 2+ghz, 1GB ram, native ruby ) could drop it down under 10 seconds( or
> even this box, if I took cygwin out of the equation ).
>
> db =Og.setup(og_psql)
> t1= Time.now
> db.store.start
>
> 1.upto(10000) { |i|
> c = Comment.new
> c.title = 'Hello'
> c.body = 'World'
> c.create_time = Time.now
> c.author = 'tml'
> c.save
> }
>
> db.store.commit
> puts Time.now - t1
>
>
>
Upated athlon system to PostgreSQL 8.1.3
8.78-9.2 seconds...