👤 User Guide¶

Bucketfs¶

Depending on the database configuration, the bucketfs setup can range from straight forward to fairly complex. This is due to the fact that:

  • Each database can have one or more BucketFS services

  • Each BucketFS service is available on all worker cluster of a database

  • Each BucketFS service runs on all data nodes of a database

  • Each BucketFS service can have one or more Buckets

  • Each Bucket can hold one or more files

The overview bellow tries to illustrate this in a more tangible manner. For more details on bucketfs, please also have a look in the bucketfs section of the database documentation.

BucketFS Overview

Quickstart¶

from exasol.bucketfs import (
    Service,
    as_bytes,
)

URL = "http://localhost:6666"
CREDENTIALS = {"default": {"username": "w", "password": "write"}}

bucketfs = Service(URL, CREDENTIALS)

# 0. List buckets
buckets = [bucket for bucket in bucketfs]

# 2. Get a bucket
default_bucket = bucketfs["default"]

# 3. List files in bucket
files = [file for file in default_bucket]

# 4. Upload a file to the bucket
default_bucket.upload("MyFile.txt", b"File content")

# 5. Download a file/content
data = as_bytes(default_bucket.download("MyFile.txt"))

# 6. Delete a file from a bucket
default_bucket.delete("MyFile.txt")

Follow Up¶