GithubHelp home page GithubHelp logo

isabella232 / datad Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sourcegraph/datad

0.0 0.0 0.0 426 KB

A distributed cache that spreads an existing local data source across a cluster, routes requests for data to the appropriate nodes, and ensures data is replicated and available.

License: BSD 3-Clause "New" or "Revised" License

Go 100.00%

datad's Introduction

datad

Build Status

A distributed cache that spreads an existing local data source across a cluster, routes requests for data to the appropriate nodes, and ensures data is replicated and available.

datad was created, and is (almost ready to be) used in production, at Sourcegraph to provide fast, reliable access to 4TB+ of git and hg repository data (files, commits, branches, etc.).

WARNING: This is a very new project. Use at your own risk!

Architecture

  • Data source: any existing local data source, keyed on some function of your choice. E.g., git repository data (keyed on clone URL).
  • Provider: an interface to the data source on the local machine with methods for ensuring a copy of the data exists on disk, updating the data, and enumerating all of the keys of data.
  • Registry: two mappings: (1) for a given data key, a list of cluster nodes that have the underlying data on disk; and (2) for a given node, a list of data keys that it should fetch/compute and store on disk.
  • Node: a member of the cluster that hosts a subset of the data from its local data source, which it continuously synchronizes with the registry.
  • Client: a consumer of the data source that routes its requests for data to the nodes that are registered for any given data key.

Tests

Run go test.

There are also good tests in sourcegraph.com/sourcegraph/vcsstore in the cluster package.

TODO

  • Support keeping a list of data keys that must always be available.
  • Allow nodes to indicate that they are in the process of fetching a piece of data for the first time. As it stands currently, if it takes (e.g.) 5s for the first fetch, and a client requests the key 2x before fetching finishes, then the first request will register the key to the node and the second request will deregister the key from the node (because the key transport notices the node failed to respond successfully). Because registration is done using (pseudo-) "consistent hashing", it usually gets registered to the same node on the next request, and by that time the node has the key, but this still causes unnecessary traffic and errors in the meantime.
  • Allow nodes to indicate they don't want more keys to be registered to them (e.g., when their disk is full).
  • Make the Provider.Keys method return keys as it finds them on disk, instead of waiting until it's found all of them.
  • When the provider is registering existing keys on disk, the watcher catches them and dupes an update. Just make the watcher not watch existing-registered keys.
  • Rebalances continue to reassign to dead nodes.

datad's People

Contributors

sqs avatar

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.