Live data from Hacker News

MySQL - Do Not Pass This Way Again

grimoire.ca

61–70 of 164 posts

Re: MySQL - Do Not Pass This Way Again

#61
post #56

Earlier quoted context omitted.

You're right, offering a solution to MySQL problems in a thread is generally useless. I don't really get what point the author is trying to make. I also don't take detailed performance advice from people who can't keep a blog up. Yeah, must be the wrong backend.

How could you possibly not get the point? It's the first two (2) sentences "Considering MySQL? Use something else."

I use MySQL and Postgres, depending on the project.

What other option is so obvious that you can't even name it?

Re: MySQL - Do Not Pass This Way Again

#62
post #50

This is a great article. But I really wish it had sources for each of the claims. I would be interested to read the relevant documentation, because some of these directly describe problems I've had with running a Wordpress installation. And I've been blaming Wordpress for it. There's possibly a big mea culpa brewing; but I'd really like to look at the specifics.

Oh just blame Wordpress. My self-written software has no performance issues on MySQL, but Wordpress loading times are over two seconds with a default installation.

> Oh just blame Wordpress.

I usually do. But in this case it looks as though MySQL's underwhelming query planner might be at fault.

Re: MySQL - Do Not Pass This Way Again

#63

This person doesn't even offer a solution? How is it that people who have blogs that take 30 seconds to load continue to give performance advice that gets upvoted? The funny thing is that this blog's performance is based on some cookie. If I reload in Chrome? 2 sec. If I reload in "Incognito Chrome", it's again really slow. So seriously, just stop with these authoritative blog posts when you don't even know what you'…

It's not performance advice, though. It's a list of known problems with MySQL, most of which violate the "Principle of Least Surprise". Some of the problems have performance implications. The query planner stuff, for example. > The funny thing is that this blog's performance is based on some cookie. If I reload in Chrome? 2 sec ... just stop ... when you don't even know what you're talking about. It may interest you…

If you have to be a jerk about it, it may interest you that relatively static blog content can be cached on the server.

I'm genuinely interested to learn which use cases are more dependent on query planning than caching methodologies.

Re: MySQL - Do Not Pass This Way Again

#64

Earlier quoted context omitted.

No, it's not. If you're going to be a performance authority about web technology, you should know how to configure the open-source and very well-documented code you are using.

I don't see how using Apache, with what I guess are the default settings, has any bearing on remarks about MySQL.

didn't say anything about apache, so not sure what you're complaining about.

Re: MySQL - Do Not Pass This Way Again

#65

Earlier quoted context omitted.

It's not performance advice, though. It's a list of known problems with MySQL, most of which violate the "Principle of Least Surprise". Some of the problems have performance implications. The query planner stuff, for example. > The funny thing is that this blog's performance is based on some cookie. If I reload in Chrome? 2 sec ... just stop ... when you don't even know what you're talking about. It may interest you…

If you have to be a jerk about it, it may interest you that relatively static blog content can be cached on the server. I'm genuinely interested to learn which use cases are more dependent on query planning than caching methodologies.

> relatively static blog content can be cached on the server.

If you poke around, you'll find that this isn't a Wordpress installation. (Or any other dynamic blog engine, for that matter.)

It's Markdoc[1], a static site generator:

> Markdoc converts wikis into raw HTML files and media ... Markdoc need not be installed on the hosting site, since the resultant HTML is completely independent.

I believe the program at fault here is Apache, which in the default configuration loves nothing better than to choke on child processes.

[1] http://markdoc.org/

Re: MySQL - Do Not Pass This Way Again

#66

Earlier quoted context omitted.

I don't see how using Apache, with what I guess are the default settings, has any bearing on remarks about MySQL.

didn't say anything about apache, so not sure what you're complaining about.

See my other reply for why I brought Apache into the discussion.

Re: MySQL - Do Not Pass This Way Again

#67
post #9

I appreciate this well-argued piece of persuasive writing for not choosing MySQL, but the premise is surprising -- I don't recall seeing, on Hacker News or elsewhere, any writeups from companies that chose MySQL then ran into significant problems they had to architect around, nor writeups from companies that chose MySQL then had to rip everything out to switch to something in the same family of solutions (Postgres, O…

I worked at a large startup that was trying to migrate from MySQL to Postgres because of how long table migrations take on MySQL. There's a tendency for adding a column in MySQL to a table to be stop-the-world for the whole server, and it can take hours. They had some pretty serious workarounds for that, and some of them were "try to never change the database structure". There was some thought that there were other p…

try to never change the database structure works pretty well. For all other cases, the easiest solution requires that you have a good redundancy system in place, and some extra planning. But basically run alter table without replication on your out of rotation slaves and masters, and then swap. Depending on your backup situation, you could probably just run the alter table on your backup systems and then restore from then.

Yes, alter table is inconvenient, but how often are you updating your schema and how often do you use it? In my experience, once major development was done (which is usually before there's a large amount of data in the tables), schema changes are rare, but queries are very common.

Re: MySQL - Do Not Pass This Way Again

#68

Earlier quoted context omitted.

It's not performance advice, though. It's a list of known problems with MySQL, most of which violate the "Principle of Least Surprise". Some of the problems have performance implications. The query planner stuff, for example. > The funny thing is that this blog's performance is based on some cookie. If I reload in Chrome? 2 sec ... just stop ... when you don't even know what you're talking about. It may interest you…

If you have to be a jerk about it, it may interest you that relatively static blog content can be cached on the server. I'm genuinely interested to learn which use cases are more dependent on query planning than caching methodologies.

> I'm genuinely interested to learn which use cases are more dependent on query planning than caching methodologies.

I'll reply to this separately, it's a good discussion to have.

My basic problem is that caching comes with a coordination cost and I prefer the originating data source to be as performant as possible.

My own use case is a small Wordpress multisite installation. Even with a relatively trivial amount of traffic and site data, it behaves abysmally on some simple requests. The linked article seems to explain why -- the query planner ignores indexes on certain kinds of joins. The same sort of joins as the Wordpress Recent Comments Widget.

Now, I can and have worked around this by using multiple layers of caching. There's the MySQL query cache, some memcache (PHP opcode caches would in theory be quicker but I've never been satisfied with their stability) and of course pumping gzipped HTML to disk for nginx to serve directly without hitting PHP or MySQL.

But like I said, caching comes with a coordination cost. One of my sites is used less like a blog and more like a chat room. Hundreds of comments per hour, every single one of which causes the query cache to be pruned of the exact query I most need to cache in the first place.

That is: I need to cache this query because they talk so much. But they talk so much that the cache is not that helpful.

What would be helpful is if MySQL was a bit smarter about using the indexes I put there in an apparently useless bit of chicken-waving.

Re: MySQL - Do Not Pass This Way Again

#69
post #8

This looks similar to the MongoDB FUD from a year or two ago. Nevertheless, I don't like MySQL and prefer PostgreSQL for all my projects.

That's a detailedand well documented article sir. Nothing like FUD.

Using a documented interface and claiming it's inherently unsafe...

try{System.out.println(5/0);}catch(ArithmeticException ae){}

NOTHING HAPPENS OMG.

Exactly like FUD.

Re: MySQL - Do Not Pass This Way Again

#70
post #10

MySQL is the visual basic of SQL databases. Anyone can set one up and use it. The problem is that many non-technical people use MySQL and then think they know all about DBs. Ask them what ACID is, or about foreign key constraints. You'll get blank stares. If you know what those things are and value them, you probably don't use MySQL.

Can you provide some citations to this claim? I know a lot of people who understand ACID, Foreign Keys, and have experience with other DBs (like PostgreSQL) and still often choose MySQL based on its merits.

I think he is talking about "people who use mysql only because it was the easiest thing to learn" don't know these things, not "experienced DBAs/devs who happen to be using MySQL".
Post reply on HN