Our latest article over at Database Journal is hot off the presses. Advanced MySQL Replication – Improving Performance discusses some of the best ways to improve the performance of your MySQL slave setup. If the slave is constantly getting further and further behind the master database, we discuss a number of techniques which may help you bring it under control.
One of my favorite MySQL configurations for high availability is master-master replication, which is just like normal master-slave replication except that you can fail over in both directions. Aside from MySQL Cluster, which is more special-purpose, this is probably the best general-purpose way to get fast failover and a bunch of other benefits (non-blocking ALTER TABLE, for example).
The benefit is that you have another server with all the same data, up and running, ready to serve queries. In theory, it's a truly hot standby (stay with me -- that's not really guaranteed). You don't get this with shared storage or DRBD, although those provide stronger guarantees against data loss if mysqld crashes. And you can use the standby (passive) master for serving some SELECT queries, taking backups, etc as …
[Read more]I was just talking to someone who backs up their MySQL servers once a day with mysqldump, and I said in a catastrophe, you’re going to have to reload from a backup; that’s some amount of downtime, plus up to a day of lost data.
And they said “We can just promote a slave, we’ve done [...]
I just finished reading the recently released 2nd Edition of High Performance MySQL by Baron Schwartz, Peter Zaitsev, Vadim Tkachenko, Jeremy Zawodny, Arjen Lentz & Derek Balling. I’ve posted a review here on Amazon.
Wow, that’s quite a list of authors, but when you look at the material, you see why. This book is a very indepth look at the MySQL server. Intended for the intermediate to advanced DBAs and developers who want to know the inner workings of the server, as well as how to use many of it’s advanced features.
For instance the chapter on replication was quite good. Given that you probably setup replication in five minutes, and are wondering weeks or months later why it’s not working, this chapter will give you …
[Read more]This post is SEO bait for people trying to scale MySQL’s write capacity by writing to both servers in master-master replication. The short answer: you can’t do it. It’s impossible.
I keep hearing this line of reasoning: “if I make a MySQL replication ‘cluster’ and move half the writes to machine A and half of them to machine B, I can increase my overall write capacity.” It’s a fallacy. All writes are repeated on both machines: the writes you do on machine A are repeated via replication on machine B, and vice versa. You don’t shield either machine from any of the load.
In addition, doing this introduces a very dangerous side effect: in case of a problem, neither machine has the authoritative data. Neither machine’s data can be trusted, but neither machine’s data can be discarded either. This is a very difficult situation to recover from. Save yourself grief, work, and money. Never write to both …
[Read more]Why are the best technical books also the thinnest? To make the case, I highly recommend the MySQL 5.1 Cluster Certification Study Guide In rack units, it’s a 1U; it fits nicely into my laptop bag; and if you’re considering implementing MySQL Cluster, it can save you a world of time.
Of course, if you get the book, you should consider the certification itself. There’s a legitimate debate about the usefulness of certification exams, but the MySQL 5.1 Cluster certification is a little more important than others for a couple of reasons:
1. In case you haven’t heard it by now, Cluster isn’t always the best fit. In many cases, an active/passive failover setup is a much more flexible and cost-effective approach. It’s not always a clear-cut decision. If you’re willing to make application changes …
[Read more]Michael Arrington of TechCrunch asks Twitter a few questions. I have only included a sample list below but you should read his blog post for all the questions:
- Is it true that you only have a single master MySQL server running replication to two slaves, and the architecture doesn’t auto-switch to a hot backup when the master goes down?
- Do you really have a grand total of three physical database machines that are POWERING ALL OF TWITTER?
- Is it true that the only way you can keep Twitter alive is to
have somebody sit there and watch it constantly, and then
manually switch databases over and re-build when one of the
slaves fail?
A 'yes' answer to any of these questions by Twitter would be
disturbing to say the least. However, …
Brian Aker has found general agreement with his post: "The
Death of Read Replication".
Arjen Lentz says "I
think Brian is right...", and Frank Mash confirmed: "what Brian says about replication, caching and
memcached is very true".
Just like Video killed the Radio Star it looks like
maybe Memcached killed the Replication
Hierarchy!
But of course, Brian and others are talking about replication
for scaling reads.
In my session on PBXT next week at the conference I will
be talking about how we plan …
Whew! I just finished a marathon of revisions. It's been a while since I posted about our progress, so here's an update for the curious readers.
It's been a while since I've written about progress on the book. I actually stopped working on it as much at the beginning of the month, because on October 31(st) I managed to finish a first draft of the last big chapter! Now I'm back to full-time work at my employer, and I'm working on the book in the evenings and weekends only. Read on for details of what I've been working on and what's next in the pipeline.