Docs

Storage behavior and limits

What a Storage bucket guarantees on every platform, its limits, and how each cloud differs. Each cloud's native service does the storing, so the guarantees come from S3, Cloud Storage, and Blob Storage.

The binding is built on the Rust object_store crate, the object storage layer used by DataFusion and Delta Lake.

Guarantees

Atomic writes. A put either succeeds completely or fails. Readers never see a partial object.

Read after write. After a successful put, every get returns the new data. S3, Cloud Storage, and Blob Storage are all strongly consistent for object reads.

List after write. After a put or delete, list reflects the change.

Conditional create. put with condition: "absent" is atomic. If two callers create the same key at once, exactly one succeeds and the other gets STORAGE_OBJECT_ALREADY_EXISTS.

Durability. S3 and Cloud Storage are designed for 99.999999999% (11 nines) durability. Azure storage accounts use locally redundant storage (LRS), also designed for at least 11 nines.

On Kubernetes, Alien doesn't create the bucket, so these guarantees are those of the service in the external binding. MinIO and other S3-compatible stores may differ.

Limits

LimitValue
Object size5 TB. Larger than 5 GB needs a multipart upload, which only the Rust API exposes.
Object key1,024 bytes of UTF-8
Key charactersUTF-8 without control characters. No empty, ., or .. segments.
Multipart part sizeAt least 5 MiB, except the last part
Resource ID54 characters (it becomes part of the bucket or container name)
Lifecycle rulesAWS: 1,000 rules, days ≥ 1. GCP: 1,000 prefixes. Azure: 100 rules, days ≤ 99,999.

Alien adds no rate limits of its own. Each cloud's request limits apply; see per-cloud details.

Operation semantics

List order. list doesn't guarantee any order. Sort on the client if you need one.

Prefix matching. list matches by path segment: prefix reports/2026 matches reports/2026/q1.json, not reports/2026-old/q1.json.

Copy. copy overwrites the destination. Rust's rename is a copy and then a delete, and isn't atomic.

Multipart uploads (Rust). Parts upload concurrently in any order and the object appears atomically when the upload completes.

ETags and versions. ObjectMeta carries the provider's ETag and version when the backend reports them, and put returns them for the object it wrote.

Deleting a missing object succeeds on S3, Cloud Storage, and Blob Storage. The local backend returns STORAGE_OBJECT_NOT_FOUND.

Object attributes

put can store these attributes:

  • content type, disposition, encoding, and language
  • cache control
  • custom metadata

get and head return them, plus the storage class when the provider reports it. list doesn't return attributes, because cloud list APIs don't.

When a backend can't store a requested attribute, the write fails with OPERATION_NOT_SUPPORTED before any bytes are sent. It never stores the object without the attribute. Two backends reject some attributes:

  • Local rejects every attribute. The filesystem has nowhere to keep them.
  • Cloud Storage rejects contentEncoding: "gzip". It decompresses gzip objects when serving them and drops the response length that byte-exact reads depend on. Other encodings, such as br, work.

Signed URLs

A signed URL is a full request: URL, method, and headers. Clients must send the headers too.

Signed URLs work on every backend. On the local backend the URL uses a local:// scheme that only Alien's local tooling understands.

Lifecycle rules

Each rule deletes objects older than days, under prefix when you set one. Overlapping rules are allowed; S3 applies the shorter expiration.

The build checks rules against the target cloud's limits (STORAGE_LIFECYCLE_RULES_INVALID), so an invalid rule fails before release instead of during initial setup:

CloudChecks
AWSAt most 1,000 rules. days from 1 to 2,147,483,647. Prefix at most 1,024 bytes and only characters XML allows.
GCPAt most 1,000 rules with a prefix. days at most 2,147,483,647. days: 0 expires objects at the first midnight UTC after creation.
AzureAt most 100 rules. days from 0 to 99,999. Checked for frozen Storage only.

CORS

.corsAllowedOrigins(origins) lets browsers on those origins GET and HEAD objects through signed URLs. The rule:

  • allows any request header
  • exposes ETag, Content-Range, and Accept-Ranges
  • is cached for an hour

Signed URLs carry their own credentials and don't use cookies, so * is reasonable for a private bucket.

.corsUploadOrigins(origins) lets browsers on those origins upload with a single PUT to a signed upload URL, such as a presigned S3 URL or an Azure SAS URL. The rule allows PUT with the headers each cloud's signed uploads send, and exposes ETag. Uploads that start with a POST, such as S3 multipart create and complete or Cloud Storage resumable uploads, aren't covered.

Both rules apply on AWS, Google Cloud, and Azure, in every setup method. Local, Kubernetes, and Machines storage ignore them.

  • Origins must be exactly what a browser sends, such as https://app.example.com: no path, no trailing slash, lowercase. A build refuses anything else with STORAGE_CORS_INVALID.
  • Wildcards: S3 allows one * inside an origin. Cloud Storage and Azure only accept * alone or an exact origin.
  • Azure sets CORS once per storage account. The read and upload rules of every container share the account's 2 KiB limit.

Encryption

Every bucket is encrypted at rest. Without .encryptionKey(), each cloud uses its own provider-managed key (on S3, SSE-S3).

With .encryptionKey(key), the bucket encrypts with the customer's Key:

CloudHow
AWSS3 default encryption is SSE-KMS with the key.
GCPThe bucket's default KMS key is set, and the Cloud Storage service agent gets roles/cloudkms.cryptoKeyEncrypterDecrypter on it.
AzureThe storage account uses the key through a user-assigned identity and the key's versionless ID, so a new key version is picked up automatically. The key covers the whole account, so a stack that encrypts Storage with a key can contain only one Storage resource.

Rules for an encrypted bucket:

  • Storage and its Key must both be "frozen".
  • The key can't be added, removed, or changed after the bucket exists.
  • Only AWS, GCP, and Azure support it.
  • If the customer revokes the key, reads and writes fail until they restore it. See Customer-managed keys.

Triggers

A Worker with a storage trigger runs when objects change. Delivery is at least once.

PlatformWiringEvents
AWSS3 event notification to the Lambda functioncreated (s3:ObjectCreated:*), deleted (s3:ObjectRemoved:*)
GCPCloud Storage notification to a Pub/Sub topic that pushes to Cloud Runcreated, deleted, metadataUpdated, archived
AzureEvent Grid subscription on the storage account, delivered through a Service Bus queuecreated, deleted, tierChanged
KubernetesNot supported
LocalAlien's local trigger service watches the directorycreated, deleted

Use created and deleted for code that runs on every cloud. Filter by key with the prefix option of onStorageEvent.

The handler's event.eventType is one of created, deleted, copied, metadataUpdated, restored, tierChanged, or unknown.

On AWS, updating or removing a trigger changes only the trigger's own entry in the bucket's notification configuration. Other entries stay.

A Storage with notifications can't be a storage trigger source. The build fails; consume its queue instead.

Notifications

.notify(queue, rule) puts a StorageEvent into a Queue for each new object that matches the rule. See Notify a queue for the declaration and a consumer.

Rules

A rule matches a key that starts with prefix and ends with suffix. Omit either to match everything on that side.

  • Matching is literal and case sensitive. * and \ have no special meaning.
  • events defaults to ["created"], the only event type. Overwrites count as creations.
  • Rules on one Storage must not overlap: no key may match two rules. uploads/ with .json and uploads/ with .csv are fine. uploads/ and uploads/images/ with no suffix overlap.
  • To send the same objects to two queues, consume one queue and fan out in your Worker.

The build checks every rule, on every platform:

CheckLimit
Rules per Storage10, none overlapping
prefix1 to 512 bytes of UTF-8
suffix1 to 128 bytes of UTF-8
CharactersNo control characters
TargetA Queue in the same stack
LifecycleStorage and Queue both "frozen" or both "live"
PlatformsAWS, Google Cloud, Azure, and Local. Kubernetes and bare metal and on-prem machines refuse notifications.

Delivery

  • At least once. The same object can arrive more than once. Make processing idempotent, for example by recording objectKey and etag.
  • Unordered. Events for different objects, or for successive overwrites of one object, can arrive in any order.
  • The object is the record. Read the current object rather than trusting event fields to describe it.
  • Only new writes. A rule sees objects written after it takes effect. Existing objects aren't replayed.
  • Rule changes take time. Clouds apply new rules asynchronously, which can take several minutes on S3. To catch objects written during a change, list the Storage afterwards.

Other messages in the same queue arrive unchanged, and so does a notification that can't be parsed.

Frozen and live

The bucket's lifecycle decides who owns its rules. See Frozen and live.

  • Frozen. Initial setup creates the rules. Adding, changing, or removing one needs initial setup again: the release reports DEPLOYMENT_SETUP_REQUIRED until the customer's admin reruns it.
  • Live. Alien creates and removes the rules on every release, and touches only the entries it created. A changed rule's new version is created before the old one is removed, so delivery continues, possibly twice for a short while.

On AWS, once a frozen bucket declares notifications, initial setup manages the bucket's whole notification configuration. Notifications added to that bucket outside Alien, such as Lambda, SQS, SNS, or EventBridge targets, are removed the next time the admin reruns initial setup. Use a rule and a queue instead.

Live rules use management permissions Alien adds automatically. If the stack overrides management permissions, keep storage/provision and queue/provision on AWS, storage/trigger-management on Azure, and queue/storage-notifications on Google Cloud. Workers that only consume the queue need no extra permissions.

Per cloud

AWSGoogle CloudAzureLocal
PathS3 to SQSCloud Storage to Pub/SubBlob Storage to Event Grid to Service BusFile watcher to the local queue
Prefix filterIn S3In Cloud StorageIn Event GridIn the watcher
Suffix filterIn S3In the consumerIn Event GridIn the watcher
  • AWS. Each matching object costs one SQS message. Objects no rule matches cost nothing. SSE-SQS encrypted queues work.
  • Google Cloud. Cloud Storage filters only by prefix, so every object under a rule's prefix is published, and the Worker runtime or receive() drops the ones no suffix matches. Each still costs a Pub/Sub message, and a receive(max) call can return fewer messages than are waiting. Pick prefixes that are selective on their own.
  • Google Cloud quota. A bucket allows 10 notification configs, including ones made outside Alien. A Storage uses one per distinct queue and prefix.
  • Azure. All rules share the storage account's system topic. Alien never deletes the topic or subscriptions it didn't create.

Event payload

Every cloud delivers the same StorageEvent:

FieldPresentNotes
eventTypeAlways"created"
bucketNameAlwaysThe bucket or container name
objectKeyAlwaysThe literal key, decoded on AWS
timestampAlwaysRFC 3339, UTC
sizeAWS, Google Cloud, Azure, LocalBytes
etagAWS, Google Cloud, AzureIn the provider's format. Compare ETags only within one cloud.
contentTypeGoogle Cloud, Azure
versionId, currentTier, metadataGoogle CloudGeneration, storage class, custom metadata

Code that runs on every cloud should rely only on the fields marked "Always".

The helpers are storageEventFromMessage in TypeScript and storage_event_from_message in Python and Rust. Each fails with INVALID_STORAGE_EVENT_MESSAGE when a message isn't a storage event. None acknowledges the message: with receive(), acknowledge after processing succeeds.

Local development

Under alien dev, a watcher delivers notifications into the local queue, even while the consuming Worker is stopped.

  • Each rule keeps a cursor in .alien/. Restarting replays nothing already delivered, and objects written while stopped arrive once it's back.
  • A new rule starts from the objects that exist when it starts.
  • The watcher sees the latest state of each object. An object overwritten twice between scans produces one event.

Per-cloud details

AWS (S3)

  • Request rates scale automatically per prefix: at least 3,500 PUT/COPY/POST/DELETE and 5,500 GET/HEAD requests per second per prefix.
  • Versioning, lifecycle rules, CORS, and public read are all supported.
  • publicRead turns off the bucket's public access block and adds a bucket policy that allows anonymous GetObject.

GCP (Cloud Storage)

  • A bucket starts at about 1,000 object writes and 5,000 object reads per second and scales up as load grows. Ramp up gradually, doubling at most every 20 minutes, for sustained high rates.
  • IAM changes can take a minute or more to apply.
  • publicRead turns on uniform bucket-level access and grants allUsers the Storage Object Viewer role (roles/storage.objectViewer), which allows reading and listing objects.
  • contentEncoding: "gzip" is rejected (see Object attributes).

Azure (Blob Storage)

  • Each Storage resource is a container in one storage account per stack. The account is Standard, LRS, Hot tier.
  • A single blob serves up to about 500 requests per second.
  • publicRead sets the container's access level to blob: anonymous reads of objects, not of the container listing.
  • Versioning is an account-level setting on Azure. When the setup template creates the storage account, versioning is on for the whole account if any Storage resource asks for it. When Alien creates the container directly, versioning is ignored with a warning.
  • Lifecycle rules become a storage management policy when the setup template creates the Storage. When Alien creates the container directly, they're ignored with a warning.

Kubernetes

Alien creates nothing. Point each Storage resource at S3, an S3-compatible store (set endpoint, accessKeyId, and secretAccessKey), Cloud Storage, or Blob Storage in the Helm values. See Kubernetes.

Local

  • Objects are files in a directory under .alien/. Durability is that of the local disk.
  • Object attributes aren't supported.
  • Deleting a missing object returns STORAGE_OBJECT_NOT_FOUND.

Design decisions

Built on object_store. A widely used foundation instead of a custom abstraction. Rust code gets the full ObjectStore trait.

No Alien rate limiting. Each cloud's own limits apply. S3 scales per prefix; Cloud Storage needs a ramp. The difference is documented rather than hidden.

Fail instead of dropping attributes. A write that can't keep an attribute fails, so a stored object always has the attributes you asked for.

Permissive keys. Unlike KV, Storage accepts any valid UTF-8 path, to match how file paths are used.

On this page