Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

One main issue with MySQL replication is that the slave is single threaded. This can cause replication lag.

How does Postgresql handle replication? Does it (or add-on such as slony-I) allow multi-threaded slaves?

In general, what are the pros and cons regarding MySQl & Postgresql replication? I frequently hear that MySQL replication is better than postgresql replication. Is that a fair statement? How exactly is it better?

share|improve this question
till recently mysql replication was better because it was standard feature. similar question: – pQd Aug 7 '09 at 17:49
"till recently"? Did postgresql add replication as a standard feature recently? I looked at their most recent release 8.4 and I didn't see replication anywhere in there. – Continuation Aug 7 '09 at 19:04
postgresql 8.5 will have mysql-alike async. replication – pQd Jan 10 '10 at 13:17
up vote 3 down vote accepted

All replication that I'm aware of for Mysql and Postgres is single threaded. Multithreading replication is a very complicated problem to solve because you have to ensure that out of order updates do not effect the final data.

share|improve this answer

You can get it done (at least in PostgreSQL with slony or other addons) by splitting your data up in pieces and replicate them independently. But that really only works if it's made out of independent parts that you don't need transactional integrity between, because obviously it can't maintain that if you replicate it independently.

share|improve this answer

As of today the latest GA version of MySQL (MySQL-5.6) doSQL-5.6 in the sense that the parallelism happens by database. That means you will have only one thread working at one database. To turn on this feature you will need to set the option --slave-parallel-workers.

The next MySQL version 5.7 which is not GA yet, does support more multi-threading. That means you can have multiple threads operating on the same database in 5.7. In 5.7 you can choose the policy of multi-threading using the option --slave-parallel-type.

You can find details of these options in the docs: Replication Slave Options and Variables

Apart from these there are a bunch of other things that you can find in MySQL-5.7 namely: improved semi-synchronous replication, multi-source replication, group replication (labs feature) etc. You can look at all of these in detail on the blogs written by the engineers here:

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.