Description
Improved Feature Request Description
Is your feature request related to a problem? Please describe.
I'm frustrated by the lack of fine-grained traffic control when using load balancing with UDFs in my database setup. Specifically, there's no way to differentiate between read-only and write operations for user-defined functions (UDFs) when distributing traffic across database nodes. This limitation makes it challenging to optimize performance and avoid unnecessary conflicts, particularly in scenarios where read and write operations need to be handled by different nodes. Tools like pgpool provide this functionality, and it would be valuable to have similar capabilities.
Describe the solution you'd like
I would like the load balancer to support the configuration of write_function_list
and read_only_function_list
. These configurations should allow specifying which UDFs are considered write-intensive or read-only, enabling the load balancer to intelligently route traffic. This feature would help achieve more effective traffic splitting and improve overall system performance and reliability.
Describe alternatives you've considered
An alternative could involve implementing custom middleware to handle traffic splitting at the application level. However, this approach introduces additional complexity and maintenance overhead. Another option might be to modify the application code to explicitly specify UDF behavior, but this reduces flexibility and increases the risk of errors.
Additional context
This feature is inspired by the functionality provided by tools like pgpool, which allow traffic splitting based on UDF operation types.