Giter Site home page Giter Site logo

redio's Introduction

What's this?

A rough draft for a basic IO interface to Redis. It's goal is to provide distributed and fault tolerant temporary file access.

Usage:

# Copy a file from Redis to S3
upload = Net::HTTP::Post.new('12345.txt').tap do |request|
  request.body_stream = Redio::TempFile.open('12345.txt', :client => cluster)
end
response = Net::HTTP.new('amazon_s3').start { |http| http.request(upload) }

See /examples for more.

Components:

### TempFile
  These are stored as Strings, which are limited to 512MB.
    :digest   => md5          - the digest to compare against after closing. If there's a mismatch, an exception is thrown.
    :verifier => digest_class - Whatever was used to generate the digest if not MD5. e.g. Digest::SHA1
    :client   => redis        - A client that supports Redis commands.

### Cluster distributed commands:
  Distributed commands are executed on every node in the cluster.
    :minimum => X - the minimum number of nodes the command must succeed
    :limit   => X - return early after succeeding on X nodes

FAQ:
Q: What happens when one the servers is down?
A: As long as the command executes on the minimum required servers, the failure is ignored.
   If it is unable to execute on the minimum number of servers, the last failure exception is raised.

Q: What if the data is only partially read/written before a server crashes?
A: When a command has error detection enabled, MD5 digests are generated for the inserted values.
   If there is an MD5 mismatch, the command is considered failed.

Q: How does data stay synchronized across servers?
A: Via expiry. Distributing commands across data that isn't simple and expiring is probably a bad idea.

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.