A lightweight, embeddable Go database client library with auto-balancing and high availability for master-slave/master-master structures.
mssqlx is a Go database client library that provides high availability and automatic load balancing for master-slave and master-master database architectures. It extends sqlx with built-in proxy capabilities, health checking, and error retry mechanisms to handle complex database topologies transparently.
Go developers building applications that require reliable, scalable database access with support for replicated database setups like Galera Cluster or master-slave configurations.
Developers choose mssqlx for its lightweight design, automatic query balancing, and robust error handling that simplifies working with high-availability database clusters while maintaining full compatibility with standard Go database interfaces.
Database client library, proxy for any master slave, master master structures. Lightweight, performant and auto balancing in mind.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Proxies queries to master or slave nodes automatically in master-slave or master-master setups, with compatibility for Wsrep and Galera Cluster as stated in the README, simplifying application logic.
Detects bad connections from DBMS timeouts and automatically retries select/get/query operations, enhancing reliability without manual intervention.
Extends sqlx directly, maintaining full compatibility with all databases supported by database/sql, allowing easy adoption for existing Go workflows.
Continuously checks node health with adjustable periods for auto-reconnection, ensuring high availability in dynamic environments.
Requires separate settings for master and slave nodes (e.g., SetMasterMaxIdleConns, SetSlaveMaxIdleConns), which can be cumbersome in large or rapidly changing clusters.
Only supports round-robin load balancing for read queries, lacking options for more nuanced routing like weighted distribution or failover prioritization.
Transactions are handled on a single master node as shown in the README example, which may not support distributed transactions across multiple nodes, limiting use in some high-consistency scenarios.