
MySQL InnoDB Cluster GA - tpetry
http://mysqlserverteam.com/mysql-innodb-cluster-ga/
======
morgo
Hi! I'm a Product Manager for the MySQL Server. I don't specifically work on
InnoDB Cluster, but am happy to answer questions.

Let me start of by describing how the clustering works:

\- A cluster is 3+ nodes in a group, each with a complete set of data

\- When you say 'COMMIT' the server you are connected to certifies your write-
set with its peers (i.e. has anyone else tried to modify the same data). Once
the majority agree, the transaction is considered successful.

\- The distributing and certification of the transaction is synchronous, but
the applying of the transaction is asynchronous. Thus you actually retain
pretty good performance if the network latency is reasonable.

The performance question comes up a bit, so here's another post for more
context:

[http://mysqlhighavailability.com/an-overview-of-the-group-
re...](http://mysqlhighavailability.com/an-overview-of-the-group-replication-
performance/)

~~~
Willson50
Is it possible to get stale reads from non-primary nodes in a single-primary
setup?

~~~
morgo
In single primary the other nodes are put in a read-only mode so they can not
accept writes. So stale reads can not happen.

To expand on your question a little - the MySQL router currently works better
for single primary (it supports multi-primary but does not prevent stale
reads). If you go third party, ProxySQL also supports Group Replication
natively with multi-primary:

[http://lefred.be/content/mysql-group-replication-native-
supp...](http://lefred.be/content/mysql-group-replication-native-support-in-
proxysql/)

I was chatting to the author about this at FOSDEM - since it is possible to
keep track of nodes state by following GTIDs executed in the binary log
stream. I believe this is how ProxySQL is doing it, but it's possible the
final implementation differs :-)

------
stephenr
A relevant read for those who are considering this vs a Galera based solution:
[https://www.percona.com/blog/2017/02/24/battle-for-
synchrono...](https://www.percona.com/blog/2017/02/24/battle-for-synchronous-
replication-in-mysql-galera-vs-group-replication/)

------
tpetry
A fully automated HA solution is yet missing for PostgreSQL.

~~~
gshulegaard
[https://www.postgresql.org/docs/9.5/static/high-
availability...](https://www.postgresql.org/docs/9.5/static/high-
availability.html)

[https://www.citusdata.com/solutions/infrastructure/high-
avai...](https://www.citusdata.com/solutions/infrastructure/high-availability-
postgresql)

Edit: And before someone mentions "Citus" being "third-party" or "closed" or
some such: [https://www.citusdata.com/blog/2016/03/24/citus-unforks-
goes...](https://www.citusdata.com/blog/2016/03/24/citus-unforks-goes-open-
source/)

~~~
Zikes
There's also CockroachDB, which is wire-compatible with Postgres. Of course,
there are also some performance trade-offs to consider, and it is currently
missing many SQL and data type features available in Postgres and others.

~~~
the_duke
It's a completely different database, it just happens to support the postgres
binary protocol.

~~~
Zikes
Yes, it is. However when I went looking for a "HA Postgres" solution I found
it to be a viable alternative for my use case.

~~~
dianasaur323
CockroachDB employee here - Yes, CockroachDB is a completely different
database from PostgreSQL. CockroachDB supports HA from the bottom up with data
broken up into ranges that are consistently replicated using Raft. As
mentioned earlier in the thread, it uses the PostgreSQL wire protocol and
supports a good amount of SQL (but not all since the dialect is quite large if
you include extensions). If you are looking for HA with SQL compatibility, it
would be worth taking a look at CockroachDB.

------
forgot-my-pw
How does this differ from Galera Cluster / mysql-wsrep?
[https://mariadb.com/kb/en/mariadb/what-is-mariadb-galera-
clu...](https://mariadb.com/kb/en/mariadb/what-is-mariadb-galera-cluster/)

~~~
morgo
(See my other reply)

------
jthnews
Is there any support for sharding?

~~~
morgo
Nope, it's planned though.

In the mean time, I recommend using something like ProxySQL to route based on
schema to shard between multiple instances of MySQL.

~~~
v4tk
InnoDB Cluster includes MySQL Router, but you recommend using ProxySQL?

~~~
morgo
For this use case, yes. ProxySQL also natively supports Group Replication
though so you are free to chose either.

