0

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?

3

3 Answers 3

3

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.

0

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.

0

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: http://mysqlhighavailability.com/

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .