6 ms·
Or better, more solid relational options like Postgres... Honestly, is there any reason to use MySQL over Postgres at this point? Or is it sort of six of one h
by calinet6 12y ago
Or better, more solid relational options like Postgres...
Honestly, is there any reason to use MySQL over Postgres at this point? Or is it sort of six of one half a dozen of the other as long as the data model is decent?
- btown 12y agoMySQL historically had more support for HA/clustering than Postgres. Recently, there's been a lot of progress on integrating Postgres clustering into the core, to the point where it's mature, but perhaps not as battle-tested. Not a reason to choose MySQL for a startup, I think, but if you've got a cluster working on MySQL and a clear understanding of its pitfalls, there's no real reason to switch to Postgres.
- calinet6 12y agoThat makes sense, thanks. I guess as long as you have a reasonably optimized relational database of a given class, you're going to be about on the same order of magnitude of performance.
- markwatson 12y agoWe chose MySQL where I work only because it's easier to hire people with a lot of MySQL knowledge. Technical reasons aren't the only ones when deciding what software/framework/libraries to use.
- yangyang 12y agoThat can work both ways though. Sometimes if you chose a less popular option it can make it easier to find outstanding candidates.
- vtal 12y ago1. Monitoring and administration tools for MySQL are (better?) more polished. 2. WAY easier to find MySQL DBA's vs. PG DBA's 3. More resources in general around MySQL. Whatever problem/issue you have it's out there already.
- otterley 12y agoOne minor reason I noticed recently is that you can't change Postgres' listen(2) backlog. This can have a significant impact on responsiveness.
- barosl 12y agoI guess using a connection queue is preferable? (Although it complicates the software stack a bit.)
- d4mi3n 12y agoTooling. While I agree psql tends to be more performant, when you're dealing with groups of people having good tools (and good documentation for those tools) trumps many considerations. As an example, the organization I work at is considering a move to psql, but our main barrier is a lack of good DB clients that are accessible to people who aren't software developers. The best we're aware of as far as DB GUIs for Postgres is pgAdmin, whereas if we're talking MySQL you have things like MySQL workbench, SQLPro, and a myriad of other applications available for whatever your operating system of choice is.
- samlambert 12y agoThere are a lot of reasons IMO. MySQL has a proven track record for stability and performance powering huge sites. I would say MySQL has a nicer replication story as well. In general MySQL is a lot more widely used with a greater pool of knowledge out there.
- erkkie 12y agoNicer replication story? Try recent postgres with wal shipping + wal streaming;)
- Alupis 12y agoMariaDB is a drop-in replacement for MySQL, is made by the creator of MySQL (after he left Oracle post-Sun acquisition), has more features and is now generally considered the upstream of MySQL. I also bet Monty is more receptive to working directly with your teams to scale the product or make changes as necessary.
- collyw 12y agoMySQL is like PHP, its installed almost everywhere, and requires less set up. I did have one problem recently where MySQL turned out to be a better solution, as it has a native bitcount operation, and a larger set of numerical types.
- erkkie 12y agoAfter Postgres got replication out of the box I'm pretty sure it's just inertia and the fact that it's installed everywhere keeping mysql usage up. Postgres is so much nicer when dealing with day-to-day things. Eg disabling connections per database using sql and having built-in query stats (http://www.postgresql.org/docs/9.4/static/pgstatstatements.html http://www.postgresql.org/docs/9.4/static/pgstatstatements.h...) just made me smile.
- morgo 12y agoThe built in query stats is similar to Performance Schema in MySQL. The statistics are quite fine grained, and with a set of views on top (https://github.com/MarkLeith/mysql-sys https://github.com/MarkLeith/mysql-sys) are very useful for observability.
- erkkie 12y agoThanks, wasn't aware of that, quit mysql habits pre 5.6 :)
- morgo 12y agoTechnically, it was introduced in 5.5, but off by default :) 5.7 is going to be amazing for observability. Memory, transactions, stored procedures, replication, meta data locking and prepared statements are all instrumented in P_S.
- ksec 12y agoI thought it was more to do with Github is based on Rails, and MySQl is the default choice. Yes, I really wish DHH and the Basecamp team would move to Postgre , therefore moving the community to it.
- samlambert 12y agoI find it quite patronizing that you assume the only reason anyone would use MySQL is that it is the default choice.
- yangyang 12y agoI think there is some truth in it though; that and the inertia it currently has. If you're picking up a framework, do you use the default database or try to do something non-default on top of what you're already learning?
- calinet6 12y agoGiven the needs of most applications (which don't press either database's capabilities whatsoever), that really is probably the main reason.
- Alupis 12y ago>I find it quite patronizing that you assume the only reason anyone would use MySQL is that it is the default choice. Really? Defaults are supposed to be sane and the best-fit-for-most-common-scenarios... so it's a little patronizing to automatically assume your project is just so special that defaults are not good enough. Defaults should be good enough until they have been proven to not be good enough. Don't over-engineer your project.
- jeremykemper 12y agoSQLite is the Rails default, in fact. In October 2013, NewRelic reported that 53% of their customers are using PostgreSQL: http://blog.newrelic.com/2013/10/10/infographic-state-stack-ruby-edition/ http://blog.newrelic.com/2013/10/10/infographic-state-stack-... In July 2014, Planet Argon's Rails survey showed a surge in preference for PostgreSQL since 2012: http://rails-hosting.com/Results/2014/index.html#Database http://rails-hosting.com/Results/2014/index.html#Database Neither captures the distribution of usage from small- to large-scale apps, but it does look like the community has already moved both in mindshare and number of production deployments. I'd wager that Heroku's PostgreSQL default is responsible for much of that.
- cwyers 12y agoINSERT IGNORE and REPLACE are two pretty good reasons, in my opinion. Postgres also doesn't have real table partitioning. Yes, you can sorta kinda hack around the first with stored procs. And yes, you can do something that looks a lot like partitioned tables using table inheritance. And yes, Postgres now has replication support, if you don't mind using only row-based replication (MySQL lets you choose between row-based and statement-based replication) among other tradeoffs. So yeah, Postgres is a better relational database than MySQL, if you ignore all the things MySQL does better. Another great thing about Postgres is that whenever a site like Hacker News gets a thread about MySQL, you get a bunch of people asking why you aren't using Postgres instead, and then whenever you try and answer the question you get a bunch of Postgres users to tell you you're wrong or that the features you care about don't matter (or that they're hard to implement, which... this is my problem why?) or that Postgres really has replication that's as good as MySQL's this time we pinky swear. So most MySQL users get a first impression of Postgres' user community that is quite frankly rather unfavorable. Oh, and MySQL has a lot more third-party documentation, tooling and support available.
- calinet6 12y agoPerhaps it has something to do with having worked in the pg codebase for a time. It's clean as a whistle, I respect that a lot. But that's certainly not the whole picture.
- Alupis 12y agoI was surprised (and a little disappointed) they were not using MariaDB, as it's made by the creator of MySQL, has more features, and generally is considered "upstream" of MySQL these days... seems the MariaDB project would be more receptive to making changes and working with the Github team in order to scale.
- cwyers 12y agoI really don't want to get into a debate over the merits of MariaDB versus MySQL, as a lot of it depends on your workload. I investigated moving a MySQL application to MariaDB and some of the features we were using just weren't there yet, and I don't think all of them made it into the most recent release (but don't quote me on that -- I don't maintain that code anymore, so my memory could be hazy on it.) But the idea that MariaDB is "upstream" of Oracle MySQL is silly. Is Oracle even merging code from MariaDB?
- sjwright 12y agoI was planning to move to Postgres, until TokuDB went open source.