Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

DB2 vs PostgreSQL vs SQL Server [closed]

Has anyone used all three of these databases? What are your experiences with them? PostgreSQL looks pretty tempting for a project but I'm curious to learn more about it (We're a .NET Shop). I've also heard of quite a lot of people being satisfied with DB2.

like image 988
danmine Avatar asked Sep 03 '09 05:09

danmine


People also ask

Which is better SQL Server or PostgreSQL?

From the above comparisons, PostgreSQL trumps SQL Server in several scenarios. Not only is it open-source and free, but it also has several features that are easily available and can be implemented automatically, unlike Microsoft SQL Server. Moreover, PostgreSQL has a more suitable concurrency management system.

Is PostgreSQL outdated?

The PostgreSQL Global Development Group supports a major version for 5 years after its initial release. After its five year anniversary, a major version will have one last minor release containing any fixes and will be considered end-of-life (EOL) and no longer supported.

Is DB2 still used?

As a relational database, Db2 is still in use. While other database management systems have emerged, older institutions and industries continue to store their data on Db2. It also continues to release new versions.


4 Answers

I work in a very large organization that uses DB2 primarily on Linux (Red Hat). We have a number of large databases and have investigated moving to other RDBMS solutions, such as Oracle and SQL Server. I did a lot of work on the SQL server end of that.

We found that SQL server performs much better and requires less tuning than DB2, especially when tables frow larger than 1M records. HADR is also difficult and bulky, to say the least.

We found many differences between DB2 and SQL Server, and too many to list here. I was responsible for doing a lot of the engineering behind code conversion from one platform to another, and can't say I found anything in DB2 to be superior to SQL server, but did find many things I liked better about SQL server. Here are some off the top of my head:

  • Better selection data types in SQL Server, such as MONEY and SMALL MONEY.
  • Mixed character encoding in SQL Server. Some columns can be ANSI and others UNICODE (char and nchar, respectively). Setting this up in DB2 is neither straightforward nor easy.
  • Better tools in SQL server, mainly SSIS for ETL (As opposed to the insanely priced IBM Data Stage).
  • SQL server has more forgiving syntax. For example, you don't need semi-colons everywhere. Maybe just a personal preference but I found it much easier to code in T-SQL.
  • Many advanced features seem to work better in SQL server. For example, SQL server lets you do page-level compression, where DB2 is limited to row-level compression.
  • It was easier to tune SQL Server queries with the SQL Server IDE

There are more, but honestly I suggest that anyone who is considering one over the other should set both up and spend some time working with both systems. Right now it seems like SQL server is a better overall solution, but DB2 may one day take the crown.

Lastly, when dealing with data warehousing, SQL, SSIS, and SSAS made a much better solution than InfoSphere, DataStage, and DB2. I could write a whitepaper on it, but my suggestion here is to set it up on your own and spend a week or to playing with each solution. Microsoft's solution here was faster and cheaper than IBM's. I don't know of any other basis upon which to make a decision.

Platform shouldn't be an issue since databases generally run on their own machines, but there are always those "no microsoft!" and "no linux!" shops around. It's a shame, really. I'd recommend SQL server.

like image 177
Robear Avatar answered Sep 19 '22 17:09

Robear


As a DB2 person, I can offer a few details about what you could expect from running DB2 for Windows and developing .NET applications for it. The following details were current as of version 9.7, which was released in June 2009.

  • Drivers and API support for just about any Windows programming language and IDE, including .NET and Visual Studio extensions
  • A no-cost, production-ready database engine (Express-C) that has no database size limit and is the least restricted when compared to Oracle Express and SQL Server Express
  • A self-tuning database engine for Windows that automatically handles the sizing of several memory buffers that are critical to good performance
  • Rock-solid support for XML as a native datatype, handled by its own dedicated query engine that is optimized for XML's hierarchical nature. Queries can access any combination of XML and tabular data with any combination of SQL and XQuery expressions
like image 32
Fred Sobotka Avatar answered Sep 21 '22 17:09

Fred Sobotka


Avoid microsoft like the plague. Always push to use PostgreSql even on windows, way better support for developing applications for e.g. Java/Python and still has good support in .NET. Also of course is completely free which given the current license fees for SQL Server is nothing to be sniffed at even if you're a multi-million dollar company.

For the cost of 1 SQL Server license you are going to save £30,000 (say $40,000) or more - buy better hardware to run Postgres on and still have a net benefit.

As far as performance, really if this is such a massive issue we should not be using either DB2, SQL Server or Postgres anyway. The difference between the three is negligible for their design purposes.

Edit: On the .NET integration, actually this is really poor in SQL Server anyway, it does have more features than Postgres/DB2 admittedly but it's not really hugely advantageous over SSIS or stored procedures. I could see the main use case in my work as accessing classes and functions from a CLR .dll but then you're implementing logic in the database which may or may not be a good idea for you.

like image 28
Richard Todd Avatar answered Sep 23 '22 17:09

Richard Todd


If you're a .NET shop, and are either using a small database (i.e. Sql Server Express), or have the money for the full SQL Server, use it. SQL Server will perform better than PostgreSQL for most actions, and about the same as DB2.

PostgreSQL is fantastic if you need multi-platform support, are Linux-based, or need a free product that's not Microsoft.

I haven't used DB2 in over 10 years, other than running an in-house performance test vs. other databases (where it was about the same for a transactional database as Oracle/SQL Server, where were better than MySQL, PostgreSQL, etc).

like image 43
Beep beep Avatar answered Sep 20 '22 17:09

Beep beep