0.1.1 • Published 5 years ago

raics v0.1.1

Weekly downloads
1
License
MIT
Repository
-
Last release
5 years ago

This package is in active development and not production ready. Use at your own risk.

Visit the complete docs for an explantion of what RAICS is.

Getting Started

Install

npm install raics

Usage

var Raics = require('raics');

Setup your services for your cloud providers

// Have as many services from the same cloud provider you want
// Just don't overlap buckets or containers
var azureService = new Raics.AzureService(
  {containerName},
  {connectionString}
);

const s3Service = new Raics.S3Service(
  {bucketName},
  {s3Endpoint},
  {s3AccessKey},
  {s3Secret}
);

RAICS 0 requires at least two providers

var raics0Service = new Raics.Raics0Service([azureService, s3Service]);
raics0Service
// Creates containers and buckets if they don't exist
  .initialize()
  .then(() => raics0Service.putText("fileName", "text"))
  .then(() => raics0Service.getText("fileName"))
  .then((text) => console.log(text));

RAICS 1 requires at least two providers. The order the cloud providers is given is the order they fail over in.

var raics1Service = new Raics.Raics1Service([azureService, s3Service]);
raics1Service
// Creates containers and buckets if they don't exist
  .initialize()
  .then(() => raics1Service.putText("fileName", "text"))
  .then(() => raics1Service.getText("fileName"))
  .then((text) => console.log(text));

RAICS 3 requires at least two providers, but at least three is recommended or it just becomes slow RAICS 0. The last given cloud provider is for parity and is not read from unless another provider is down.

var raics3Service = new Raics.Raics3Service([azureService, s3Service, s3ServiceParity]);
raics3Service
// Creates containers and buckets if they don't exist
  .initialize()
  .then(() => raics3Service.putText("fileName", "text"))
  .then(() => raics3Service.getText("fileName"))
  .then((text) => console.log(text));