Ruby + Postgres = Bad Idea or Good Idea?

Hello,

We’re making a development decision soon to use Ruby to develop a front
end for our system. The backend currently runs on Postgresql. Some
contractors are pushing us to change the backend database to MySQL,
simply because it’s more common to work with Ruby + MySQL. We prefer
not to support more than one kind of database in house.

We have gotten push back from contractors, who have said, “If it’s not
MySQL, I wont bid on it.” I am not a Ruby Developer (IANARD), but I
would like to know if there is an issue with using Ruby + Postgres.
Someone indicated that Ruby + MySQL play nice together, whereas it’s
problematic to use other kinds of DBs.

This sounds ridiculous to me, but if I’m missing something, I would love
to hear some opinions. Is there an issue with support for
Ruby+Postgres?

Thanks,
Bill

On Fri, Apr 17, 2009 at 6:43 PM, Bill S.
[email protected] wrote:

MySQL, I wont bid on it." I am not a Ruby Developer (IANARD), but I
would like to know if there is an issue with using Ruby + Postgres.
Someone indicated that Ruby + MySQL play nice together, whereas it’s
problematic to use other kinds of DBs.

This sounds ridiculous to me, but if I’m missing something, I would love
to hear some opinions. Is there an issue with support for
Ruby+Postgres?

Hi Bill,

MySQL is almost a de facto standard for web development, and most
people are so ignorant that they think MySQL is the only RDBMS that
plays nicely with any platform. Obviously, it may be the most widely
used RDBMS in web apps, therefore, you will find much more volunteers
to add support for it. But, as far as I know Postgres plays nicely
with Rails. I haven’t tried it myself, but I have had people report
that it does work nice with it.

It is true that Rails does not work nicely with a few RDBMSs, but that
has to do with the fact that the majority work with MySQL, hence you
will tend to get more support for MySQL.

If you don’t want to lose the contract, then just do what they say: go
with MySQL. The only problem that I see with MySQL is the licensing
scheme, which isn’t very attractive.

Fidel.

Bill S. wrote:

Hello,

We’re making a development decision soon to use Ruby to develop a front
end for our system. The backend currently runs on Postgresql. Some
contractors are pushing us to change the backend database to MySQL,
simply because it’s more common to work with Ruby + MySQL. We prefer
not to support more than one kind of database in house.

I’ve been using ruby + postgres for many years with no problems at all.
I have also used ruby + Mysql on and off over the past few years and
encountered a few problems with it.

I think if you scan this mailing list archive you will see far more
problem reported about mysql adapters, timeouts etc. than postgres. That
maybe because more people use mysql, it’s hard to tell.

We have gotten push back from contractors, who have said, “If it’s not
MySQL, I wont bid on it.” I am not a Ruby Developer (IANARD), but I
would like to know if there is an issue with using Ruby + Postgres.
Someone indicated that Ruby + MySQL play nice together, whereas it’s
problematic to use other kinds of DBs.

My own opinion (no flame wars!) and I know also the opinions of many
others is that postgres is a superior database in almost every respect,
particularly the later (8.2+) versions.

In every scenario I have, postgres has outperformed and remained much
more stable on any meaningful sized databases (1GB to 100GB).

This sounds ridiculous to me, but if I’m missing something, I would love
to hear some opinions. Is there an issue with support for
Ruby+Postgres?

We currently have a very large rails application using postgres and it
hasn’t failed us once. We develop under Windows and Linux and deploy
under Linux and FreeBSD. Windows is fine as long as you use the
postgres-pr gem, mainly because the binary adapters for ruby are not
well supported under Windows. Using Linux and FreeBSD, never had a
problem.

I’m sure you will find support for the combination and even commercial
support for postgres itself if needs be.

Cheers,
Gary.

Bill S. [email protected] wrote:

This sounds ridiculous to me, but if I’m missing something, I would love
to hear some opinions. Is there an issue with support for
Ruby+Postgres?

Not that I’ve found… I’ve got a fairly large database schema,
partially
defined in ruby, partially defined as actual PostgreSQL statements, with
referential integrity, triggers, views, etc, and ruby’s coping with it
fine.

For some reason to make a model that queried a view in the database, I
had to add this to the model definition:

def self.inheritance_column
“none”
end

I can’t remember if that was due to the table actually being a view,
or if
there was some other reason for that… but Ruby and PostgresSQL have
been
playing together very nicely for me, even with a heavily
customized/programmed DB on the PG side.

Cheers,
Tyler

On Fri, Apr 17, 2009 at 6:59 PM, Gary D. [email protected] wrote:

My own opinion (no flame wars!) and I know also the opinions of many
others is that postgres is a superior database in almost every respect,
particularly the later (8.2+) versions.

In every scenario I have, postgres has outperformed and remained much
more stable on any meaningful sized databases (1GB to 100GB).

Shouldn’t agree more.

Fidel.

PostgreSQL +1

On Fri, Apr 17, 2009 at 11:02 AM, Fidel V.
[email protected]wrote:

Shouldn’t agree more.

Fidel.


Robby R.
Chief Evangelist, Partner

PLANET ARGON, LLC
design // development // hosting w/Ruby on Rails

http://robbyonrails.com/
http://twitter.com/planetargon
aim: planetargon

+1 503 445 2457
+1 877 55 ARGON [toll free]
+1 815 642 4068 [fax]

Bill S. wrote:

Hello,

We’re making a development decision soon to use Ruby to develop a front
end for our system. The backend currently runs on Postgresql.

That sounds like good decisions all around. Will you be using Rails, or
some other Ruby framework?

Some
contractors are pushing us to change the backend database to MySQL,
simply because it’s more common to work with Ruby + MySQL.

It’s certainly true that more people use mySQL than Postgres. It’s also
true that more people own Windows boxes than Macs. Popular !=
advisable. :slight_smile:

OK, that was snarky. I agree with others on this thread that PostgreSQL
is a better DBMS than mySQL, and no decent developer should have much
problem with it.

We prefer
not to support more than one kind of database in house.

We have gotten push back from contractors, who have said, “If it’s not
MySQL, I wont bid on it.”

That’s silly. (I’ll bid on your PostgreSQL projects any day!)

I am not a Ruby Developer (IANARD), but I
would like to know if there is an issue with using Ruby + Postgres.

Not that I know of. I use them together all the time.

Someone indicated that Ruby + MySQL play nice together, whereas it’s
problematic to use other kinds of DBs.

This sounds ridiculous to me,

And so it is. It’s not problematic at all; in fact, I recommend it.

but if I’m missing something, I would love
to hear some opinions. Is there an issue with support for
Ruby+Postgres?

Yes. The issue is that you won’t be able to hire inexperienced
developers who don’t want to think about anything but mySQL. :smiley:

Thanks,
Bill

Best,

Marnen Laibow-Koser
http://www.marnen.org
[email protected]

Bill S. wrote:

This sounds ridiculous to me, but if I’m missing something, I would love
to hear some opinions. Is there an issue with support for Ruby+Postgres?

We use Postgres as the backend for everything we run, the sole exception
is our webfax front end which I do not have time to figure out how to
make work with Postgres. One day perhaps.

The main thing to be aware of with contractors is that the dominant
thinking about DBMS, insofar as web-app developers go, is that it is a
conveniently formatted bit-bucket. This is very far from the truth but
it is the current paradigm.

ActiveRecord is but a case in point. ORMs frequently make it very
difficult to exploit Postgres’s capabilities to any great extent. There
are plugins to accomplish a few additional things with Postgres through
AR, but most of the features of a full-fledge RDBMS are all but
inaccessible without a lot of SQL strings built into your application.

If your requirements are at all sophisticated in terms of transaction
volume and complexity then you may be better off looking for people who
have worked with the sequel gem and who know Postgres inside out.

Developers with deep knowledge of the DBMS and its inherent capabilities
– like triggers, functions and stored procedures – will provide you
with far better results than peole who just know web-apps and the
minimum necessary to get data in and out of the store.

Bill S. wrote:

Hello,

We’re making a development decision soon to use Ruby to develop a front
end for our system. The backend currently runs on Postgresql. Some
contractors are pushing us to change the backend database to MySQL,
simply because it’s more common to work with Ruby + MySQL. We prefer
not to support more than one kind of database in house.

We have gotten push back from contractors, who have said, “If it’s not
MySQL, I wont bid on it.” I am not a Ruby Developer (IANARD), but I
would like to know if there is an issue with using Ruby + Postgres.
Someone indicated that Ruby + MySQL play nice together, whereas it’s
problematic to use other kinds of DBs.

This sounds ridiculous to me, but if I’m missing something, I would love
to hear some opinions. Is there an issue with support for
Ruby+Postgres?

Thanks,
Bill

Thank you to everyone who replied. This is very helpful.

I think we will stick with our current plan, and use Postgresql. In
general, it makes me uncomfortable when developers refuse to use one
tool or another. It shouldn’t really matter. It’s the architecture
that really counts. The code design should be modularized, so that any
back-end DB could be used. MySQL and Postgresql shouldn’t make a huge
difference to the front-end developer. (We choose Postgresql for the
back-end for some particular reasons, nothing to do with the
front-end.).

On Friday 17 April 2009, Bill S. wrote:

This sounds ridiculous to me, but if I’m missing something, I would
love to hear some opinions. Is there an issue with support for
Ruby+Postgres?

I much prefer PostgreSQL over MySQL. MySQL’s interpretation of the SQL
standard(s) has driven me up the wall at times. Does it still force a
default value on every column with a NOT NULL constraint?

PostgreSQL works great with Rails, the support in the core is exactly as
for MySQL. I’ve encountered the odd extension (plugin, gem, whatever)
that only supports MySQL, but that may rather an indication of the
extension’s quality.

Michael


Michael S.
mailto:[email protected]
http://www.schuerig.de/michael/

"Some other points you might want to check if you compare these two:

  • Behavior under concurrent accesses: Transactional isolation, locking.
  • Transactional changes to the DB structure.
  • Performance with many joins.
  • Changing the structure of (large) existing tables.

In my experience, PostgreSQL is better in all of these."

Me too.


Robert A. Nogueira de Oliveira


Tribunal de Justiça do Estado de Sergipe
Graduando em Sistemas de Informação - UNIT
MSN: [email protected]

“Ausência de evidência não é evidência de ausência.” (Carl Sagan)

On Saturday 18 April 2009, Michael S. wrote:

On Friday 17 April 2009, Bill S. wrote:

This sounds ridiculous to me, but if I’m missing something, I would
love to hear some opinions. Is there an issue with support for
Ruby+Postgres?

I much prefer PostgreSQL over MySQL.

Some other points you might want to check if you compare these two:

  • Behavior under concurrent accesses: Transactional isolation, locking.
  • Transactional changes to the DB structure.
  • Performance with many joins.
  • Changing the structure of (large) existing tables.

In my experience, PostgreSQL is better in all of these.

Michael


Michael S.
mailto:[email protected]
http://www.schuerig.de/michael/

Robby R. wrote:

PostgreSQL +1

I was scrolling down, waiting for Robby to chime in, then I find this-
c’mon, Robby, I expected more PASSION! :stuck_out_tongue:

  • Danny

Hassan S. wrote:

So if someone knows MySQL well, s/he may not want to put the time
into learning the gotchas of another DB. I would charge more just to
cover the aggravation of using Postgres’s god-awful command line
tools. :slight_smile:

I Guess you’ve never found PgAdmin then :slight_smile:

Cheers,
Gary.

On Sat, Apr 18, 2009 at 12:35 AM, Gary D. [email protected] wrote:

So if someone knows MySQL well, s/he may not want to put the time
into learning the gotchas of another DB. I would charge more just to
cover the aggravation of using Postgres’s god-awful command line
tools. :slight_smile:

I Guess you’ve never found PgAdmin then :slight_smile:

I have – it doesn’t appear to be a command-line interface. Or is
there a way to invoke it in a non-GUI mode?


Hassan S. ------------------------ [email protected]

On Fri, Apr 17, 2009 at 10:43 AM, Bill S.
[email protected] wrote:

We have gotten push back from contractors, who have said, “If it’s not
MySQL, I wont bid on it.” I am not a Ruby Developer (IANARD), but I
would like to know if there is an issue with using Ruby + Postgres.

One thing to consider is that the idea that ActiveRecord just magically
insulates the developer from understanding the underlying database
is wishful thinking, once you get past your basic ‘hello world’ app.

So if someone knows MySQL well, s/he may not want to put the time
into learning the gotchas of another DB. I would charge more just to
cover the aggravation of using Postgres’s god-awful command line
tools. :slight_smile:

But personally, I’m database-agnostic – right now I’m working on a
JRuby/Rails/Oracle app.

Ultimately, it’s “run what ya brung” :slight_smile:

FWIW,

Hassan S. ------------------------ [email protected]

I have been working MySql and Postgres for web applications(I am
talking about Rails applications of course ) and both work well.
From my point of view Postgres is more powerful and I prefer work with
this for my development if there is not any rule which limit me for
some good reason


Gnu/Linux count user #416024

Pagina personal : http://www.cesardiaz.com.ar
Mi blog : http://cesarediaz.blogspot.com
Twitter : http://twitter.com/cesarstafe
Github repository: cesarediaz (Cesar Diaz) · GitHub
Skype: cesarstafe

Hassan S. wrote:

Sorry, I thought you were saying that postgres tools were only
command-line.

What’s wrong with psql, pg_dump, pg_restore, pg_ctl etc.?

What does mysql have in the way of command-line tools that postgres
doesn’t?

I pretty much always use PgAdmin unless there is no alternative, or when
I need postgres tools in scripts. For ad-hoc management of servers I
normally use PgAdmin remotely.

Cheers,
Gary.

On Saturday 18 April 2009, Hassan S. wrote:

On Sat, Apr 18, 2009 at 7:50 AM, Gary D. [email protected] wrote:

What’s wrong with psql, pg_dump, pg_restore, pg_ctl etc.?

What does mysql have in the way of command-line tools that postgres
doesn’t?

It’s not that there are /different/ tools, it’s that the postgres
versions seem awkward, clumsy and unhelpful compared to mysql’s.

Somehow it’s the other way round for me. With the the PostgreSQL command
line tools, notably psql, I have tab completion when I invoke them and
inside the tool itself, where I also get extensive help. I don’t seem to
get tab completion with the mysql command. From my experience, your
accusation of the PostgreSQL tools being “awkward, clumsy and unhelpful”
appears to be unsubstantiated.

Michael


Michael S.
mailto:[email protected]
http://www.schuerig.de/michael/

On Sat, Apr 18, 2009 at 7:50 AM, Gary D. [email protected] wrote:

What’s wrong with psql, pg_dump, pg_restore, pg_ctl etc.?

What does mysql have in the way of command-line tools that postgres doesn’t?

It’s not that there are /different/ tools, it’s that the postgres
versions
seem awkward, clumsy and unhelpful compared to mysql’s.

I’m sure you’d get used to them if you had to, like anything else. But
the experience is not particularly pleasant.

YMMV,

Hassan S. ------------------------ [email protected]