02-read-write-split

command
v0.0.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 3, 2026 License: MIT Imports: 6 Imported by: 0

README

Primary and read replicas

The generated Store is constructed with one primary and one replica. Ordinary reads are balanced across replicas, writes use the primary, and ReadFromPrimary() requests a strong read. Those routing details do not change the generated AccountsReader and AccountsWriter interfaces used by the application.

RW_PRIMARY_DSN='postgres://user:pass@primary/accounts?sslmode=disable' \
RW_REPLICA_DSN='postgres://user:pass@replica/accounts?sslmode=disable' \
  go run ./examples/02-read-write-split

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL