Database sharding and Rails

前端 未结 6 1558
南方客
南方客 2021-02-02 01:35

What\'s the best way to deal with a sharded database in Rails? Should the sharding be handled at the application layer, the active record layer, the database driver layer, a pr

6条回答
  •  北荒
    北荒 (楼主)
    2021-02-02 02:12

    For rails to work with replicated environment, I would suggest using my_replication plugin which helps switch database connection to one of the slaves at run-time

    https://github.com/minhnghivn/my_replication

提交回复
热议问题