An open API service providing package, version and dependency metadata of many open source software ecosystems and registries.

github.com/nedscode/rwproxy

Package rwproxy provides an implementation of "database/sql/driver".Driver, switching between a "writer" connection and series of "reader" connections of an underlying delegate driver. To provide reader-writer query distribution without userland changes in database usage. rwproxy achieves its goal by being an implementation of database/sql/driver.Driver. It doesn't provide any direct database driver facilities, and instead wraps around a delegate driver which provides the concrete implementation: The cluster is specified as a "compound" DSN to sql.Open(). The compound DSN is a semicolon-separated (;) list of DSNs for the delegate driver. The first DSN is used as the "writer", and any subsequent DSNs as a series of "readers" across which queries will be load balanced. If no readers are specified, all queries will be sent to the writer, which should behave identically to not using rwproxy at all. rwproxy selects the most appropriate connection as follows: The rwproxy *sql.Conn lazily connects to the writer and a single reader as necessary, and will retain these until the it is closed by the connection pool. Package "database/sql" provides a builtin connection pool when sql.Open() is used. Because the pooling happens at a level above (and therefore out of control of) the rwproxy driver, it is the rwproxy connections (not the delegated connections) that are pooled. This means that, at worst, rwproxy will hold open both a writer and reader connection for each item in the connection pool.

Ecosystem
proxy.golang.org
Latest Release
v0.0.0-20180711072101-c94e8e71be23
over 7 years ago
Versions
1
Links
Registry proxy.golang.org
Source Repository
Docs Documentation
JSON API View JSON
CodeMeta codemeta.json
Package Details
PURL pkg:golang/github.com/nedscode/rwproxy
spec
License MIT
Namespace github.com/nedscode
First Release over 7 years ago
Last Synced about 16 hours ago
Repository
Stars 2 on GitHub
Forks 0 on GitHub
Rankings on proxy.golang.org
Overall Top 8.2%