分散式同步安全数据存储 [英] Decentralized synchronized secure data storage

查看:171
本文介绍了分散式同步安全数据存储的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

简介



您好,我要问一个对我来说似乎是乌托邦的问题,需要知道是否有办法实现我需要的。如果没有,我需要知道为什么不



想法

假设我在 MySql 中有一个数据库结构。



我想创建一些解决方案, (包含其内容)( ) b
$ b

好吧,它不会只是一个同步副本,它可以(和应该)是多重复制例如,在世界各地有十个副本)



最重要的是:必须安全。通过安全我的意思是只有实际接受的交易将与所有其他(无论多少)数据库副本/克隆同步。



em>注意:由于很难实时进行同步,因此我将设计所有内容以使此功能不必要。



这是怎么回事?

我想要管理它:



时间标识符和更新检查:每个操作(插入,更新,删除...) 将被存储为与时间标识符相关联的操作指令本身。 [我认为比DATETIME字段更好,它将是一个INT,与从2013年1月1日传递的毫秒数,例如] 。因此,每个副本都会向上一次更新后执行的新操作请求邻居副本,并在检查允许后执行。



问题1 邻居副本可能已过时。

解决方案1 ​​一个邻居,创建一个随机列表与一些副本/克隆,并问他们的新闻(我可以避免列表并要求所有克隆更新,但是如果克隆数上升太多,则效率会低下。)



问题2 :实时全局同步无效。如果...

 有人在CLONE_ENTERPRISING插入一行到TABLE。 
...此行转到每个克隆...
某人在CLONE_FIXEMALL删除此行。
...同时,在某个过时的克隆...
有人在CLONE_DROPOUT编辑此行(现在在其他克隆中不存在)



解决方案2 :简单的东西,强制GLOBAL同步,然后再做任何新的依赖第三数据 action (例如,编辑)。这个全局同步。例如



注意:嗯,有人可能会有一些乐趣,克隆...因为他们没有得到实时更新,这一行将存在两次。但是,它和我们有一个单一的数据库是一样的,在某些需要的情况下,我们检查是否有一个现有的相同行,然后再执行最终的操作。不是问题。



问题3:可以编辑代码,不过滤操作,所以有人可以传播指令删除一切,或者只是做一些拖钓活动。这不是一个问题,因为好的克隆将永远在某个地方。那些坏的人不会再兴趣了。



我真的很感激,如果你读。我知道这不是完美的解决方案,它可能有几百个洞,但它是我的基本开始。我现在将欣赏任何你可以教我现在。非常感谢。



PS。:可能是我尝试的所有这些都已经存在,并有自己的名称。对不起,请问(我会反正这个名字,如果它存在)

解决方案

建议您查看Microsoft的同步框架。它可能更适合SQL Server,但它应该与MySQL一起工作。你处理的问题是相当复杂的。


Introduction

Hi, I am going to ask a question which seems utopic for me, but I need to know if there is a way to achieve what I need. And if not, I need to know why not.

The idea

Suppose I have a database structure, in MySql.

I want to create some solution to allow anyone (no matter who, no matter where) to have a synchronized copy (updated clone) of this database (with its content)

Well, and it is not going to be just one synchronized copy, it could (and should) be a multiple replication (supposing the basic, this means, for example, ten copies all over the world)

And, the most important thing: It must be secure. By secure I mean only real-accepted transactions will be synchronized with all the others (no matter how many) database copies/clones.

Note: Since it would be quite difficult to make the synchronization in real-time, I will design everything to make this feature dispensable. So it is not required.

My auto-suggestion

This is how I am thinking to manage it:

Time identifiers and Updates checking: Every action (insert, update, delete...) will be stored as the action instruction itself, associated to the time identifier. [I think better than a DATETIME field, it'll be an INT one, with the number of miliseconds passed from 1st january 2013 on, for example]. So each copy is going to ask to the "neighbour copy" for new actions done since last update, and execute them after checking they are allowed.

Problem 1: the "neighbour copy" could be outdated too.
Solution 1: do not ask just one neighbour, create a random list with some of the copies/clones and ask them for news (I could avoid the list and ask ALL the clones for updates, but this will be inefficient if clones number ascends too much).

Problem 2: Real-time global synchronization is not active. What if...

   Someone at CLONE_ENTERPRISING inserts a row into TABLE.
   ... this row goes to every clone ...
   Someone at CLONE_FIXEMALL deletes this row.
   ... and at the same time, somewhere in an outdated clone ...
   Someone at CLONE_DROPOUT edits this row (now inexistent at the other clones)

Solution 2: easy stuff, force a GLOBAL synchronization before doing any new "depending-on-third-data action" (edit, for example). This global synch. will be unnecessary when making an INSERT, for instance.

Note: Well, someone could have some fun, and make the same insert in two clones... since they're not getting updated in real-time, this row will exist twice. But, it's the same as when we have one single database, in some needed cases we check if there is an existing same-row before doing the final action. Not a problem.

Problem 3: It is possible to edit the code and do not filter actions, so someone could spread instructions to delete everything, or just make some trolling activity. This is not a problem, since good clones will always be somewhere. Those who got bad won't interest anymore.

I really appreciate if you read. I know this is not the perfect solution, it has possibly hundred of holes, but it is my basic start. I will now appreciate anything you can teach me now. Thanks a lot.

PS.: It could be that all this I am trying already exists and has its own name. Sorry for asking then (I'd anyway thank this name, if it exists)

解决方案

I would suggest a look at Sync Framework from Microsoft. It might be better suited to SQL Server but it should work with MySQL too. The problem you are tackling is quite a complex one.

这篇关于分散式同步安全数据存储的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆