Redian新闻
>
Question 2: distributed database question?
avatar
Question 2: distributed database question?# Database - 数据库
c*t
1
I am writing a P2P application which involves database query
of peers' data.
Say, P1 (peer 1) has following rows in table "serve"
abc1
abc2
ddd1
...
...
hundreds if not thousands of entries.
Peer 2 (P2) perform a broadcast query to all peers in a group
and expect to obtain the queries. I used a dumb query like:
SELECT * FROM serve
and P1 would return the entire table to P2. However, later
P2 does the query again, since P2 is interested in updates
avatar
b*s
2
one straight forward solution (probably not the best) would be creating
another table with peer information. Assume each peer has a unique ID,
the table can be as simple as:
peerID LatestTupleSentToThisPeer
===================================
Also, you need to make sure the clocks on each peer are synchronized
(google "lamport clock").

【在 c*****t 的大作中提到】
: I am writing a P2P application which involves database query
: of peers' data.
: Say, P1 (peer 1) has following rows in table "serve"
: abc1
: abc2
: ddd1
: ...
: ...
: hundreds if not thousands of entries.
: Peer 2 (P2) perform a broadcast query to all peers in a group

avatar
t*y
3
I am not so clear about your problem.
But I know there is a mechanism about cache coherent problems
If any P want to update, it should send a request to owner of the data, the owner
will invalid any other peers' copies and send "Yes or No" to P.
then P update it locally. If any p query the data from the owner, the owner then
will update the copy first and then send out the updated information..
It is similiar as the snoopy cache coherent problem.

【在 c*****t 的大作中提到】
: I am writing a P2P application which involves database query
: of peers' data.
: Say, P1 (peer 1) has following rows in table "serve"
: abc1
: abc2
: ddd1
: ...
: ...
: hundreds if not thousands of entries.
: Peer 2 (P2) perform a broadcast query to all peers in a group

avatar
t*t
4
This kind of queries are called 'continuous queries', search by this keyword
you can find a ton of information from the web.

【在 c*****t 的大作中提到】
: I am writing a P2P application which involves database query
: of peers' data.
: Say, P1 (peer 1) has following rows in table "serve"
: abc1
: abc2
: ddd1
: ...
: ...
: hundreds if not thousands of entries.
: Peer 2 (P2) perform a broadcast query to all peers in a group

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。