Skip to main content
Tungsten Clustering

Connector Routing Methods

The supported routing methods, typical uses and use cases are listed below:

Routing Method Selection
Routing MethodHost SelectionAuto R/W SplittingReplica LatencyMaximum Applied Latency
SmartscaleBy SessionYes (by SQL statement)LazyYes
Direct ReadsBy ContentYes (by SQL statement)LazyYes
Host-basedBy HostnameNoYesYes
Port-basedBy Network PortNoNoYes
SQL-basedBy SQL commentNoNoYes
important

Both SmartScale and R/W splitting cannot be enabled at the same time. This is because they are two sides of the basic functionality. R/W splitting and SmartScale both use SQL introspection to determine whether a query should be directed to a Primary or a Replica. SmartScale combines this with an intelligent load-balancer. R/W splitting uses a simpler direct redirection.

In addition to the selection and configuration mechanisms supported, a routing method should be chosen based on your application abilities:

  • If the application is replication-aware, and can already direct queries to Primary or Replicas based on the operation type, use "Host-based Routing" or "Port-based Routing"
  • If the application has full control of the SQL statements submitted (i.e. not through a third-party tool, or Object-Relational Modeling library), and can already direct queries to Primary or Replicas based on the operation type, use "SQL Routing".
  • If the application uses non-auto-commit statements (for example, Hibernate), "Host-based Routing", or "SQL Routing".
  • If the application does not fit any of these categories, or is not replication aware use either "Direct Routing" or "Smartscale Routing".