Distributed Storage Stack
Read and write to multiple storage systems through one simple API.
Currently supports serial and parallel writes to:
Installation
npm install distack
Quick Start
var DSS = require('distack');
var store = new DSS({
{
'tag' : 'local',
'type': 'Disk',
'cfg' : {...}
},
{
'tag' : 'cloud',
'type': 'S3',
'cfg' : {...}
}
});
store.write(['local', 'cloud'], 'myKey', 'my/file', function (err) {...});
try {
var readStream = store.read('local', 'myKey');
} catch(e) {...}
Storage services
Amazon S3
var store = new DSS({
{
'tag' : 'cloud',
'type': 'S3',
'cfg' : {
'key' : '<ACCESS_KEY>',
'secret': '<SECRET>',
'region': '<REGION>1',
'bucket': '<BUCKET_NAME>'
}
}
});
Local Disk Storage
var store = new DSS({
{
'tag' : 'local',
'type': 'Disk',
'cfg' : {
'basedir': './uploads'
}
}
});
License
MIT