开发者

Replicating multiple servers with specific replication requirements between servers

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 开发者_Python百科α 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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜