Build a customer data export that can support an exit.
An exit export should let another system reconstruct the customer’s business data. Define the approved scope, preserve relationships and object versions, publish a complete manifest, and verify importability independently of the source application.
Inside this article 6 sections +
A customer data export supports an exit when another system can interpret its records, reconstruct relationships, retrieve referenced objects, and verify completeness. A collection of CSV files may satisfy a download button while leaving the customer unable to rebuild the information they depended on.
Design portability as an application capability with an approved scope, a consistent data boundary, documented formats, and controlled access. It should remain usable when the customer is reducing access or preparing to leave.
Define the business model being exported
Consider an illustrative procurement workspace containing suppliers, orders, line items, attachments, and approval history. The customer needs stable identifiers and relationships, not the application's internal database layout. A foreign key without the referenced record is an incomplete handover.
Agree which records, history, configuration, and derived artifacts are in scope. Distinguish customer-owned content from internal operational metadata and secrets. Engineering should implement the approved product and contractual scope rather than making legal assumptions about what every export must contain.
Provide a data dictionary explaining fields, units, timestamps, enums, and nullable values. Identify whether an amount is expressed in major or minor currency units and whether a timestamp is UTC. A technically valid file can still be unusable when these semantics remain implicit.
Choose a consistent snapshot boundary
An export can take long enough for records to change while it runs. Reading orders first and line items later without a consistency plan can produce a package that never existed as a valid application state. Define whether the export represents a point in time or a documented sequence of changes.
For PostgreSQL, transaction snapshots can provide a consistent view, and exported snapshots can coordinate multiple readers under the database's documented rules. An exported snapshot remains available for import only while its exporting transaction remains open. Long-running snapshots also have operating consequences that should be evaluated on the actual database.
For a large export, consider a controlled replica, an application-level version boundary, or a staged snapshot process when appropriate. The design must include changes and deletions that occur during extraction. Do not call a package consistent merely because each individual query succeeded.
Join database records to object versions
Database consistency does not automatically freeze object storage. If an attachment can be overwritten at the same key, the export may retrieve a newer file than the database record describes. Prefer immutable object references or explicit object-version identifiers for the export boundary.
Record each object's logical owner, exported path, media type, byte size, and integrity digest. Verify that every required reference resolves and that no object from another account is included. Missing attachments should appear as a failed or explicitly incomplete export, not disappear silently from the package.
Package paths should be safe for ordinary extraction tools. Avoid absolute paths and parent-directory traversal. Use stable identifiers in filenames and retain user-facing names as metadata when arbitrary names would create collisions or unsafe paths.
Publish a manifest before reporting success
The manifest is the receiver's entry point. Include the export ID, account scope, schema version, requested scope, snapshot marker, generated time, and file inventory. Record counts at a clear grain so “three line items” is not confused with three orders.
The following abbreviated JSON shows a package shape with illustrative counts. It is not a checksum-bearing artifact from a real customer export; a completed package should also carry the actual integrity values for every file.
{
"export_id": "export-demo-42",
"schema_version": 1,
"account_id": "account-demo",
"snapshot_marker": "application-version-812",
"files": [
{"path": "records/orders.jsonl", "record_count": 2},
{"path": "records/line_items.jsonl", "record_count": 3},
{"path": "objects/index.jsonl", "record_count": 2}
]
}
Build files into a private staging location, validate them, and publish the final manifest or download pointer only when the package is complete. A customer should not download a directory while its last files are still being written unless the protocol explicitly supports partial transfer.
Control download access and expiry
Authorize the export request and the later download separately. The person who requested the export may leave the workspace before generation finishes. Decide which current role may retrieve it, and preserve an audit record of the approved operation without logging the package contents.
S3 presigned URLs can provide temporary object access, but they are bearer-style capabilities that must be handled carefully. Their validity is limited by both the requested expiration and the credentials used to sign them; temporary credentials can expire first. Keep package retention and download-link lifetime as separate policies.
Offer a controlled way to obtain a fresh link while the package remains retained and the requester is still authorized. Do not expose permanent public object URLs merely to avoid handling an expired download.
Verify importability with a small receiver
Load a synthetic export into an independent reader or test schema. Check record counts, unique identifiers, foreign-key relationships, object digests, timestamp interpretation, and representative business totals. This reveals whether the format depends on undocumented application knowledge.
Test a missing object, a duplicate record, an unsupported schema version, and a truncated file. The receiver should reject or clearly identify the problem. The resumable import guide helps design the receiving side, while deletion propagation clarifies a separate lifecycle capability that export should not silently trigger.
Architecture design can turn an export feature into a versioned portability contract with consistent snapshots, useful manifests, and evidence that another system can reconstruct the customer's data.