Differences between PostgreSQL and MySQL developers for PHP

For a project in which most of the queries in the database will include requirements such as β€œinside the polygon,” I thought about choosing PostgreSQL with PostGIS instead of MySQL, which I used mostly. Mostly because PostgreSQL has more GIS features. However, I'm not sure how to evaluate this, and also cannot see the difference with the perspective of the PHP developer.

  • Does PostgreSQL support both PHP and MySQL?
  • Is PostgreSQL (SQL) query record very similar to MySQL?
  • Are there any caveats to consider when choosing PostgreSQL instead of MySQL?
  • Is PostgreSQL to determine the best solution when using GIS data?

I hope you guys can help me with this.

+6
source share
2 answers

Does PostgreSQL support both PHP and MySQL?

Yes. And perhaps even better, more PHP functions are available to make things very simple.

Is PostgreSQL (SQL) query record very similar to MySQL?

Yes, this is SQL. But you have more advanced features like Oracle and SQL Server.

Are there any caveats to consider when choosing PostgreSQL instead of MySQL?

PostgreSQL is not yet widely available on cheap hosting providers. But it is available.

Is PostgreSQL to determine the best solution when using GIS data?

MySQL is a joke when you need GIS queries, and PostGIS (functions and data types in PostgreSQL) is one of the best GIS databases available on the market.


Edit: Check out these two comparisons:

PostGIS has migrated to version 2.0 and PostgreSQL to version 9.1 with upcoming 9.2.

MySQL has only a few GIS functions and does not have performance; this is not a serious option for GIS.

+15
source

From a PHP point of view, if you use PDO , then - the constructor aside - your code can be quite an agnostic of the database.

0
source

Source: https://habr.com/ru/post/921030/


All Articles