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

- 986
- 1
- 11
- 15
-
Add to this discussion - managing DB2 is a royal PITA (and I don't mean Mediterranean flatbread) compared to SQLServer. SQLServer's error messages are clear, and the operations are simple to perform. Refreshing a test environment from a backup of production requires six mouse clicks, compared to navigating the arcane syntax of db2 restore and db2 Rollforward commands. Remember to count the ongoing cost of people to manage the databases – pojo-guy Jan 13 '17 at 20:46
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

- 5,252
- 22
- 32
-
Fred: My customers are looking to go for a machine with more that 2 GB RAM. I think this is the barrier with the existing DB2-Express C edition? Secondly, DB2 help in communities doesn't arrives so fast as compared to SQL Server and Oracle. – RKh Oct 29 '10 at 06:57
-
DB2 Express-C can run on servers with more than 2GB RAM, but the DB2 instance will only be able to use up to 2GB of the available RAM. This limit can be doubled by upgrading to the FTL, with also allows the use of more CPU cores and replication to a local or remote DB2 database. DB2 has a thriving community in several areas, including the DB2-L mailing list at IDUG.org and presentations from previous techical conferences. IBM developerWorks is another excellent resource for exploring specific features that the manual may not fully explain. – Fred Sobotka Nov 01 '10 at 04:40
-
Please mention the ability to use .NET routines in DB2 LUW and I'll upvote your answer. – Johann Blais Mar 14 '12 at 17:25
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.

- 2,406
- 5
- 32
- 40
-
1Really disagree on the .Net integration. I use analytical (risk) CLR functions in the db, that take 2 seconds to find results over some 10 million rows. Doing that in tsql or outside of SQL would take minutes to hours. For computationally intensive functions the performance increase of .net inside sql is huge. For big data analytics SQL is I think the best. – gjvdkamp Sep 14 '13 at 09:36
-
@gjvdkamp: "* SQL is I think the best*" - Postgres (like every other relational database) also uses "SQL" – Aug 29 '19 at 18:57
-
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).

- 18,873
- 12
- 63
- 78
If you are a .net shop stay with SQL Server.
Using any other database platform would require non-Windows to get the best out of it. On Windows, SQL Server is king simply because MS own both OS and SQL Server (Like Oracle/Red Hat).

- 422,506
- 82
- 585
- 676
-
3Maybe Oracle/Sun/Solaris (software/hardware/OS), but not Oracle/RedHat, Oracle doesn't own RedHat. – Pascal Thivent Jul 09 '10 at 23:26
-
@Pascal Thivent: at the time I posted, Oracle didn't own Sun. And Oracle has preferred Linux http://www.orafaq.com/wiki/Linux. – gbn Nov 03 '11 at 10:29
-
2The fact that SQL server only works in Windows, it does not mean that it is the best over that OS. Take a look at the TPC in order to see the best performances, and we can see some Oracle and DB2 over Windows. At the same time Oracle can run good in AIX, so your criterion is not convincent. http://www.tpc.org/tpch/results/tpch_perf_results.asp?resulttype=noncluster&version=2%¤cyID=0 – AngocA Nov 04 '11 at 08:36
-
At the time, SQL server only worked in Windows. Lets see what vNext SQL Server technology brings us. And how we can abstract the OS through Docker. Of course, don't discredit DB2 and other technologies. – TamusJRoyce Mar 09 '17 at 17:54