[MXS-193] Router and Filter based on canonical form Created: 2015-06-12  Updated: 2017-03-20  Resolved: 2017-03-20

Status: Closed
Project: MariaDB MaxScale
Component/s: N/A
Affects Version/s: None
Fix Version/s: 2.2.0

Type: New Feature Priority: Major
Reporter: VAROQUI Stephane Assignee: Unassigned
Resolution: Won't Do Votes: 0
Labels: None


 Description   

Maintain on disk a list of dynamic canonical query to multiplex, route or filter
json , yalm, xml can be used for persisting the rules

In memory a structure should store in LRU all ever seen template since startup + templates pin by user

maxadmin user would add rules like

SHOW TEMPLATES
the list id, template is printed

FILTER TEMPLATE 12
ROUTE TEMPLATE 10 TO 'backend2'
MULTIPLEX TEMPLATE 6 TO 'backend3'

rule matching can be done via a search hash of pinned template for current hash of current query template



 Comments   
Comment by markus makela [ 2015-07-20 ]

I've made a very simple testing filter on the MXS-193-test branch on GitHub. It reads rules from a file and adds a routing hint to the query if its canonized form is found in the rule file. The destination of the query can be controlled via the rule file and the rules follow this simple syntax: <canonical query>|<server name>

This module needs the readwritesplit router to work.

Here is a small example of a rule file:

update tst set fname="?" where fname like '?'|server1
select @@version_comment limit ?|server2
select  md5("?") =?|server4
select * from tst where lname like '?' order by fname|server3
insert into tst values ("?",'?')|server1
delete from tst where fname like '?'|server2

Current testing implementation does not break replication which means that data modifying statements will always be routed to the master. This can be changed by adding a configuration parameter to readwritesplit.

The real implementation could be configurable via maxadmin.

Comment by Johan Wikman [ 2017-03-20 ]

Namedserverfilter and hintrouter will in 2.2 provide roughly this functionality.

Generated at Thu Feb 08 03:57:29 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.