5 ms·
I don't know why anyone in 2015 would pick mysql when postgres is an option. Live postgres. So nice to work with. It's json support is amazing too
by philliphaydon 11y ago
I don't know why anyone in 2015 would pick mysql when postgres is an option. Live postgres. So nice to work with. It's json support is amazing too
- nchelluri 11y agoYou know what, about two weeks ago I was starting a new Rails hobby project, and I thought "all I've heard about for the past year is how everyone loves Postgres", and was about to throw it in there, when I saw a link to Google search trends comparing the two, and MySQL is still so far ahead: https://www.google.com/trends/explore#cmpt=q&q=mysql,+postgresql https://www.google.com/trends/explore#cmpt=q&q=mysql,+postgr... It's quite possible this is just due to people supporting existing applications, but I dunno, I am tempted to stick with MySQL for new stuff for the next little while.
- 0942v8653 11y agoIt seems weird to me that Postgres and MySQL are both going down. I'd expect interest in Postgres to be rising at the very least—what are people switching to?
- tracker1 11y agoProbably hosted SaaS offernings, some of which may actually be Postgres and MySQL... just there's less need for queries about operations issues. There's also a lot of NoSQL solutions that are being ever more widely used. Most of which have much lower costs for HA early on.
- steckerbrett 11y agoIs google trends really how you should be choosing your stack?
- UnoriginalGuy 11y agoChoose? I'd argue no. But inform your choice? Sure. Looking at trends can help you: - See how easy hiring people will be in the future. - See the likelihood that your chosen framework will lose support. - See the likelihood of third party support/addons/libraries/etc. - How easy it will be to find help/tutorials/guides/etc. But looking at it, to me, seems prudent.
- clessg 11y agoMySQL is popular because it's easy to use (in the same sense as PHP), easy to setup, and has a lot of tutorials written for it. Also speed used to be a pretty big factor, but that was only because MyISAM took shortcuts with data consistency. If you care about your data and would rather not deal with the many problems MySQL inevitably brings, then Postgres is the better option. I can't say I've seen many compelling reasons to use MySQL over Postgres other than "what if we need to replace you with a freelance PHP guy", "I want to pay lower wages", and "I want to use phpmyadmin". (Btw: check out Sequel Pro and Querious!) Popularity isn't a very good reason to choose something. Postgres will remain a juggernaut for a long time. Unless you really think there's a good chance you'll need to hire somebody that only knows MySQL, then I'd go with Postgres.
- tracker1 11y agoGiven I haven't done anything with it in nearly 7 years now.. but every time I've touched MySQL for anything, there was always a quirky behavior that bit me in the ass that no other dbms does... Postgres, MS-SQL, Firebird, Oracle, DB2 are all better options in my mind... unless you need a good replication story, without a pricey support contract, then Postgres and Firebird are sadly out of the running imho.
- spudlyo 11y agoThat may be why MySQL is popular for small installations, but that's not why it's popular with companies like Facebook, Google, Twitter, and Pinterest who run replicated clusters that number in the thousands. It's popular at scale because unlike Postgres, it has replication that is well understood, is reliable, and isn't a massive pain in the ass to operate.
- Jweb_Guru 11y agoPlease point me to the well-understood, reliable replication solution for MySQL (I'll agree about pain in the ass to operate re: Postgres, but you might want to check out aphyr's recent posts).
- kawera 11y agoOne of the reasons MySQL is still popular is Wordpress.
- cageface 11y agoAgreed. I consider MySQL a red flag and avoid any projects or teams that choose it over Postgres. Postgres is reliable, flexible, fast, and well documented. It's one of the crowning achievements of the open source world.
- UnoriginalGuy 11y ago> I consider MySQL a red flag and avoid any projects or teams that choose it over Postgres. I am in the "pro Postgres" camp, but this attitude is too black and white for me. For many projects Postgres in superior to MySQL, but there are situations and requirements where MySQL makes a lot more sense. For just one example, I can get MySQL as a service much cheaper and easier than I can get Postgres as a service. Which isn't to say Postgres as a service doesn't exist (it does), just to say MySQL is more readily available and there is more competition in that sector. Additional if I had a DBA who was a MySQL expert and didn't know a thing about Postgres, I'd go with MySQL for my project. Since a good DBA is worth their weight in gold, and an expert in a particular DBMS can be a massive asset to a project. But given no restrictions or needs, I'd pick Postgres as my "default" choice. I just don't think it is right to say you'd avoid a team/project just because they picked MySQL, sometimes there are completely legit reasons (or politics).
- zamalek 11y agoWhat I love about Postgres is how it's the only remaining innovator in the SQL space. It's like Microsoft and Oracle were circa 1999 (the last true innovation out of either was sparse columns in MSSQL). Genetic algorithms, the works. Everything else is mostly stagnant and archaic.
- lqdc13 11y agoDepends on your data. Sometimes (particularly when you have only 1-3 tables) MySQL is much faster and you have to go out of your way writing stored procedures to make Postgres compete. Example: select COUNT(1), status FROM some_table GROUP BY status ORDER BY status; -- Postgres 10x slower. Also, mysql CLI is IMO much nicer than the postgres version. Better and faster autocompletes.
- nimrody 11y agoRegarding CLI: mycli and pgcli are both much nicer than the built in alternatives.
- Jweb_Guru 11y agoI'd like to see your full setup for your claim about 10x slower, because I suspect you're doing something wrong.
- lqdc13 11y agoSure, here's the pastebin of the postgres one: http://pastebin.com/Phc8KnYU http://pastebin.com/Phc8KnYU I thought I was doing something wrong, so I asked on SO: http://stackoverflow.com/questions/32755348/group-by-count-query-takes-a-long-time http://stackoverflow.com/questions/32755348/group-by-count-q... This is a very simple example, but I always run into major performance issues with Postgres. Some of them are my fault, from not knowing that array aggregation is a slow operation. MySQL advantages for me are that there is an actual UPSERT operation (an inferior version of which might be added to Postgres 9.5), that the CLI is miles ahead, and that it's much faster for a small number of tables with a lot of data and with non-complex operations.
- Jweb_Guru 11y agoI'm going to ignore your baseless (and incorrect) assertion about "an inferior version" of UPSERT (MySQL's doesn't work properly except for the primary key). Your problem is that you are not doing an index only scan. The reason you are not doing an index only scan is, most likely, that the visibility bit is not set on the table. This is usually as a result of excessive writing to the table, but sometimes it is due to incorrectly tuned planner settings. Try setting your cpu_tuple_cost higher and/or cpu_index_tuple_cost lower. I have had to do this in the past to get index only scans to work. BTW, a quick way to force the issue is to SET enable_seq_scan TO off in psql. I would add, you should really upgrade to 9.4, as there were some performance improvements to aggregates.