Buckets
Object Storage
Please contact us if you need access to this feature.
Stedi Buckets lets you store files on the Stedi platform. Buckets are typically used in conjunction with Stedi Functions in order to build advanced workflows that aren’t possible with out-of-the-box functionality.
You can upload and download files from bucket with the SDK, the CLI, or the UI.
- Stedi Buckets is a key-value store. Think file system, not database.
- Storage space is unlimited.
- Data is encrypted at rest and in transit.
- Your bucket is not accessible outside of your Stedi account.
Use cases
You can use Stedi buckets in the following scenarios:
- Read and write files using Stedi Functions. You can use events to trigger functions automatically whenever a file is written to a bucket.
- Access files using the Stedi SDK. For example, you could use the Buckets SDK to upload files to a bucket from your local machine or from within a function.
Requirements
Before you can use Stedi Buckets, you need to take care of two things:
Simulating directories
A bucket doesn’t have the concept of directories. All objects are stored in a flat collection.
The key of an object can contain any character, including the /
. This is often used to simulate a directory structure. For example, if the key is /documents/instructions
, you can pretend the object is a file with the name instructions
inside the directory documents
.
This does lead to subtle differences between directory structures and buckets. For example, you can’t have an empty directory in a bucket. You can solve this by creating an object with the directory name as the key, but then you need to make sure you don’t treat the directory as if it is a file.
Using buckets in your workflow
A bucket often serves as a source of input or output for a Stedi function.
You can write a function and create an event binding for the file.created
so that the function triggers whenever a new file is added to a bucket.
You should take extra care when creating new objects in response to a bucket event. If your event handler function writes to the same bucket as it is listening to, this can cause a loop where it triggers more executions of itself. In order to avoid this, use a separate bucket for storing the output data. If you need to store the output in the same bucket, you can use different object prefix paths and explicitly check that the path of an incoming event requires a response in your event handler code.
Security
Buckets belong to a Stedi account. Every member of the account has access to all buckets in the account and to all objects inside those buckets. When you write code that accesses Stedi Buckets, you provide an API key to prove that your code is allowed to access all buckets and objects in your account.
Limits
The Buckets service has a few limits in place on usage. If you are impacted or blocked by any of these restrictions, please let us know and we would be happy to help meet your needs.
Limit | |
---|---|
Maximum buckets per Stedi account | 100 |
Maximum objects per bucket | unlimited |
Maximum object size | 5 Terabytes |