Details
-
New Feature
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
None
-
None
-
None
Description
The namedserverfilter uses a somewhat inelegant method of defining the routing behavior: it has 25 named match-target pairs that can be used to control the order. Having another method for defining it would be ideal which also doesn't require having to match the names.
Options like inline JSON payloads that are configurable as follows in the INI file would be suitable but not ideal as JSON is somewhat ugly when used for configuration:
[Named-Server-Filter]
|
type=filter
|
module=namedserverfilter
|
rules=[
|
{"match": "SELECT.*FROM.*t1", "target": "oltp-1"},
|
{"match": "SELECT.*COUNT.*t1", "target": "analytics-1"}
|
]
|
This could also support passing a path to a file with the rules from which they'd be read from but this makes it difficult to modify them online.
With a varible format like this, it'd be natural to also extend the syntax to support conditional matching by only applying it if the username, client remote or the default database match. This would solve the problem where the rules are applied to everyone.