In our prior compare -- we compared PostgresQL 8.3/PostGIS 1.3-1.4, SQL Server 2008 and MySQL 5+ (now owned by Oracle). Many people would have preferred seeing Oracle or IBM DB2 in the mix since few use MySQL seriously for spatial work. So by popular demand we are replacing our compare of MySQL with that of Oracle. A couple of exciting things have happened since that last comparison.
In this new comparison, we'll be comparing the geodetic support offered by these three commendable spatially enabled DBMS as well as standard OGC planar geometry support. Oracle, you will notice, we will compare a bit differently because Oracle splits their product slightly differently than PostGIS and SQL Server.
So in short -- we will have 6 columns (because we are really comparing 6 things - two for each product) and we will not be going into the additional items Oracle throws in their Oracle Spatial version - e.g GeoRaster, advanced 3D support, Topology and Network support, Drive time etc.. We have no idea how good those features are. We will say that the PostGIS WKT Raster project offers similar raster analytic functionality provided by Oracle GeoRaster and ArcGIS server. It already has quite a bit of functionality now and can be used alongside PostGIS 1.4- upcoming PostGIS 2.0.
Most of this information is gleaned from the help docs and our general understanding of availability of tools as well as our familiarity with each product.
Full Disclosure -- Regina is on the PostGIS project steering committee. Leo and Regina, Co-founders Of Paragon Corporation, are writing a book PostGIS in Action due out later this year (2010). Paragon Corporation makes most of their profit doing SQL Server consulting (more than 40%) but most of a non-spatial nature - Financial applications, Web applications with SQL Server backends and BI reporting. Paragon Corporation makes a modest income doing PostgreSQL consulting and most of it on spatial database consulting using PostGIS. Paragon Corporation makes no money doing Oracle consulting, but makes a good chunk of change doing MySQL consulting against PHP web app front ends, which hmm is now owned by Oracle. We will try earnestly not to let our party lines get in the way, but we may slip.
We shall note that in terms of affordability vs. functionality, for most common spatial use cases, I think most would agree PostGIS and SQL Server 2008 are the front-runners. Oracle has a lot of bells and whistles that PostGIS and SQL Server lack, but much of that bell and whistle you can only tap into if you are using Oracle Spatial which requires an Oracle Enterprise license + Oracle Spatial License($$$$$). PostGIS has more advanced processing functions than SQL Server 2008 or Oracle Locator, but doesn't have tight of integration with Microsoft's large SharePoint, Microsoft CRM, MapPoint offerings much of which is thrown in for free if you have a windows server. On the Oracle side -- presumably if you are running a PeopleSoft or Oracle Financials and had a need for spatial support, it may be easier with Oracle database. That is pure speculation of course.
It has been claimed by several Oracle folks who have used PostGIS, that PostGIS aggregate union functionality is much better than Oracle Spatial's, or at least in prior versions of Oracle, which some have complained was slow vs. same data set in PostGIS before cascaded union implementation (afer though we have no links to point to, same dataset in PostGIS after cascaded union 1.4 is on par with ArcGIS (under 1 second). Note the new Oracle 11G R2 set union works with arrays of geometries similar in concept to the PostGIS ST_Union(geom[]) overloaded array version of spatial aggregate union and its unclear how much faster this new unioning is compared to prior Oracle Spatial AGGR_UNION. To be fair to Oracle Spatial -- it must be noted that when using a long lat based spatial ref, it does use a round earth model instead of treating it as planar as do PostGIS and ArcGIS. What is for sure is that if you haven't shelled out the money for Oracle Enterprise and Oracle Spatial, Oracle still doesn't think you are worthy enough to do a union or intersection of any kind at all even in the 11GR2 offering, so the discussion is kind of moot if you are using Oracle Locator.
As relational and spatial database consultants, we don't consider any of these database products as an either or proposition. All support ANSI-SQL constructs fairly nicely and in a standard way. All treat spatial types as first class database citizens and with fairly recognizable OGC SF SQL syntax and function names. Though the spatial queries you will write in each are slightly different, if you know one, you can easily understand another. They are all one big happy family of spatial relational databases with their occasional family bickerings that drive competition. Most importantly the knowledge you gain in one is fairly applicable to the others. Although spatial types are first class citizens in these databases, they do require special GIS knowledge to fully take advantage of them. You will find that PostGIS / SQL Server 2008 spatial / Oracle Locator (Spatial) consultants have more in common with each other than when you compare them to their other vendor specialists. For example an Oracle Spatial/ SQL Server 2008 spatial/ PostGIS consultant have more in common with a each other than they do with their Oracle RAC / SQL Server 2008 database mirroring or PostgreSQL replication consultants. They all walk the same walk and talk the same GIS lingo. All these databases have become so feature rich that there are numerous specialists focused on a particlular piece of the database product whether that be spatial, OLAP, tuning, replication, and then are generalists in thier non-specialties. In fact you will find many database spatial/GIS consultants highly skilled in the spatial component of all 3 database products.
Aside from what is there or what is missing in each in spatial, there are other reasons to pick one over the other or pick more than one:
Why would you ever want to pick more than one. You may if you have for example an internal network that runs entirely on SQL Server and ties in with things such as Microsoft CRM or Microsoft Sharepoint or Microsoft Reporting Services (now with the better R2 spatial support) that can talk most easily to SQL Server. SQL Server and Oracle Locator lack some of the advanced processing functions PostGIS provides and have fewer free and about the same number of proprietary priced tools to export data out of it than does PostGIS. As such you may want to use PostGIS to process data that SQL Server/ Oracle Locator don't have built in functions for and have communication channels that transport data back and forth between the 2. The processing costs of SQL Server and Oracle are also more prohibitive as you pile on more and more processors and memory to service your traffic. As such you may prefer to use PostGIS for your front-facing customer service traffick to build webservices that all freely available citizen tools can use and SQL Server/Oracle for your internal needs and to service your existing Oracle/SQL Server bolted applications. You can save quite a bit of money easily by using PostGIS/PostgreSQL or by adding it to your existing arsenal of tools. Why buy another Oracle server to service your DMZ traffic when you can have a free PostGIS/PostgreSQL/EnterpriseDb with similar functionality and speed with very little learning curve.
We don't consider speed much of a deciding factor, since its too open to interpretation and all databases with enough processors (3 or more), fast disks, and well tuned tables structures and indices can handle terrabytes or more of spatial data and achieve results in under 5 seconds or less for most garden variety spatial queries. From experience with these databases and other experiences we have read from people who work day in and day out with these, there is no clear cut speed winner that someone can't easily argue against or for and say -- what if you tried this workload or tweaked this parameter or compare on servers having 10 core duo processors with gazillions of ram for this workload and arguments if what workload is really realistic for common use cases. In theory (though don't have a workload to prove in practice) - for queries that can benefit from a high-degree of parallelism and where you have a machine with several processors, both Oracle and SQL Server should beat out PostgreSQL because PostgreSQL plain vanilla planner doesn't currently support parallelism strategies (note there are add-ons like GridSQL that change this). However, for servicing a lot of queries at once, which is general use case particularly for web traffic -- the playing ground levels and falls on the side of PostgreSQL which can use as many processors and memory your OS can allocate to service all queries without the additional arbitrary limits on memory and processor artificially enforced by Oracle and SQL Server.
We will parrot some anectdotal comments we have heard:
Now on with the show.
Now for this section, we can't really itemize all the functions of each offering. We will just focus on the functions we consider most commonly used in spatial analysis, web applications and geoprocessing. For this section we are treating SQL Server 2008 and PostGIS as two products because functionality available for their planar (Geometry) is not the same as functionality available for their Geography. In theory you can convert between the 2 types by using the GeomFromWKB and AsBinary functions that each type provides if they have the same SRID, but without Transform function support (that SQL server 2008 still lacks built-in), this is of limited use in SQL Server.
As mentioned we are treating each as two separate products.
Del.icio.us | Reddit | Digg | BlinkList | Furl Spurl | Simpy
This Document is available under the GNU Free Documentation License 1.2 http://www.gnu.org/copyleft/fdl.html & for download at the BostonGIS site http://www.bostongis.com