Golang failover pattern for sql

I am looking to add failover logic for sql instances at the application layer.

I am curious if there is something that already accomplishes failover before I create a package that wraps database/sql. Something along the lines of https://github.com/benthor/clustersql but for auto failover vs load distribution.

My gut would be to dial the initial connection pool through an internal ReadWriteCloser or net.Conn that did this for you. I would avoid doing this on each sql call or in a sql wrapper.

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.