How to migrate data from mySQL to PostgreSQL?

What is recommended between MySQL and PostgreSQL for a web startup planned for heavy social + user interactions?

  • We are building the app using Rails on MySQL but PostgreSQL seems to be the DB of choice on Heroku for Rails apps. What will we miss if we don't stay with MySQL? Our data is mostly text but both writes and reads are expected in high numbers. How are the differences in terms of cost, performance, scalability and security?

  • Answer:

    MySQL handles huge numbers of connections (thousands) more gracefully than Postgres. Note that this has nothing to do with transaction rate but rather with launching large numbers of processes with large connection pools. A proxy like pg_bouncer can mitigate the situation (if you're doing lots of long running transactions from your web app you're cruising for disaster, anyways). This happened a lot in Ruby 1.8 days because threading in-process was not really viable outside of JRuby. But think about what you gain with Postgres: subsecond timestamps, sensible defaults, great completion in the SQL console...

Jason Dusek at Quora Visit the source

Was this solution helpful to you?

Other answers

The benefit of choosing MySQL is that it has been battle-tested more than any other database out there. PostgreSQL is great, don't get me wrong, but MySQL has been used by the likes of Facebook and even Quora uses MySQL. It has been used and abused to far greater lengths than PostgreSQL has. Choose the database you are comfortable working with, for most that would probably be MySQL. In terms of your questions: * Finding someone with experience tuning and scaling MySQL is going to be easier and more cost effective * Scaling MySQL is somewhat easy in the right hands of a capable database engineer * Security is good provided you are filtering and validating input before inserting it, otherwise regardless of database you're going to have a problem if you blindly insert

Dwayne Charrington

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.