Live data from Hacker News

Why Quora uses MySQL rather than No-SQL

quora.com

41–50 of 60 posts

Re: Why Quora uses MySQL rather than No-SQL

#41
post #37
post #33

Earlier quoted context omitted.

> That's partly because Mysql always was more user friendly Examples? I started with Postgres and ignored MySQL from day one because of MySQL's deficiencies, and have had 0 problems learning what I needed in the years I've used it. Not to mention I can read a general SQL reference, or the standard, and the information actually applies. Unlike MySQL (quotation marks anyone?). > That said, overall Postgres is better, w…

There are a decent number of things for which I don't care if the data gets corrupted a bit over the long run. Performance is a much bigger consideration.

PostgreSQL has better performance on real-world, high-concurrency loads over multiple cores. MyISAM is slow on tables with lots of writers (table level locking). InnoDB is better, but PostgreSQL is even better. Supposedly MySQL 5.4 is going to fix this. Move into big queries with lots of joins, subqueries, using multiple indexes, and PostgreSQL starts to shine even more.

You can even turn on async commit (since 8.3), which sends a commit acknowledgement message back to the client before the transaction is fully committed, allowing sync clients to move forward. While this does allow a very small window of time where, if the power was pulled on a machine, you'd lose just that bit of data for the tenth of a second it wasn't written to disk. All the other data is safe though, unlike MyISAM's default fsync=off, which gives it all of it's "performance." PostgreSQL also has async network I/O support baked into the libpq driver, which, if the client is written properly, makes this unnecessary. Note that async commit can be set per-connection and toggled on and off.

Virtually all of the 7.x releases were focused on durability, and 8.x releases were focused on performance, culminating with 9.0, due out soon, which will bring the much-needed readable slaves. This is the final feature that will tip the scalability gap in PostgreSQL's favor.

There are is a situation where MySQL shines: read-only MyISAM tables with simple queries where joins are not used. Virtually all of the write concurrency and data integrity features as well as PostgreSQL's performance using multiple indexes and joins become unimportant at this point. MyISAM also supports compressed read-only tables, which are great for this situation. I'd have to ask myself why I wasn't using a simpler NoSQL solution at this point though.

Re: Why Quora uses MySQL rather than No-SQL

#43
post #37

Earlier quoted context omitted.

There are a decent number of things for which I don't care if the data gets corrupted a bit over the long run. Performance is a much bigger consideration.

PostgreSQL has better performance on real-world, high-concurrency loads over multiple cores. MyISAM is slow on tables with lots of writers (table level locking). InnoDB is better, but PostgreSQL is even better. Supposedly MySQL 5.4 is going to fix this. Move into big queries with lots of joins, subqueries, using multiple indexes, and PostgreSQL starts to shine even more. You can even turn on async commit (since 8.3),…

Yeah, MySQL could definitely be improved upon. The table-level write locking is a pain. I was just saying that 100% consistency/data integrity isn't really a major concern for a lot of applications.

I've thought about switching to Postgres, but it doesn't currently appear to be worth the pain in my case.

Re: Why Quora uses MySQL rather than No-SQL

#45
post #30
post #3

better yet, why isn't Quora using PostgreSQL? :)

I finally made the switch from MySQL to Postgres for my current product. The impetuous was licensing as I got burned by MySQL's ambiguous licensing on a prior product. Now that I have gotten over the learning curve I like Postgres about the same as MySQL. Both are good products but you can move Postgres from a Saas to an onsite deployment as needed without any licensing issues.

impetus

Re: Why Quora uses MySQL rather than No-SQL

#46
post #16

There's no need to burden yourself with making a system scale more than 10x further than it needs to, as long as you're confident that you'll be able to scale it as you grow. It should be noted that the 10x quote comes from Jeff Dean. Not only does it make sense from the business point of view, it's also nearly impossible to scale a system 100x: you simply have no idea what the traffic patterns and bottlenecks will b…

Jeff Dean (for those wondering): http://research.google.com/people/jeff/index.html

Re: Why Quora uses MySQL rather than No-SQL

#47
post #3

better yet, why isn't Quora using PostgreSQL? :)

Can't answer for Quora, but I know why I'm not: activation energy. My team and I know MySQL pretty well, and we can stand by our decision to use it. PostgreSQL we can't. It's not the most sound technical reasoning.

Postgres is easy to convert to from MySQL, if you keep that conversion cheatsheet handy. However, mastery of its performance quirks (all servers have quirks) can take years.

It took me 48 hours to convert to it, 10 months later and I don't feel like I know much about it.

Re: Why Quora uses MySQL rather than No-SQL

#48
post #43

Earlier quoted context omitted.

PostgreSQL has better performance on real-world, high-concurrency loads over multiple cores. MyISAM is slow on tables with lots of writers (table level locking). InnoDB is better, but PostgreSQL is even better. Supposedly MySQL 5.4 is going to fix this. Move into big queries with lots of joins, subqueries, using multiple indexes, and PostgreSQL starts to shine even more. You can even turn on async commit (since 8.3),…

Yeah, MySQL could definitely be improved upon. The table-level write locking is a pain. I was just saying that 100% consistency/data integrity isn't really a major concern for a lot of applications. I've thought about switching to Postgres, but it doesn't currently appear to be worth the pain in my case.

Locking in Innodb is row-level.

Re: Why Quora uses MySQL rather than No-SQL

#49
post #43

Earlier quoted context omitted.

PostgreSQL has better performance on real-world, high-concurrency loads over multiple cores. MyISAM is slow on tables with lots of writers (table level locking). InnoDB is better, but PostgreSQL is even better. Supposedly MySQL 5.4 is going to fix this. Move into big queries with lots of joins, subqueries, using multiple indexes, and PostgreSQL starts to shine even more. You can even turn on async commit (since 8.3),…

Yeah, MySQL could definitely be improved upon. The table-level write locking is a pain. I was just saying that 100% consistency/data integrity isn't really a major concern for a lot of applications. I've thought about switching to Postgres, but it doesn't currently appear to be worth the pain in my case.

Locking in Innodb is row-level.

Re: Why Quora uses MySQL rather than No-SQL

#50
post #21

I don't understand all these "why we're not using NoSQL" posts. Why is it interesting that someone choose the default choice? Why would they use a NoSQL database of some sort for a major project unless they actually had a need for it? I'm half expecting a "why we don't use Brainfuck"* post one of these days... *Not that I'm comparing any NoSQL database or NoSQL databases in general to Brainfuck, it's just that I don'…

I'm not 100% sure how Quora works but is this a post or an answer to a question that another person posted?

It's an answer to a question that someone else posted. I wouldn't have written it otherwise.
Post reply on HN