Files and Folders
Vendia supports working with all the standard JSON Schema scalar types, including strings, numbers, and Boolean values, as well as formatting extensions for specialized string types, such as URLs and date/time formats. However, multi-media files such as images and videos, large data files such as machine learning training sets, and other objects cannot be easily represented as any of these scalar types, nor can they be cost effectively stored in a database - even a serverless and NoSQL database.
To address this, Vendia provides full, built-in support for working with these objects, known as “files”. The files themselves are stored in the cloud service provider object storage service (e.g. Amazon S3 on AWS), while metadata representing the object, including its provenance, is stored in the blockchain database. Despite the differences in storage technologies used, Vendia ensures that all data appears “on chain”, including a full, consistent history, built in tamperproofing, and ownership tracking.
Vendia’s approach to file storage has several benefits:
- Cost effective - Because the “cost per bit” in file storage is much lower than storage in cloud databases, this representation provides a significant cost savings versus attempting to store large objects directly in a database.
- Simple - Because Vendia manages the files directly, no special code is required in the copying case, and few or no code changes are required to support links. File support is automatically built into all Vendia unis; no special action is required to enable it. Deletion, versioning, lineage tracing, tamperproofing and other capabilities are all automatic.
- Safe - Unlike manual (“off chain”) management of file links in strings, using Vendia to manage files provides synchronized updates and safe, secure access to previous versions. Because the storage is automatically managed, common mistakes - such as accidental public exposure of data - is greatly minimized.
Using File Types
Files in Vendia blockchains are modeled as a “control” type that provides sufficient information to copy the object from its original source location to an “on-chain” location, and then to use it securely once there. To add a new file type, issue the following mutation:
In addition to creating files through the addVendia_File
mutation, you can update
files using updateVendia_File
, delete them using removeVendia_File
, retrieve their
metadata using getVendia_File
, and list the available files using listVendia_FileItems
. To
learn more about the File API, methods, properties and limits, see the
File API documentation.
You can also use the cloud resource created by Vendia directly to list and retrieve file objects. However,
you cannot make PUT calls (or other changes) directly to the Vendia-managed cloud resource. Instead,
make those changes to an external cloud resource for the Cloud Service Provider you use and then instruct Vendia to perform an add
or update
.
The cloud resource used to store Vendia file objects is versioned. Updates and deletions preserve previous versions, all of which remain available.
Granting Permissions to the Source Data
For specifics on how to configure your cloud resources to be used as source data for Vendia Files mutations, see Getting Started with Files.
Reading File Data
For specifics on how to consume the data written to the Vendia-managed cloud resources for your node, see Reading File Data.
Next Steps
Integrating a Vendia chain with other Cloud, Web, and Mobile Services