Replies: 3 comments 1 reply
-
Hi @fkjaekel, we have not fully tested the Read/Write Splitting plugin with RDS Proxy and we do not recommend using it in production. RDS Proxy transparently re-routes requests to a single database instance, and it decides which database instance to use based on its criteria. Since RDS Proxy is handling the switching between different instances, it reduces the impact of using the Read/Write Splitting plugin and its several host selection strategies. Since you have a read/write endpoint and a read-only endpoint similar to the reader and writer cluster endpoints, using just the Read/Write Splitting plugin may work for basic workflows. Using other plugins on top of this set up may cause unpredictable side effects, therefore we do not recommend using it in production. |
Beta Was this translation helpful? Give feedback.
-
Based on my understanding, I don’t think this answer is quite right. Although RDS Proxy can distribute across the readers effectively, it can’t perform the actual read/write split, correct? Ideally, we want to utilize the r/w splitting plugin for this capability. Seems that if we could have the reader selection strategy target the proxy’s single read endpoint, this would work, no? |
Beta Was this translation helpful? Give feedback.
-
Hi @vnephologist, just want to make sure we understood you correctly, do you just want to use the Read/Write Splitting plugin to switch between the writer and the reader, and have RDS Proxy handle all the reader load distribution? The wrapper constructs the cluster topology based on the wrapperDialect, if you want to override how cluster topology is fetched you would need to specify a non cluster-aware wrapper dialect, such as pg or mysql. This idea would work if you are only using the Read/Write Splitting plugin. To do so you would need to:
Here is a simple example public static void main(String[] args) throws SQLException {
final Properties properties = new Properties();
properties.setProperty("user", "user");
properties.setProperty("password", "pass");
properties.setProperty("wrapperPlugins", "readWriteSplitting");
properties.setProperty("wrapperDialect", "pg");
properties.setProperty("singleWriterConnectionString", "true");
try (Connection conn = DriverManager.getConnection(
"jdbc:aws-wrapper:postgresql://writer.XYZ.us-east-2.rds.amazonaws.com,reader.proxy-XYZ.us-east-2.rds.amazonaws.com/db",
properties);
Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery("SELECT aurora_db_instance_identifier()")) {
rs.next();
System.out.println(rs.getString(1));
}
} Please note that you will not be able to take advantage of he failover and EFM features, and will not be able to utilize any other features requiring cluster topology. |
Beta Was this translation helpful? Give feedback.
-
I have configured the RDS Proxy with a read/write endpoint and a read only endpoint. I'd like to know if the Read/Write Splitting Plugin is compatible with this setup.
Beta Was this translation helpful? Give feedback.
All reactions