Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Can anyone suggest me which database to be used with OpenLayers? I have to store the values in a DB table and retrieve them (trivial tasks). which is better MySQL or PostGIS? Can anybody give benefits of these?

Thanks in advance

share|improve this question
add comment

3 Answers 3

up vote 8 down vote accepted

The bostongis comparison is not a really up-to-date document but it can be a good start, at least to see which aspects is a priority to you, and what you should consider as mandatory or optional to make your choices. The comparison is generic, not related to openlayers.

For your OL project, I guess you should also consider the DB availability from your hosting unless you have no constraint regarding this point.

From Postgis, you can natively export a query result as kml and json (and easily read it with OL), which is I think impossible with MySQL (you'll have a third party call to dynamically create it through any language..)

share|improve this answer
7  
+1 POSTGIS all the way! Forget SDE on top of any underlying DBMS. –  CaptDragon Mar 28 '11 at 14:05
add comment

Postgres with PostGIS everytime http://en.wikipedia.org/wiki/PostGIS

More Spatial Functions and control on the database in spatial terms

share|improve this answer
2  
MYSQL was hacked at the weekend - by SQL injection - theregister.co.uk/2011/03/28/mysql_hack –  Mapperz Mar 28 '11 at 15:27
add comment

If we are talking about Spatial Database, I would leave MySQL out: it is very much incomplete in respect with other OGC Simple Features SQL implementations like PostGIS (my favourite), Oracle Spatial, SQL Server Spatial or even Spatialite. Or ArcSde as a gateway to its supported RDBMS.

Please note, however, that you do not need to have a spatial database for using OpenLayers. You can feed OpenLayers with any Map Server that provides WFS/WMS/WCS etc... OGC web services implementations. For example if you are using MapServer, you will be able to feed OpenLayer with any vector layer supported by GDAL/OGR:

http://www.gdal.org/ogr/ogr_formats.html

Given your use case ("store the values in a DB table and retrieve them") I guess you need a WFS-T implementations: you may use GeoServer (with PostGis/Oracle Spatial or MySql) or TinyWFS (only GeoServer) for this.

Note that TinyOWS is going to be included soon in the MapServer project (actually MapServer does not provide WFS-T implementation).

share|improve this answer
    
Why would he need WFS-T support? WFS should be enough for read-only. –  underdark Mar 28 '11 at 18:00
    
he says: "store the values in a DB table and retrieve them" –  capooti Mar 28 '11 at 22:12
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.