Skip to content
Neon Blog· Carlota Soto·· 10d ago

Neon Adds Object Storage That Branches With Your Database

Add files to your branches

Key Takeaway

Neon Object Storage makes buckets belong to a branch, so a child branch inherits every bucket and object from its parent using the same copy-on-write model as Postgres, with no object copying and no extra billing for a 200 GB bucket copy.

Why It Matters

Preview branches isolate file writes and reset their files alongside Postgres, but instant restore rolls back only the database and cannot undo object changes.

Technical Breakdown · Distilled from the original source

Branch isolation and restore semantics

  • A child starts with the parent’s buckets and objects as they exist at fork time. Uploads, overwrites, and deletes on the child are visible only to that branch and its descendants, including changes to inherited objects. Creating or deleting a child bucket does not affect the parent.
  • Resetting from the parent resets buckets and objects along with Postgres. Instant restore rolls back Postgres only, leaving buckets and objects as they are.

S3 clients and migration limits

  • AWS SDKs, boto3, and the AWS CLI can use the branch’s storage endpoint. Set forcePathStyle: true in the JavaScript client. Bucket access is configured in Neon as private or public_read, without an AWS account or IAM policies.
  • Before migrating, check for dependencies on bucket notifications, lifecycle or versioning rules, ACL or bucket policy writes, virtual-hosted-style URLs, and objects over 10 GiB. Preserve object keys, Content-Type, and custom metadata, then verify object counts and total bytes per bucket.

Upload triggers and scheduled jobs

  • storage_object_created invokes a Neon Function when an object is created. A cron-based schedule can clean up temporary objects in place of lifecycle rules. Inherited triggers are disabled on child branches; enable them to test uploads and database writes on the branch.
  • Deliveries can repeat, so keep the handler idempotent. Scope the trigger to a key prefix that excludes the function’s own outputs to avoid triggering it again.
Source: Neon Blog· neon.com

PG Radar summarizes verified changes and impact. Read the original post for full technical details and code samples.

Read Official Source

Related PostgreSQL Reference