What I want to say in this article is that you can use ** MariaDB Connector / J ** instead of ** MySQL Connector / J ** when connecting to Aurora (MySQL) from a Java application.
You must use the ** JDBC driver ** to connect to MySQL from Java
When connecting to MySQL, use a JDBC driver called ** Connector / J ** Here, the one created by MySQL is called ** MySQL Connector / J **, and the one created by MariaDB derived from MySQL is called ** MariaDB Connector / J **.
Both could be used with Aurora (MySQL), but ...
To conclude earlier, ** it supports Aurora failover **, so I chose MariaDB Connector / J.
Apparently, connect to all instances of Writer and Reader, and determine that innodb_read_only is Off = master. After that, it seems to check replica_host_status which is more reliable than the cluster endpoint.
The Official Site has a description of the corresponding version.
Driver Version | Java Version |
---|---|
2.X | Java 9, Java 8 |
> 1.6.1 - < 2 | Java 9, Java 8, Java 7, Java 6 |
1.2 - 1.6.1 | Java 8, Java 7 |
1.1 | Java 8, java 7, Java 6 |
For MySQL Connector / J, the connection is 0
In the case of MariaDB Connctor / J, both Writer and Reader are connected.
Our company is looking for engineers. We carry out a wide range of business from infrastructure to apps and user support. https://www.nittsu-infosys.com/recruit/2019/index.html
Recommended Posts