Giter Club home page Giter Club logo

tapestry's Introduction

Tapestry

This project implements Tapestry, an underlying distributed object location and retrieval system (DOLR) which can be used to store and locate objects. This distributed system provides an interface for storing and retrieving key-value pairs. From an application’s perspective, the application chooses where to store data, rather than allowing the system to choose a node to store the object at.

Tapestry is a decentralized distributed system, where each node serves as both an object store and a router that applications can contact to obtain objects. In a Tapestry network, objects are “published” at nodes, and once an object has been successfully published, it is possible for any other node in the network to find the location at which that object is published.

High-Level Design Choice

Node Join: When a node trying to join the tapestry, the node first finds the shared prefix of ID and multicast to the existing node sharing the prefix. These nodes will add the new node to their routing table. Then new node will get closest neighbors to fill its own routing table.

Node Leave: When a node leave the network, the node will notify its leaving and try to transfer the replacement node when traversing its own routing table. Objects stored at leaving node will be redistributed.

Interesting Improvement

We made some part of our code in goroutine, which will improve the performance of our project. For the test, we developed some util functions that can make testing much easier.

Test For Tapestry

We have put a lot of effort on the tests for this project. Thus, we have written lots of unit tests. Below are the test we have written. The unit tests concentrate on the four main file: node_init, node_core, node_exit and routing_table . Beside the unit tests, we also implement some testing_utils functions that helping the testing of the project.

node_init_test.go

  • TestNodeIDAndAddress

    This test tests about the Node ID and Addr function.

  • TestMulticast1

    This test tests about Multicast, especially about data transfer in multicast.

  • TestMulticast2

    This test tests about Multicast, especially about bad node removed from routing table.

  • TestMulticast3

    This test tests about Multicast, especially about bad node not in neighbor.

  • TestAddRoute1

    This test tests about AddRoute, especially about adding route to routing table.

  • TestAddRoute2

    This test tests about AddRoute, especially about replacing a node in routing table.

  • TestAddRoute3

    This test tests about AddRoute, especially about not replacing a node in routing table, because new node is further.

node_core_test.go

  • TestNodeGetStoreRemove

    This test tests about Node Get Store Remove, especially when these operation between remote nodes.

  • TestFindRootOnRemoteNode1

    This test tests about FindRoot for deleted node, which will return the following node in the routing table.

  • TestFindRootOnRemoteNode1_BadNode

    This test tests about FindRootOnRemoteNode, especially when find root with one better bad node, the result should returns self.

  • TestFindRootOnRemoteNode2_BadNode

    This test tests about FindRootOnRemoteNode, especially when find root on a bad node.

  • TestPublish

    This test tests about Publish which registers object on the correct root node

node_exit_test.go

  • TestLeave1_SafeLeave

    This test tests about node leave the tapestry, especially when leaving in a graceful way

  • TestLeave2_UnsafeLeave

    This test tests about node leave the tapestry, especially when leaving in an unsafe way

  • TestNotifyLeave1_WithoutReplacement

    This test tests about NotifyLeave, especially when leaving without a replacement node

  • TestNotifyLeave2_Replacement

    This test tests about NotifyLeave, especially when leaving with a replacement node

  • TestNotifyLeave2_WithReplacement

    This test tests about Leave, especially when gracefully leaving with a replacement node

routing_table_test.go

  • TestRoutingTable_Add

    This test tests about Add and Remove node in routing table, especially when function called on remote node

Test Coverage

node_init.go: 85.5%

node_core.go: 85.1%

node_exit.go: 95.7%

routing_table.go: 96.5%

Reference

https://sites.cs.ucsb.edu/~ravenben/classes/papers/tapestry-jsac04.pdf

tapestry's People

Contributors

hancai98 avatar

Stargazers

 avatar

Watchers

 avatar

tapestry's Issues

testing multiple nodes for testing

Hello,

I am researching P2P approaches for a ultra-high scaling cross-platform P2P project that I am working on which will be to handle many nodes in a P2P database system.

I wanted to try your Tapestry and was able to compile it on my Windows 10 system.

Then I started one node in a terminal and then opened a new terminal to try and connect to the first node:

tapestry.exe connect F95820EFDD6E17935A4986547FD528A8CE6CB264

but it did not seem to connect.

Am I doing something wrong here?

Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.