Ruby + Postgres = Bad Idea or Good Idea?

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 Schroeder 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.

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?

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

Hassan Schroeder 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?

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.

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,

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

Dude, don't get your knickers in a twist.

I made a comment, not an "accusation", and there's hardly anything to "substantiate" when we're discussing *opinions*.

You like the pg* tools, I don't. YMMV. Go and be happy. Geez...

There was just a podcast about this on SD Ruby.

http://sdruby.com/podcast/

I believe it is EP 55

Two small quibbles that I thought were just big enough to raise here...

I think we will stick with our current plan, and usePostgresql. In general, it makes me uncomfortable when developers refuse to use one tool or another.

It depends on the developer. Good developers know what they're talking about, and their preferences can often tell you a lot about a tool -- and about their development practices -- that you might not otherwise know.

In other words, if a developer has a *good* reason for refusing to use something, it may be to your advantage to find out what that reason is.

It shouldn't really matter. It's the architecture that really counts.

Perhaps, but in practice that's not really true -- details that are computationally trivial can make a huge difference to developer productivity. That's why we don't typically develop Web apps in C, although it can be and has been done.

[...]

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.

Yes, you have to *understand* the DB, but that often does not require changes to well-written code. I have written and maintained complex applications that were deployed on both mySQL and PostgreSQL, often simultaneously. ActiveRecord really *does* insulate the developer from a lot of DB-specific stuff -- if the developer is smart and writes DB-neutrally. (I just took over maintenance of an app where the developer didn't do that...)

And part of being "smart" is understanding the underlying DB well enough to know what's portable and what isn't.

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 never use the command-line tools, either with PostgreSQL or mySQL. I don't find either set to be very easy to use...that's what graphical admin programs are for.

(Maybe if I were a DBA, things would be different. But I just don't use the command-line tools often enough to remember syntax between uses.)

Best,

When you use *standard AR associations* -- no custom SQL at all -- and it runs on one DB and fails on another, I'd say you need to know a little more about those DBs. Wouldn't you? :slight_smile: