Docs
  • 0.8.1latest
  • 0.8.0
  • 0.7.0
  • 0.6.0
  • 0.5.0
  • 0.4.0
  • 0.3.0-beta
  • 0.2.1-beta
  • 0.2.0-beta

Events, lifecycle and media

Bucket notifications into a TessariDB topic, Kafka or a webhook; lifecycle rules applied once by one node at a time; image and video renditions from a bucket's media rules.

Three kinds of background work, each run through TessariDB: events through a topic, lifecycle and media through queues that hand each piece of work to one node at a time.

Notifications

PutBucketNotificationConfiguration accepts queue configurations. The default destination needs no setting: arn:tessaridb:sqs:::tessaridb is the metadata store's own s3_notifications topic, read by a consumer with a topic group. A destination the operator declared in TESSARIDB_S3_NOTIFY_TARGETS (a Kafka topic or a webhook) is the alternative, named arn:tessaridb:sqs:::<id>, never by an address, so a bucket administrator cannot point the server at a host of their choosing.

Events: s3:ObjectCreated:* (Put, Copy, CompleteMultipartUpload), s3:ObjectRemoved:* (Delete, DeleteMarkerCreated) and s3:LifecycleExpiration:* (Delete, DeleteMarkerCreated), with a prefix and a suffix filter.

  • Every change in a configured bucket is recorded in TessariDB in the change's own commit and delivered as an S3 event record. The sequencer is the event's position.
  • Into the topic it is delivered once per event; to Kafka (keyed by bucket/key) or a webhook at least once, from any node.
  • A refused delivery is retried after a growing wait and given up to a dead-letter topic after 8 tries.
  • An undeclared destination, an unsupported event or overlapping rules are refused InvalidArgument; topic, function and event-bus configurations NotImplemented.

Lifecycle

Rules by prefix with Expiration (days, date, ExpiredObjectDeleteMarker), NoncurrentVersionExpiration with NewerNoncurrentVersions, and AbortIncompleteMultipartUpload. Transitions and tag or size filters are refused NotImplemented.

Rules are applied by a background pass on every node: each bucket with rules is handed to one node at a time through a queue in TessariDB and is due again an hour after each pass. A period runs to the next midnight UTC after its days are up. A current object is expired only while it is still the write that was judged, leaving a delete marker in a versioned bucket.

Media renditions

A bucket's media rules say which content types under which key prefix get which renditions. They are set in the console by whoever configures the bucket and seen by whoever reads it. Each output is written kind/size/format:

OutputMakes
image/1280/webpan image fitted into 1280 px on its long side, never enlarged
image/400x400-cover/avif@60a 400 x 400 image filling the box from the middle, at quality 60
image/800x600/jpegan image fitted inside 800 x 600 (-fit, the default)
image/300x500-exact/pngexactly 300 x 500, its shape not kept
poster/640/jpega representative frame of a video, sized like an image
video/720p/mp4MP4 (H.264 High, 4:2:0, AAC, index first), the shorter side 720
video/480p/webmWebM (VP9, 4:2:0, Opus)
video/360p+720p+1080p/hlsan HLS stream: one H.264 rendition per height in six-second segments under master.m3u8
  • A side or a box side is 16 to 7680 px and a box holds at most 50 000 000 pixels; fit and cover never enlarge, exact does.
  • A quality (1 to 100) applies to JPEG, WebP and AVIF; PNG is lossless and refuses one.
  • A photo is turned upright by its EXIF orientation before it is sized, and no rendition carries the original's metadata (EXIF, GPS, XMP).
  • Video heights are 360p, 480p, 720p, 1080p, 1440p and 2160p, never enlarged; an HLS rung above the original is made at the original's size.
  • Renditions are ordinary objects under <key>.renditions/ (an HLS stream under hls-360p-720p-1080p/); a rendition never gets renditions. They count toward the bucket's stored size and are not refused by its quota: the quota is checked on the writes that bring the originals.
  • A refused output names its reason, such as png is lossless and takes no quality.
  • The console saves the rules with the version it read; a save over rules someone else changed meanwhile is refused 412 stale_media, and nothing changes.

Objects already in the bucket. A new or changed rule applies to what is written from then on. To give the objects already there their renditions, whoever configures the bucket presses Render existing objects (or POST /api/v1/buckets/{bucket}/media/sweep): the bucket is planned a hundred keys at a time, the console shows how many objects were listed and renditions queued, and a rendition already made since its original is not made again. A sweep survives a node restart; started again, it begins from the first key.

Every node plans the objects the metadata store's media group hands it into tasks in the media_images queue; any node's workers render them (TESSARIDB_S3_MEDIA_WORKERS, 2 by default). Video work runs only on nodes given an ffmpeg (TESSARIDB_S3_FFMPEG), as its own process, stopped after 50 minutes; the published image carries none. A failed task is tried again after a growing wait and stays listed in the console after five tries.