views:

744

answers:

5

Should I use for a web application Postgres or Oracle XE and why?

They are both available for free and for use commercially.

Why should I use one database over the other?

+3  A: 

Well, with Oracle XE, if you hit the limits, you have to either buy Oracle or migrate your entire application to a different database. With PostgreSQL, there are no limits, and the software is completely free and open-source.

kquinn
+3  A: 

A few things to be aware of if you choose Oracle XE:

  1. It will only use one CPU if you have a multiprocessor server
  2. It will only use up to a maximum of 1 gigabyte of memory
  3. It has a database size limit of 4 gigabytes for user data
  4. Only available for 32-bit Windows and 32-bit Linux

If those limitations aren't an issue for you and you like the Oracle approach then give it a shot, otherwise consider an opensource server like Postgres or MySQL, which have none of the aforementioned limitations.

If you do choose XE and then later find your requirements have changed, the next version up of Oracle is 900USD for 5 seats, and an additional 180 per seat. This is in fact a bit cheaper than MS SQL Server afaik.

There are some good reasons to choose Oracle, particularly if you're a Java developer e.g. you can write stored procedures in Java, and I think there's native support for Java web services. Ultimately however you need to weigh up the cost with the requirements of your application. MySQL and Postgres will allow you to scale your application without any cost (other than hardware obviously).

Bayard Randel
PostgreSQL also has support for Stored Procedures written in Java. Google "Postgres pl/java".
Jordan S. Jones
wow wasn't aware of that, very cool - thanks Jordan :)
Bayard Randel
Oracle XE does not support stored procedures in Java.
FerranB
I should have phrased it better, I meant to imply that there are good reasons for adopting Oracle as a whole, not just the free XE product.
Bayard Randel
A: 

What is your platform of choice? If it's Windows, I'd go with Oracle or MySQL as I have heard only bad things about running PostgreSQL on Windows machines.

Also, Oracle has a more GUI apprach to configuration so if you're not a Linux hacker, you may like it better.

Postgres on the other hand has a way superior SQL console and console tools in general are more developed and easier to use. Oracle has more tools but the decent ares (like PL/SQL navigator) are not free and the free ones simply suck.

Remember that choosing a database is a long-term decision so consider the possible changes in requirements for your application as well. If you are not prepared to eventually spend money on Oracle, better go with Postgres -- safe option. And good enough for most projects.

michuk
"I have heard only bad things about running PostgreSQL on Windows machines" It did used to be a nightmare, but recent versions work great (I've set up 8.3 a couple of times now).
kquinn
This book made some initial experiments with PostgreSQL on Windows no more difficult than Oracle: http://www.amazon.com/PostgreSQL-Windows-Database-Professionals-Library/dp/0071485627
MattK
A: 

You haven't provided much information, but unless you're already an Oracle expert, I see no reason to choose Oracle XE over PostgreSQL. PostgreSQL will always be free and is far more capable and more scalable.

And you can choose to run PostgreSQL on Windows, Mac OS X or Linux. I think Oracle XE is limited to Windows and Linux.

Paul Lefebvre
A: 

when choosing a db vendor be careful to match the demands of your app against the strengths of the vendors' db product. And watch out for their weaknesses.

For example, if you know your writes will be as frequent as your reads and both will occur simultaneously, then you'll want to know how each vendor you consider handles concurency. Vendors that rely on elaborate lock managers with complex lock escalation schemes are likely to bring you grief if you expect heavy load on you app. You'll spend more time trying to work around the DB's lock manager than actually solving your problems.

That's one example. Every DB has its strengths and weaknesses to consider. Do your research, find a site that compares vendors and make a choice that balances your needs against that. If you can get an eval copy, all the better to run some proof of concept tests against. Write scripts that pummel the db in some similar to what you expect your app to produce and go from there. While your at it, get the query plans for the SQL in your scripts from each vendor and see what you can learn from that about how each vendor's optimizer works.

There's more that can be said, but hopefully you get the gist.

yetanotherdave