Supporting dynamic switching between databases
iuri-gg opened this issue · 2 comments
iuri-gg commented
I was considering using this library in my project and I am wondering if having support for dynamic database switching similar to apartments gem is out of scope for this project.
mykola-kyryk commented
Dynamic switching is especially interesting if you have one database but want to use Read Replica.
So in the controller you would setup to use Read Replica for index
and show
, and Main DB for create
and update
.
ankane commented
Hey @ocha, the Apartment gem was designed for horizontal sharding (same table in multiple DBs but different data), whereas this is designed for vertical sharding (some tables are in one DB, others are in other, but not in both).
@mykola-kyryk for replicas, check out Distribute Reads.