架构问题-wcf和分布式数据
对于可能是基本架构问题的歉意
我们使用 wcf 服务实现业务逻辑层。它们连接到 mysqldb(这是数据库层)并进行一些处理。 wcf 服务可由多个应用程序使用。
基本问题 - 如果我们计划进行一些水平分片或某种形式的分区,我应该将分片管理器放在哪里?例如,现在我将在两台机器上拥有两个数据库,而不是单个数据库。
获取特定项目的调用可能会转到 db1 或 db2,具体取决于项目记录的主键。
在这种情况下,我是否需要部署 WCF 代码的多个副本,每个副本都有不同的值连接字符串,然后在其之前有一个层,该层对要调用哪个服务 URL 进行一些解析?我确信此类问题有一定的模式,如果我能得到一些正确方向的指示,那就太好了。
Apologies for what could be a basic architecture question
We implement our business logic layer using wcf services. They connect to a mysqldb (which is the database layer) and do some processing. The wcf services can be consumed by multiple applications.
Basic question - If we are planning to do some horizontal sharding or some form of partitioning where do I put the shard manager? E.g, Instead of a single db now I will have two dbs in two machines.
The call to get a particular item may go to db1 or db2 depending on say the primary key of the item record.
In this scenario, would I need to deploy multiple copies of my WCF code each with a different connectionstring and then have a layer before that which does some resolution as to which service URL to call? I am sure that there are patterns for this sort of a problem and it would be great if I could get some pointers in the right direction.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以拥有一个或多个 WCF 服务实例,并且每个实例都包含所有分片的连接字符串,并且每个实例都拥有路由到正确分片的逻辑。
You can have one or more instances of your WCF service, and have each contain the connection strings of all the shards, and each possessing the logic to route to the correct shard.