Skip to content

Instantly share code, notes, and snippets.

@rvbhute
Created February 4, 2018 04:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rvbhute/c0edfe02aeb6350e116bbc140274811b to your computer and use it in GitHub Desktop.
Save rvbhute/c0edfe02aeb6350e116bbc140274811b to your computer and use it in GitHub Desktop.

Reasons for moving to from MySQL to PostgreSQL

  • Anecdotal - overall better DB out-of-the-box. Yes, MySQL can be made strict by tuning its settings but it is still catching up.
  • Character collation. Multi-lingual and emoji content necessitates UTF8. In MySQL, the "true" UTF8 is UTF8-MB4. We stumbled on this. PostgreSQL's collation is set to UTF8 OOTB and we had no surprises getting our content in and out.
  • Setting collation to utf8mb4 emits an index key length issue in older versions (n-1, n-2, etc.) of MySQL (as of 2017-18). These versions are the default in various Linux distros. To circumvent this, we had to limit indexed string columns to a specific length - which is not ideal. No such issues in PostgreSQL.
  • We needed the array data type (available in PostgreSQL) in one of our projects, and it was indexable too! PostgreSQL's JSON data type was also better than MySQL's.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment