rwdb alternatives and similar packages
Based on the "Database" category.
Alternatively, view rwdb alternatives based on common mentions on social networks and blogs.
-
Milvus
A cloud-native vector database, storage for next generation AI applications -
cockroach
CockroachDB - the open source, cloud-native distributed SQL database. -
tidb
TiDB is an open-source, cloud-native, distributed, MySQL-Compatible database for elastic scale and real-time analytics. Try AI-powered Chat2Query free at : https://tidbcloud.com/free-trial -
vitess
Vitess is a database clustering system for horizontal scaling of MySQL. -
TinyGo
Go compiler for small places. Microcontrollers, WebAssembly (WASM/WASI), and command-line tools. Based on LLVM. -
groupcache
groupcache is a caching and cache-filling library, intended as a replacement for memcached in many cases. -
VictoriaMetrics
VictoriaMetrics: fast, cost-effective monitoring solution and time series database -
immudb
immudb - immutable database based on zero trust, SQL and Key-Value, tamperproof, data change history -
go-cache
An in-memory key:value store/cache (similar to Memcached) library for Go, suitable for single-machine applications. -
buntdb
BuntDB is an embeddable, in-memory key/value database for Go with custom indexing and geospatial support -
pREST
PostgreSQL ➕ REST, low-code, simplify and accelerate development, ⚡ instant, realtime, high-performance on any Postgres application, existing or new -
rosedb
🚀 A high performance NoSQL database based on bitcask, supports string, list, hash, set, and sorted set. -
xo
Command line tool to generate idiomatic Go code for SQL databases supporting PostgreSQL, MySQL, SQLite, Oracle, and Microsoft SQL Server -
tiedot
A rudimentary implementation of a basic document (NoSQL) database in Go -
nutsdb
A simple, fast, embeddable, persistent key/value store written in pure Go. It supports fully serializable transactions and many data structures such as list, set, sorted set. -
cache2go
Concurrency-safe Go caching library with expiration capabilities and access counters -
GCache
An in-memory cache library for golang. It supports multiple eviction policies: LRU, LFU, ARC -
fastcache
Fast thread-safe inmemory cache for big number of entries in Go. Minimizes GC overhead -
gocraft/dbr (database records)
Additions to Go's database/sql for super fast performance and convenience. -
CovenantSQL
A decentralized, trusted, high performance, SQL database with blockchain features
Clean code begins in your IDE with SonarLint
Do you think we are missing an alternative of rwdb or a related project?
Popular Comparisons
README
rwdb
Database wrapper that manage read write connections
Install
go get github.com/andizzle/rwdb
Create connections
package main
import "github.com/andizzle/rwdb"
var conns = []string{
"tcp://user:[email protected]/dbname",
"tcp://user:[email protected]/dbname",
"tcp://user:[email protected]/dbname",
"tcp://user:[email protected]/dbname",
}
// unable to open write will cause an error
db, err := rwdb.Open("driver", conns...)
Rotation read and Sticky read
Query a database rotate the use of database connections
Basic usage
db, err := rwdb.Open("driver", conns...)
// Use the first connection
db.QueryContext(ctx)
// Use the next connection
db.QueryContext(ctx)
Execute a statement will cause all subsequent queries to use the write connection (sticky connection). This is to allow the immediate reading of records that have been written to the database during the current request cycle.
db, err := rwdb.Open("driver", conns...)
// Use the next connection
db.QueryContext(ctx)
// Use the write conenction
db.ExecContext(ctx)
// Use the write connection
db.Query()
Sticky can be turned off
db.SetSticky(false)
A more practical example
The db is marked as modified if there's a successful Write
to the databse, which turns on the sticky logic.
However, the real world usecase would require modified
value to be reset on each request session.
Here's what we can do:
db, err := rwdb.Open("driver", conns...)
func RecordUserLogin() {
d := db.New() // This will make sure the following read are not affected by
// other sessions' write action
d.Query("SELECT * from `users` where id = ?")
...
d.Exec("UPDATE `users` set last_login_at = now();")
d.Query(...) // Connection is set to the writer
}
License
*Note that all licence references and agreements mentioned in the rwdb README section above
are relevant to that project's source code only.