Skip to main content

Buckets

A bucket is an entity that allows you to store assets. Buckets can be used within Sethealth to upload and safely store different assets at different locations, availability, long-term storage and complicance modes. This properties are all further explained below.

bucket

Location#

The location specifies the server location, where the data will be physically stored. We offer several locations in Europe and US.

Server location might be relevant because of legal reasons as well as tecnical ones, notice that a closer location to your clients might reduce the latency.

Availability#

When data is uploaded to Sethealth it will become inmediatelly available for download. However, "availability" lets you specify for how long this data will be generally available.

Once the availability expires, it does not mean that the data will be deleted, it will be still safely stored, but disconnected from the public internet.

The availability specifies the number of months, the data will be accesible.

Long term storage#

Once the availability expires, you might still want to store the assets for much longer. This is generally a requirement for certain medical resources that need to be stored for up-to 10 years in order to be compliant.

This property is defined as number of years.

Compliance#

When enabled, Sethealth makes sure the storage of your data will follow the SEC Rule 17a-4(f), FINRA Rule 4511, and CFTC Regulation 1.31 by Cohasset Associates. This way, you can conform with local regulations about storing medical data in the long term.

Create a bucket#

Alright, now that we are familiar with the most important properties of a bucket, let's create one! In order to create a bucket, go to the dashboard and click the button that says "Create Bucket".

Once the modal appears, all the bucket options must be filled or selected.

  • Name: Bucket's name
  • Description: Bucket's description
  • Storage location: Where the bucket is going to be physically located
  • Availability: How long are the bucket's data going to be easily accesible in months.
  • Long-term storage: How long are the bucket's data going to be stored in years.
  • Compliance: If true, the data cannot be altered. Not even with an admin role.
Create dataset modal

After that, the bucket is ready to be used.

Upload to bucket#

Once a bucket is created, a new bucket ID will be ready to be used within your application. Sethealth API provides more than one way to upload data, but all these methods have an option called bucket. Using this field, you can choose on which bucket data will be uploaded.

import * as sethealth from "@sethealth/core";
// Load a single medical resource from the local system
const medHandler = await sethealth.med.loadFromFilesystem()[0];
// Upload the resource to the specified bucket
const {secret} = await medHandler.upload({
bucket: "bu-5669122872442880";
});
// The secret is a string, that can be used to retrieve the resource through internet in a safe,
// end-to-end encrypted way

In the previous example, a medical resource is loaded from the user's filesystem, then using the MedHandler's upload() method, the data is automatically serialized, anonymized, end-to-end encrypted and uploaded to the specified bucket.

// Let's download the same medical image from the upload's secret
const medHandler = await sethealth.med.loadFromSource(secret);
console.log(medHandler);

Please refer to our guide about sharing data for further detail.