在服务器之间复制具有特定复制要求的多个服务器

发布于 2024-10-19 19:44:49 字数 1404 浏览 5 评论 0原文

考虑两个表 AB,如下所示(让我为丑陋的 ASCII 表道歉):

----------------------------------     ------------------------
|  SNID  |  PNID  | SerialNumber |     |  PNID  |  PartNumber |
|--------|--------|--------------|     |--------|-------------|
|   0    |   0    |   17823      |     |   0    |  9874-4362  |
|--------|--------|--------------|     |--------|-------------|
|   1    |   0    |   17824      |     |   1    |  1053-1409  |
|--------|--------|--------------|     ------------------------
|   2    |   1    |   97245      |
----------------------------------

我想让位置 α 的服务器能够能够拥有对 PNID 0 的特定权限,并且位置 β 的服务器能够拥有对 PNID 1 的特定访问权限,但由于它是相同类型的数据(只是不同的所有者),我认为数据本身不应该分开。

无论如何,我想确保β是否想要访问为PNID 0分配序列号,它必须首先与α通信才能被允许这样做。这意味着,如果它们之间的网络出现故障,α 可以产生 PNID 0,但不会产生 PNID 1,而 β 可以产生 PNID 1,但不是 PNID 0。然而,当两个实体恢复相互通信时,α 为 PNID 0 创建的任何序列号都将复制到 β,并且 β 中关于 PNID 1 的序列号> 将被合并到 α 的数据库中。

更一般地说,我真的更希望设置一个“中间人”位置 Ω,该位置做出关于 α 是否能够在未经 β 许可的情况下添加新序列号的所有决定。

我目前正在使用 SQL Server Express (2008 r2) 和 Visual Basic .NET Express (2010) 来实现服务器,但我对任何其他选项持开放态度,这些选项可能允许我解决当前遇到的问题。老实说,我不确定我所要求的是否合理,但如果是的话,我真的很有兴趣实施。

几乎立即,我能想到的第一件事就是向表 B 中添加另一列来表示位置,但我认为这不是执行此操作的“正确”方法。尤其是与其他服务器通信的部分(说实话,我什至不知道我是否可以使用数据库来做到这一点,因此可能必须我猜是在.NET 中完成的。

Consider two tables A and B, that looks like the following (Let me apologize for the ugly ASCII-tables):

----------------------------------     ------------------------
|  SNID  |  PNID  | SerialNumber |     |  PNID  |  PartNumber |
|--------|--------|--------------|     |--------|-------------|
|   0    |   0    |   17823      |     |   0    |  9874-4362  |
|--------|--------|--------------|     |--------|-------------|
|   1    |   0    |   17824      |     |   1    |  1053-1409  |
|--------|--------|--------------|     ------------------------
|   2    |   1    |   97245      |
----------------------------------

I want to make it possible for servers at location α to be able to have specific rights to PNID 0, and servers at location β to have specific access rights to PNID 1, but since it's the same type of data (just different owners), I don't think the data should in and of itself be separated.

In any case, I want to make sure if β wants to access assign a serial number for PNID 0, that it must first communicate with α before it is allowed to do so. This would mean that if the network between them went down, that α could produce PNID 0 but not PNID 1 and β could produce PNID 1 but not PNID 0. When the two entities came back into communication with each other however, any serial numbers that α created for PNID 0 would be replicated over to β, and serial numbers from β regarding PNID 1 would be merged into α's database.

More generally, I would really prefer this be set up with a 'middle-man' location, Ω, that made all the decisions regarding whether or not α was able to add a new serial number without β's permission.

I am currently using SQL Server Express (2008 r2) along with Visual Basic .NET Express (2010) to implement the server, but am open to any other options that may allow me to solve the issues that I'm currently having. To be honest, I'm not positive that what I'm asking is plausible, but if it were, it's something that I would really be very interested in implementing.

Almost immediately, the first thing I can think of is adding another column to table B that represents location, but I don't think that's the 'right' way to do this. Especially the part about communicating with the other servers (and to be honest, I don't even know if I could do that with the databse, so that would probably have to be done in .NET I guess.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

奢望 2024-10-26 19:44:49

您是否考虑过为 α 创建视图,

select * from A where PNID0=0
select * from B where PNID0=0

以及为 β 创建视图

select * from A where PNID0=1
select * from B where PNID0=1

然后您可以为不同位置授予这些视图的权限,而不是创建另一个 Ω 位置。

Have you considered creating views for α like

select * from A where PNID0=0
select * from B where PNID0=0

and creatings views for β

select * from A where PNID0=1
select * from B where PNID0=1

Then you can grant permission on these views for different locations instead of creating another Ω location.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文