PostgreSQL vs MySQL
The two most popular open-source databases.
PostgreSQL:
- More SQL standard compliant
- Better for complex queries
- JSONB for semi-structured data
- Used at: Apple, Instagram, Spotify
MySQL:
- Faster for simple reads
- Easier to set up
- Popular with PHP/WordPress
- Used at: Facebook, Twitter, Netflix
Key syntax differences:
- String concat: || (Postgres) vs CONCAT() (MySQL)
LIMIT: Both supportLIMIT- UPSERT: ON CONFLICT (PG) vs ON DUPLICATE KEY (MySQL)
- Arrays: Postgres has them, MySQL doesn't
Both are excellent choices!
Check your understanding
What is PostgreSQL known for?