Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

数据库连接层可以提供多层,直接在 model 层进行路由 #48

Closed
zhyq0826 opened this issue May 29, 2016 · 0 comments
Closed

Comments

@zhyq0826
Copy link
Member

使用场景

case 1

由于mongodb 集群的限制,除非使用 shard 模式,否则无法做到直接在数据库层进行两个节点写的操作,可以在 model 层提供两个写操作的连接,来达到数据夸集群同步。解决问题的是:如果一个集群无法连通或宕机,可以立即切换到备用集群。

case 2

数据切片。对大宗数据进行拆分可以,直接提供根据数据 hash 进行连接选择,来进行夸集群切片,即形成一个简单的 sharding 方案。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant