Skip to content
This repository was archived by the owner on Sep 8, 2025. It is now read-only.
This repository was archived by the owner on Sep 8, 2025. It is now read-only.

TCP Client/Server for efficient remote sync #16

@bradmac

Description

@bradmac

I would like to do remote syncronisation as follows

  • client initiates a TCP connection to a storage server, and sends the hash of the root representing the current local state of resources
  • the server begins walking the directory tree from this hash
  • it uses its server-side hash and blob stores as primary
  • where a hash is encountered which is not present on the server side it requests it from the client with the open TCP connection
  • the client responds with the requested data, either as blobs or hash fanouts
  • these are persisted by the server to the server side blob and hash stores
  • Once the server has successfully walked the entire tree, it sets the new hash as the next commit of the branch

The API should look as follows

  1. Server side stores
  2. Server side
    SyncServer server = new SyncServer(); // default to all interfaces and some default port
    SyncListener listener = new SyncListener {
    public void onSync(String hash, BlobStore blobStore, HashStore hashStore) {
    // the app can walk the tree here
    }
    }
    server.start(listener); // the server is now listening for incoming TCP connections
  3. Client side
    SyncClient client = new SyncClient("myserver.com", 9090, blobStore, hashStore); // server address as above, with local stores
    client.sync("abc123"); // provide a REAL sha1 hash

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions