Mysql-proxy and Lua, how to transfer a request to another server for a fragment table?

I split the whole table into several db servers. such as: table1 / 2 / ... 10 in serverA, table11 / 12 ... in serverB. I want to achieve the goal: sql query: select * from table1 ; use lua to pass this request to the server. if the query table is in B, pass it to B

I am exploring rw-splitting.lua in a proxy dock, it only changes proxy.connection.backend_ndx. but I am testing to change it in read_query() but cannot work.

+4
source share
1 answer

As far as I know, a proxy does not give you this functionality. There are other commercial products that perform this request routing in accordance with the sharding policy, and not only that they can also run queries in all databases and combine the results, review data for addr or delete dbs on the Internet, control and manage the system , More. I recommend that you look at Scalebase (the disclaimer that I work there) at www.scalebase.com.

0
source

Source: https://habr.com/ru/post/1400507/


All Articles