vesseldb
v0.0.1
Published
VesselDB = Very Simple Serverless Database
Downloads
1
Readme
Status: on-hold
Version 1.0 is 50%, but I had to stop due to another personal project.
VesselDB
VesselDB: VEry Simple SErverLess DataBase
VesselDB is a key-value serverless database that uses Amazon S3 for storage and AWS Lambda for the database engine.
What is serverless? It's a concept where the developer doesn't need to worry about servers. Configuring, scaling and making them highly available is a resposibility delegated to the cloud vendor.
Requirements:
- Scalability
- High Availability
- Efficient usage of resources
Why it is efficient? Because the code (database engine) instantiated on-demand and you are billed only by the fractions of seconds that it executes.
Use Cases
Storing data in any kind (images, docs, JSON, etc.) with a key-value approach.
Examples:
- Session data
- Profile data
- User files
- Processed documents
Drawbacks
- It's a key-value database.
- Lambda cold start + S3 storage increases its latency.
Advantages
Why use VesselDB and not Amazon's S3 SDK directly? Because it's easier to use. AWS SDK is more complex.
Installing
npm install vesseldb (*not published yet*)
Note: install and configure using Node.js. After deployment, it is accessible from a RESTful API that can be consumed by any programming language.
Commands
// require
var vessel = require('vesselDB');
// create a database
vessel.create('instanceName', callback);
// select a instance to use
vessel.use('bucketName', callback);
// insert a JSON object
vessel.insert({ name: "document1" }, callback);
// insert an array of objects
vessel.insert([{ name: "documentArray" }], callback);
// insert a file
vessel.insert(byteArray, callback);
// find objects or files
vessel.find([ids], callback);
// update
vessel.update([ids], { name: "document2" }, callback);
// delete
vessel.delete([ids], callback);
// drop the database
vessel.drop('bucketName', callback);