|
1 | 1 | # Interact |
2 | | -Real time file synchronization using Bloom Filter and Splay Tree |
| 2 | + |
| 3 | +An easy to use real time file synchronization application built using Python. |
| 4 | +<img src="https://user-images.githubusercontent.com/43802499/68604424-71f7df00-04d0-11ea-9773-1d51344c8318.png" align="right" |
| 5 | + title="File-Sync" width="220" height="250"> |
| 6 | + |
| 7 | +## Getting Started |
| 8 | + |
| 9 | +These instructions will get you a copy of the project and ready for on your local machine. |
| 10 | + |
| 11 | +### Prerequisites |
| 12 | + - Python 3.7 |
| 13 | + |
| 14 | + - Clone this repository using the command: |
| 15 | + |
| 16 | + ``` |
| 17 | + git clone https://github.com/KrishnanSG/Interact.git |
| 18 | + cd Interact |
| 19 | + ``` |
| 20 | + |
| 21 | + - Then install a few required dependencies by using your favorite terminal |
| 22 | +
|
| 23 | + ``` |
| 24 | + pip install -r requirements.txt |
| 25 | + ``` |
| 26 | +
|
| 27 | +### How to Use |
| 28 | +
|
| 29 | +You're almost there. |
| 30 | +The following steps will guide you on how to use this tool. |
| 31 | +
|
| 32 | +1. Creating host server |
| 33 | + ``` |
| 34 | + python main.py <filename> --host |
| 35 | + ``` |
| 36 | +
|
| 37 | +2. Ask your friend to connect to the server |
| 38 | + ``` |
| 39 | + python main.py <filename> |
| 40 | +
|
| 41 | + Provide inputs for the prompt messages. |
| 42 | + ``` |
| 43 | +
|
| 44 | +3. Enjoy the sync. We automatically detect for modification made in the file, so just save the file. |
| 45 | +
|
| 46 | +## How does this work? |
| 47 | +
|
| 48 | +Most the of the file synchronziers send the complete file across the network for every sync cycle. |
| 49 | +
|
| 50 | +### How we do it? |
| 51 | +**BloomFilters** |
| 52 | +
|
| 53 | +A Bloom filter is a space-efficient probabilistic data structure that is used to test whether an element is a member of a set. Check out this [link](https://www.geeksforgeeks.org/bloom-filters-introduction-and-python-implementation/) to know more. |
| 54 | +
|
| 55 | +### The protocol |
| 56 | +We will be using a few terms in the due course of the explanation. |
| 57 | +- **Host** - the user who has intiated the P2P server. |
| 58 | +- **Client** - the user who connects to the host. |
| 59 | +- **User1** - the user who initates the sync cycle (would have made some modification to the file). |
| 60 | +- **User2** - the user whose file will get updated. |
| 61 | +- **getMissingContent()** - a function to find the missing contents. |
| 62 | +- **syncFile()** - a function to merge (reproduce the changes on the destination). |
| 63 | +
|
| 64 | + |
| 65 | +
|
| 66 | +### Conclusion |
| 67 | +The algorithm developed does synchronization effieciently since the size of the BloomFiter transmitted is in **bits** while the file would be in **MBs**. |
| 68 | +
|
| 69 | +The total average transmition cost was found out to be size_of_BloomFilter (Few btyes) + number of lines modified (a few 100 bytes). |
| 70 | +
|
| 71 | +## Authors |
| 72 | +
|
| 73 | +* **Krishnan S G** - [@KrishnanSG](https://github.com/KrishnanSG) |
| 74 | +* **Sivagiri Visakan** - [@SivagiriVisakan](https://github.com/SivagiriVisakan) |
0 commit comments