Skip to content

Backup & restore

fdyno has four recovery tools and one export. Pick by the failure you must survive:

You need to recover from Use Why
A bad write, delete or DeleteTable, to any second in the last 1 to 35 days Point-in-time recovery Opt-in per table; history inside the same cluster. Restore runs in a background job.
A bad deploy or a mistaken delete, with the cluster healthy CreateBackup and RestoreTableFromBackup Fast table copies inside the same FoundationDB cluster.
Loss of the cluster, for one table dynodb backup export, store the archive elsewhere, then import and restore A portable archive of a completed backup.
Loss or corruption of the whole database FoundationDB-native backup to independent storage Covers every table, plus tokens and worker state. Acknowledged writes after the latest restorable point may be lost; sudden-loss RPO was not measured.
Analytics, or a copy in DynamoDB's own format Export to S3 One PITR table at a point in time, as DYNAMODB_JSON files in S3 or a directory.
A new table from DynamoDB JSON, ION or CSV files Import from S3 Reads files in S3 or a directory, such as an export from DynamoDB or fdyno.

An on-demand backup lives in its table's FoundationDB cluster and is lost with it, unless you export it or use native backup.

Create a backup

CreateBackup copies the table's items, metadata and TTL setting into a new backup and returns once it is complete.

arn = client.create_backup(TableName="orders", BackupName="orders-2026-03-04")["BackupDetails"]["BackupArn"]
client.describe_backup(BackupArn=arn)   # BackupStatus: AVAILABLE
  • Consistency. Every page is read at one read version (SNAPSHOT). FoundationDB keeps old versions for about five seconds. If the read takes longer, later pages use fresh versions (ROLLING). Each item is then a committed version, but items can come from different instants, as in DynamoDB's on-demand backups. BackupDetails.Consistency says which. A backup that changed to fresh versions is always ROLLING in DescribeBackup, ListBackups and its archive. No setting skips the single-version attempt.
  • Contents. Items, table metadata and TTL; indexes are rebuilt on restore. Not stream records, tokens, worker state or other tables.
  • Names. A name maps to a fixed ARN, so a second backup with the same name fails with ResourceInUseException. After a lost response, describe the expected ARN before you choose another name.
  • Cost. One full read and one full copy in the same cluster, with memory bounded to a few pages. Reads run in key order and overlap staging writes.
  • Source table. A missing table fails with TableNotFoundException. A table that is still CREATING, such as a restore or import target, fails with TableInUseException.
  • Retention. Until DeleteBackup; no scheduled expiry.
  • Listing. ListBackups with a time range includes a backup created exactly at TimeRangeLowerBound and excludes one created exactly at TimeRangeUpperBound.

A backup is visible only when complete; a worker removes the hidden staging data a crash leaves.

Restore a table

RestoreTableFromBackup creates a new table from a backup. The target name must not exist. As in DynamoDB, both restore APIs fail with TableAlreadyExistsException when a table has the name, and with TableInUseException when that table is still CREATING (the target of another restore or an import).

client.restore_table_from_backup(TargetTableName="orders-restored", BackupArn=arn)
client.get_waiter("table_exists").wait(TableName="orders-restored")
Step What happens Target If it stops here
Accept One transaction checks the name, creates the target as CREATING (closed to data operations), records the restore job and pins the backup. The request returns CREATING, as in DynamoDB. CREATING Nothing stays if the admission does not commit.
Apply pages Each transaction reads one backup page, checks the backup's pin and generation, and writes the page's items with the job's progress. Each item, with its index entries in the target schema, must fit one FoundationDB transaction. CREATING A crash resumes on another process. DeleteTable cancels the restore. For a deletion-protected target, DeleteTable is refused while its restore job can still run. DeleteBackup returns BackupInUseException. An item that does not fit, a page too large for one commit, or a corrupt backup page fails the job and deletes its own CREATING target.
Complete The read past the last page starts one backfill per GSI and releases the backup's pin, in that page's transaction. CREATING The GSI backfill worker resumes the backfills.
ACTIVE The target becomes ACTIVE when every GSI is ACTIVE (at once without a GSI), as in DynamoDB. Wait for ACTIVE. ACTIVE

A portable archive from an older store can be imported if its items fit the current limits.

What a restore keeps

Property Restored
Items, keys, GSIs and LSIs Yes; indexes are rebuilt from the items. An index override can leave some out.
Billing mode, throughput Yes, unless overridden.
Table class Yes; a restore cannot override it.
Deletion protection Yes; a restore has no override for it. DeleteTable refuses a deletion-protected target while its restore job can still run. Once that job has failed, DeleteTable removes the CREATING target without clearing the protection first. This also holds after cleanup has removed the failed job's record, at least 24 hours after the failure.
TTL setting and tags Yes; normal TTL visibility applies.
Stream setting and records No. Enable a new stream after you validate the table.
Resource policy No.
PITR flag Cleared.
Table ARN, ID and creation time New for the target.

A restore writes no stream records.

Point-in-time recovery

See the recovery window rules and deleted-table backup retention.

Turn it on per table, then restore any second of the window into a new table. If an update reports an unknown outcome, check DescribeContinuousBackups and the table identity before resending it. An internal retry cannot change a replacement table or reapply a change over a newer PITR setting.

client.update_continuous_backups(TableName="orders",
    PointInTimeRecoverySpecification={"PointInTimeRecoveryEnabled": True, "RecoveryPeriodInDays": 35})
client.restore_table_to_point_in_time(SourceTableName="orders",
    TargetTableName="orders-restored", RestoreDateTime=datetime(2026, 3, 4, 9, 30))
client.get_waiter("table_exists").wait(TableName="orders-restored")
Step What happens Target
Item write The item and its undo record commit together. Pictured: PITR on; a restore that completes. none
Restore to T Admission creates the job and a CREATING target, then the request returns. Data reads and writes on the target stay blocked. CREATING
Copy The worker copies the live table into the job's hidden map. CREATING
Find the cut Reading the undo log backwards, the first record stamped at or before T sets the cut: its whole transaction. In this example a retained record qualifies. CREATING
Recopy, if needed Only when the cut is newer than the first copy page's version: clear the map and copy again. CREATING
Undo Undo puts back old images, or removes an item that had none, newest first, down to the cut. If trimming has not passed the cut, the map is final. CREATING
Apply pages The final map is written into the target. CREATING
Publish The target becomes ACTIVE once its GSIs are built. ACTIVE
Topic Behavior
Window EarliestRestorableDateTime: the latest of the enable time, now minus RecoveryPeriodInDays (1 to 35, default 35), and the retained-history floor. Increasing the period does not recover trimmed history. LatestRestorableDateTime: now (DynamoDB: about five minutes ago). Disabling deletes the history; a shorter period applies at once.
Result One consistent state: the table immediately after the newest transaction with a change stamped at or before T. Each process stamps changes with its clock, so a write within the clock difference of T can land on either side.
Write cost PITR writes one undo value with the old image when present. In a Go encoder test with a 232-byte encoded item, PITR added 66 B of submitted mutation arguments for an insert and 286 B for an overwrite or delete. The overwrite went from 247 B to 533 B (2.16× in this test). These are argument bytes, not disk or wire bytes. Writes that otherwise skip the item read (no index, stream or TTL) read it with PITR on. Tables without PITR do not write undo records.
Storage Old images of every change in the window plus DYNODB_CDC_TRIM_SKEW_MARGIN. The trimmer deletes older history.
Restore cost Reads the live table and undo history to select the cut, then undoes newer changes. Copies the table again if the cut falls inside the first copy. Fenced background pages checkpoint copy, cut search, undo and apply; the request timeout does not bound the full restore.
Target The source's current settings, as in what a restore keeps. Admission atomically creates the job and a CREATING target. Data reads and writes stay blocked until the complete result publishes ACTIVE. RestoreSummary names the source and T.
Deleted tables DeleteTable keeps the data as SYSTEM backup <table>$DeletedTableBackup for 35 days: list with BackupType=SYSTEM or ALL (the deleted table's name still filters the list), and restore with RestoreTableFromBackup. As in DynamoDB, DeleteBackup refuses it with ValidationException ("User is not allowed to delete the system backup ... It will automatically expire on ..."). Only the expiry pass after its 35 days removes it, and that pass waits while a restore reads it.
Errors An invalid or trimmed time fails preflight before admission. After admission, loss of needed history, source deletion or a PITR off/on before immutable staging fails the job and removes only its own CREATING target. A PITR change after immutable staging does not invalidate that exact result. No failed job publishes partial data.

The history lives in the table's cluster and is lost with it. A preflight does not pin it against later trimming.

The first staging page of each worker pass checks the retained-history floor. If that floor has passed the target time, the job fails with PointInTimeRecoveryUnavailableException before doing more staging work. Equality remains valid. Trim after that check can still fail the job later. Immutable apply does not depend on the source history.

Wait for ACTIVE; a retry after a lost reply can report ResourceInUseException because the first request already accepted the target. Inspect that target instead of starting another copy.

PITR restores are asynchronous. The table stays CREATING until the worker finishes. The request budget covers admission, not the full background copy; it does not impose a restore-size limit.

DeleteTable of the source does not stop a running restore, as in DynamoDB. The target stays CREATING and listed, then becomes ACTIVE with the source as of the restore time. The deleted table's data stays in its SYSTEM backup (<name>$DeletedTableBackup). Until the restore leaves the source, the expiry of that backup waits. DeleteBackup never removes a SYSTEM backup. Turning PITR off on the source still fails the restore.

The worker keeps small terminal job records for 24 hours. Bounded cut-search pages keep full payload/digest checks. Recovery continues after its last attempted job in the next local pass; that advisory position can reset on restart. This is not a completion bound for arbitrary history, latency or job counts.

How a restore finds the cut

With PITR on, a write logs one undo record per item change in its own transaction. A write over an expired item logs the TTL delete, then the write (writePITRRecord). The record key is a versionstamp, so records sort by commit version, then by their order in the transaction. The value holds the item key, the old image (none for an insert) and the writer's clock stamp. Large records use chunk keys. The records of one transaction can carry different stamps.

Moment Undo log, by transaction Copy pages Job's map Why
Copy starts t1 (stamp ≤ T) first page, at Vs the first page's items Each page is one transaction at a fresh read version; the copy records the first page's version, Vs. Pictured: four transactions; t2 commits after Vs; trimming does not reach the cut.
Copy t2 (stamp ≤ T), t3 (> T), t4 (> T) later pages each page's items, at that page's version Each change's undo record commits in the same transaction as the change.
Copy ends empty page, at Ve The empty page that ends the copy records Ve.
Find read back from Ve: t4, t3, then t2; cut = t2 The first record stamped at or before T sets the cut: its whole transaction.
Recopy the cut is newer than Vs: copy again cleared, then copied again An early page misses changes made between its version and the cut, and undo cannot add them back. Every new page reads after the cut.
Undo t4, then t3, newest first, down to the cut each key as it was at the cut Each record puts back its old image, or removes the item if it has none. The last image put back for a key is the oldest one above the cut.

A restore to T runs these steps. Each page commits in its own fenced transaction with the job's cursor (pitr_jobs.go).

Step What it does
Copy Copies the live table into the job's hidden map, one page per transaction at a fresh read version. It records the first page's version (Vs) and the version of the empty page that ends the copy (Ve).
Find Reads the undo log backwards from Ve. The first record stamped at or before T sets the cut: its whole transaction, by commit version and order within that commit, so the cut never splits a transaction. A later transaction with the same commit version is above the cut and is undone. If no retained record qualifies, the cut is the newest trimmed version; the job fails if that version is after Ve or the trimmed history reaches past T. The job also fails if trimming already passed the cut. Each page fetches up to 200 log entries and stops processing them after about 4 MiB of record payload; this is a processing budget, not a cap on bytes read from FoundationDB. If nothing was trimmed either, there is no cut and the undo covers the whole log.
Recopy If the cut is newer than Vs, the job clears the map and copies again, as in the figure. It then goes straight to Undo; Find does not run again.
Undo Reads the log backwards from Ve to the cut, as in the figure. The result is each item as it was at the cut.
Check In the transaction of the last Undo page, rereads the trim head. If trimming passed the cut, the job fails. Otherwise the map is final.
Apply Writes the final map into the CREATING target, whose data reads and writes stay blocked. The job completes with the last page, which starts one backfill per GSI; the target publishes ACTIVE when every GSI is ACTIVE.

The PITR model breaks in each of these cases:

  • undo runs oldest first;
  • the cut splits a transaction;
  • the recopy is skipped;
  • the trim head is not checked;
  • a page does not check that PITR is still on with the same start.

Cost of PITR

Size storage input and undo cleanup separately. The local PITR overwrite A/B test used pre-v0.1 build 2d3d9a0e. That build also wrote an extra write record for every write request; v0.1 does not. The test ran 1 KiB overwrites with two ALL GSIs at 800 writes/s. They added about 3.1 KB of storage input per write on one storage role. That was 25.3% more with the separate record layout and 27.2% more with the expiry-inline layout.

Storage input is the FoundationDB storage role's counter, not disk, wire or billed bytes.

Separate observer runs at 400 writes/s captured one extra versionstamped FoundationDB mutation and about 1,142 extra mutation argument bytes per write. This measures the undo record for these overwrites, not the cost of inserts, which have no old image, or the bytes of large undo records.

With the separate record layout, PITR on and off both met the 25 ms write-p99 target at 1,600 offered writes/s in both run orders. At 800 and 1,200 writes/s, at least one run missed the target. The highest tested rate was a passing point, not a capacity rating. These runs did not establish a throughput gain or loss. See the undo cleanup budget for when eligible undo records can accumulate.

Encryption and capacity overrides

SSESpecificationOverride and OnDemandThroughputOverride apply to the target. The production profile refuses a target that would carry KMS encryption settings or a positive throughput ceiling. To restore such a backup in production, pass SSESpecificationOverride with Enabled: false and set every ceiling to -1.

Index overrides

GlobalSecondaryIndexOverride and LocalSecondaryIndexOverride select which source indexes the target gets. Both restore APIs accept them.

Request Target
Field omitted Every source index of that kind.
Empty list No index of that kind.
A list Exactly the listed indexes.

Each listed index must match a source index in name, key schema and projection. A projection matches when it has the same type and, for INCLUDE, the same set of attribute names. Capacity settings in the list are not part of the match. A name, key-schema or projection mismatch, a duplicate name or an invalid projection returns ValidationException before the restore creates a target.

For RestoreTableToPointInTime, SourceTableArn must be a table ARN: arn:<partition>:dynamodb:<region>:<12-digit account>:table/<name>. An index, stream or backup ARN returns ValidationException; fdyno does not strip the suffix and restore the parent table.

Export to S3

See the export job limits and retention and incremental window checks.

ExportTableToPointInTime writes a PITR table, as it was at ExportTime, in DynamoDB's export layout, in DYNAMODB_JSON or ION. An incremental export writes only the items that changed in a time window. Athena, Glue, dynodb migrate and other readers of DynamoDB exports read both as is.

client.export_table_to_point_in_time(TableArn=arn, S3Bucket="analytics",
    S3Prefix="orders/2026-03-04", ExportTime=datetime(2026, 3, 4, 9, 30))
Step What happens Export job
Request After its checks, the request creates the export job and replies. Pictured: a full export in DYNAMODB_JSON that completes. IN_PROGRESS
Find the cut The export worker finds the cut for ExportTime. IN_PROGRESS
Write data files The worker reads the table at the cut and writes data/*.json.gz. A file ends after the item that brings its uncompressed lines to 16 MiB, or at the end of the table; an empty table gets one empty data file. IN_PROGRESS
Manifest The worker writes manifest-files.json. IN_PROGRESS
Summary The worker writes manifest-summary.json, last. IN_PROGRESS
Completed The job is COMPLETED. Use the output only now; a summary alone does not prove success. COMPLETED
Topic Behavior
Destinations Only buckets DYNODB_EXPORT_DESTINATIONS lists, each an S3 bucket and prefix or a file:// directory; any other S3Bucket fails with LimitExceededException.
Layout <S3Prefix>/AWSDynamoDB/<ExportId>/: _started, data/*.json.gz (one {"Item":...} per line) or data/*.ion.gz (one $ion_1_0 {Item:{...}} per line), manifest-files.json, manifest-summary.json and their .md5 files. The summary is written last. An empty table gets one empty data file.
Point in time The same cut as point-in-time recovery. ExportTime defaults to the request time and must be in the PITR window.
Supported FULL_EXPORT and INCREMENTAL_EXPORT, in DYNAMODB_JSON or ION (DynamoDB's mapping: numbers as decimals, binary as blobs, sets as lists annotated $dynamodb_SS, $dynamodb_NS or $dynamodb_BS).
Incremental IncrementalExportSpecification sets the window [ExportFromTime, ExportToTime): at least 15 minutes and at most 24 hours, inside the PITR window. ExportToTime defaults to the request time. One line per changed item: Metadata.WriteTimestampMicros (its last change in the window), Keys, OldImage (before the window; only with the default ExportViewType NEW_AND_OLD_IMAGES) and NewImage (at the end; absent if deleted). An item inserted and deleted in the window gives no line. Data files go to the shared <S3Prefix>/AWSDynamoDB/data/, as in DynamoDB. The summary has exportFromTime, exportToTime, outputView and exportType.
S3 Credentials come from the process's AWS credential chain, never the request. S3SseAlgorithm, S3SseKmsKeyId and S3BucketOwner go to S3 as headers it enforces; a file destination refuses them and any S3Prefix that is not a clean relative path.
Progress DescribeExport and ListExports report the job's status and type (FULL_EXPORT or INCREMENTAL_EXPORT). The worker runs every DYNODB_RESTORE_RECOVERY_INTERVAL on each process listing the bucket, one per job lease; if it stops, another resumes after the lease (3 minutes) from the last committed file checkpoint, not necessarily the last object written.
Cost A full export reads the live table once; incremental reads its window changes and changed items. Before the first page, both drain the undo tail since the historical cut, even on a quiet table. The delta retains full first old images per changed key until completion, so time and scratch can approach a full-table reconstruction if most keys changed since the cut. Incremental also retains its window change map (keys, first old images, last-change stamps).
Failures FailureCode can be S3NoSuchBucket, S3AccessDenied or S3Error from S3; TableNotFound if the source is deleted or loses PITR; InvalidExportTime if required history was trimmed; or ExportFailed after five failed attempts before summary publication, or after 24 hours in which no worker could verify the pinned destination. An export stays IN_PROGRESS while fdyno removes an earlier summary from its recorded destination. After five unsuccessful attempts to confirm publication, the result is FAILED with PublishOutcomeUnknown. manifest-summary.json may exist. A failed export can leave data files. Use the output only when DescribeExport shows COMPLETED; a summary alone does not prove success.
Idempotency The same request and ClientToken within 8 hours of the token's first request return the original export, even if the source table was deleted or its PITR window changed. Reusing the token with different parameters fails with ExportConflictException.
Retention A COMPLETED or FAILED export record becomes eligible for removal 90 days after its last update, which is normally when it finished. The export worker removes it on a later pass; until then DescribeExport and ListExports still return it. IN_PROGRESS records are never removed. Removing the record does not delete any destination objects. Separately, failure cleanup can delete a tracked manifest-summary.json (see Failures).

When DYNODB_EXPORT_DESTINATIONS maps a logical bucket to an S3 bucket and prefix, such as s3://bucket/mapped, add a prefix to the output keys. Prepend mapped/ to ExportManifest and to each data key in manifest-files.json. This does not apply to file:// destinations, which have no mapping prefix.

For file:// exports, every process that can accept or run the job must use the same writable directory on shared storage. Identical paths on separate local disks are not shared storage.

New exports pin the directory's .export-root-id marker at admission. A worker skips the job if it cannot read the pinned marker or if the marker differs. These skips do not count as failed attempts, because another worker may still see the root.

After 24 hours with no worker able to verify the root, the export fails as described under Failures above. A worker that verifies the root restarts the 24 hours. Workers measure the 24 hours with their own clocks, so a clock difference between processes changes it by that difference. Restore access to the original directory within that time. Do not delete the marker or copy it to a different root.

A job whose bucket is in no process's DYNODB_EXPORT_DESTINATIONS stays IN_PROGRESS; put the bucket back in DYNODB_EXPORT_DESTINATIONS to resume it. Time while no process has the bucket still counts toward a loss that was already recorded.

What a partial export leaves in the destination

fdyno writes an export's objects phase by phase, in this order. A job that fails, or is still IN_PROGRESS, leaves the objects of the phases it reached. Keys below are under <S3Prefix>/AWSDynamoDB/; ION exports use .ion.gz.

Phase Objects it writes
STAGING <ExportId>/_started
COLLECTING Incremental only; nothing new in the destination
WRITING Data file n, then its entry commits with the cursor; repeat. Full: <ExportId>/data/00000000.json.gz, 00000001.json.gz, ... Incremental: data/<ExportId>-00000000.json.gz, ...
MANIFEST <ExportId>/manifest-files.json, manifest-files.md5, manifest-summary.md5
PUBLISH <ExportId>/manifest-summary.json, then the job is COMPLETED
Topic Behavior
File numbers File n is the export's committed file count when the worker starts it, in eight digits. A file ends after the first item that brings its uncompressed lines to 16 MiB, or at the end of the table. An empty table gets one empty file.
Resume A worker writes file n, then commits its entry and the new cursor in one transaction. If that commit fails or the lease moves, the next worker writes file n again, at the same key. The file's items depend only on the cut and the cursor, and the gzip header is fixed, so between processes of one release the rewrite has the same bytes. An export has no duplicate data files, and at most one file past its committed count.
DescribeExport COMPLETED gives ExportManifest (the summary key), ItemCount and BilledSizeBytes. FAILED gives FailureCode, FailureMessage and EndTime, without a manifest key or counts.
Read an export Start from manifest-summary.json of a COMPLETED export. Its manifestFilesS3Key names manifest-files.json, with one line per data file: itemCount, md5Checksum, etag and dataFileS3Key. Read only the files it lists. Do not list data/ instead: incremental exports under one S3Prefix share AWSDynamoDB/data/, failed ones included. manifest-summary.md5 is written before the summary, so it does not show that a summary exists.
Remove a failed export fdyno deletes no data files. The export ID is the part of ExportArn after /export/. Remove <ExportId>/ and, for an incremental export, data/<ExportId>-*. With a mapped S3 prefix, prepend it as described above.

See export_jobs.go (dataFileKey, writeNextFile, writeManifests, publishSummary, description).

Import from S3

See the import job limits and the S3 listing reader.

ImportTable creates a new table and fills it from the objects under S3KeyPrefix. A DynamoDB or fdyno export's data files import as they are.

client.import_table(
    S3BucketSource={"S3Bucket": "analytics", "S3KeyPrefix": "orders/2026-03-04/AWSDynamoDB/01234-abcd/data/"},
    InputFormat="DYNAMODB_JSON", InputCompressionType="GZIP",
    TableCreationParameters={"TableName": "orders-copy", "BillingMode": "PAY_PER_REQUEST",
        "AttributeDefinitions": [{"AttributeName": "pk", "AttributeType": "S"}],
        "KeySchema": [{"AttributeName": "pk", "KeyType": "HASH"}]})
Step What happens Table Import job
Request After its checks, the CREATING table and the IN_PROGRESS import job commit together, and the request replies. Pictured: an import that completes. CREATING IN_PROGRESS
List objects The import worker lists the data objects under S3KeyPrefix. CREATING IN_PROGRESS
Load batches The worker reads each listed data object's records in batches. Each batch commits with its cursor before the next is read. CREATING IN_PROGRESS
Completed After the last batch, each GSI is built from the items. The table is ACTIVE once every GSI is ACTIVE, and the job is then COMPLETED. ACTIVE COMPLETED
Topic Behavior
Sources As for exports: only listed buckets. A file source refuses an S3KeyPrefix that is not a clean relative path.
Objects Every data object under S3KeyPrefix, in key order, up to 50,000. Export metadata (_started, manifest-files.json, manifest-summary.json, *.md5, *.checksum) is skipped. The worker filters each S3 listing page before it opens any object.
Listing pages The worker requests up to 1,000 keys per ListObjectsV2 page, reads at most 64 MiB of each reply, and stages data pins in batches of 500. It opens no data object until it receives an explicit final page and has placed all pins in key order. An empty final page is valid.
Invalid listing An XML decoding error in the list result, an IsTruncated flag that is missing, repeated, or not true or false after trimming white space, or an inconsistent continuation token prevents loading. A truncated page needs one nonempty token that differs from the previous one; a final page must omit the token element. The worker retries from the beginning. After five counted failures, it starts the failure path with code ImportFailed and the last error. Correct the S3 endpoint or proxy reply, then retry with a new ClientToken once cleanup frees the name.
Identity Pins the physical source mapping at admission, then each object's ETag and stored-byte size before loading. Every S3 reopen uses If-Match and checks response tag/length. ETag is opaque, not a byte checksum (including multipart and KMS objects). A changed or unverifiable object ends the import; no new identity is adopted for a committed prefix. This is not an atomic snapshot of the whole prefix.
Local scratch A file:// source is copied to private, immediately unlinked scratch and SHA-256/size-verified before any batch. It needs space for the whole object. Set DYNODB_IMPORT_SCRATCH_DIR on a writable disk-backed volume; the default system temp may be RAM-backed. S3 streams without this copy.
Formats DYNAMODB_JSON (one {"Item":...} per line), ION (DynamoDB's export ION), CSV. Compression GZIP or NONE refers to stored bytes, not HTTP Content-Encoding; ZSTD fails with ValidationException.
CSV Each object's first row is its header unless InputFormatOptions.Csv.HeaderList gives one. Delimiter: , ; : \|, tab or space. Keys take their AttributeDefinitions type, other columns are strings, and an empty cell is absent.
Bad records A record that cannot be parsed or stored (no key, wrong key or index key type, over 48,000 bytes) is skipped, counted in ErrorCount and logged by the process (there is no CloudWatch log group). In ION, a parse error ends that object as one error.
Duplicates A key that appears again replaces the earlier record: the record read last wins.
Table CREATING, closed to data operations, until the import ends; GSIs in TableCreationParameters are built from the items before the table becomes ACTIVE and the import COMPLETED. To cancel an import that is still listing or loading, delete its CREATING target. The worker records FAILED (TableDeleted) when it sees the target is gone.
Waiting for a mapping A process with an unlisted or remapped source skips the job without changing its cursor. If none matches, it stays IN_PROGRESS with a CREATING target. A rate-limited log names the import and mismatch. Restore the original mapping to resume, or cancel the import as above. A worker can observe the deletion without a matching source, possibly after lease expiry.
Progress DescribeImport reports ProcessedItemCount, ImportedItemCount, ErrorCount and ProcessedSizeBytes; ListImports returns summaries without them. A takeover during listing discards the incomplete list and starts it again. During loading, each batch commits with its cursor, so a takeover resumes from the last batch.
Failures FailureCode S3NoSuchBucket, S3NoSuchKey, S3AccessDenied or S3Error from S3; InvalidCompression for an object that is not GZIP; ImportFailed for changed/unverifiable sources, local scratch failures, more than 50,000 objects or five retryable failures.
Target cleanup The job stays IN_PROGRESS while the worker retries removing its original CREATING target without opening the source. If the target is gone, the worker reports the original failure. After five counted cleanup failures with the target still present, DescribeImport reports FAILED with TargetCleanupFailed, the table name and its TableId.
Idempotency, retention As for exports: the same request and ClientToken within 8 hours of the token's first request return the original import, and reuse with different parameters fails, here with ImportConflictException. A COMPLETED or FAILED import record becomes eligible for removal 90 days after its last update.

Off-host copy

dynodb backup export writes a completed backup to a portable archive, and import loads it into another cluster, both directly through FoundationDB. To copy from DynamoDB, see migrate from DynamoDB.

# On the source cluster
dynodb backup export "$SOURCE_ARN" --cluster-file /abs/source.cluster --out /secure/copy.tar

# Move the archive over an encrypted channel to independent storage, then:
IMPORTED_ARN="$(dynodb backup import /secure/copy.tar --cluster-file /abs/target.cluster \
  --backup-name recovered-copy | jq -r .backup.backup_arn)"
dynodb verify backup "$IMPORTED_ARN" --cluster-file /abs/target.cluster

Then restore the imported backup through the API, wait for ACTIVE, stop writes and workers on the target, and compare:

dynodb verify restore "$IMPORTED_ARN" restored-table --quiesced --cluster-file /abs/target.cluster
  • Import uses a new backup name, never overwrites one, and keeps the SNAPSHOT or ROLLING label.
  • Import checks every page's SHA-256 before it touches the target: that detects corruption, not tampering. The archive is not encrypted; protect it at rest and in transit.
  • --quiesced states that writes are stopped; the tool does not check it (verify stored data).
  • Both print a JSON report and exit 1 on error. Check a failed import with DescribeBackup before you retry.

What the archive holds

An archive is a USTAR tar file with regular members in a fixed order. Export writes the stored page bytes as they are; it does not decode and re-encode them.

Member, in order Holds
manifest.json At most 1 MiB: archive_version 1, page_encoding FDYNOB01, export time, fdyno build, the backup's stored metadata
page-000000000.bin, page-000000001.bin, ... One backup page each: FDYNOB01, item count, then length-prefixed items
SHA256SUMS A line <sha256>, two spaces, <name> for manifest.json, then each page in order
Two zero blocks The tar end marker
Step What it does
Export source A completed backup in storage format 3; another format is refused. Each newly exported page is at most 100,000 bytes. Export first audits the page inventory. It reads up to 4 pages ahead, each in its own batch-priority read transaction, and checks each page's key, digest and item framing. At the end it checks that the item and byte totals match the backup's metadata, and that the backup was not deleted and re-created under the same name during the export.
Export destination --out must not exist. Export writes a private temporary file in the same directory, syncs it, and then links it to the final name, so the name appears only when the archive is complete. On error the temporary file is removed.
Import check Import first copies the archive to an unlinked private temporary file and checks all of it before it opens FoundationDB: member names, order, types and sizes; the manifest fields and identity; each page's framing; the item and byte totals; SHA256SUMS against the expected lines; and the end marker, with no trailing data. It then imports from that private copy, not from the path.
Import write Import reserves a new backup name (by default import-<id>; an existing name, even an abandoned one, is refused) as hidden staging. It stages consecutive pages together, up to 4 MiB of page data in one transaction (a larger page alone). Staging runs at batch priority and moves to default priority after it makes no progress for half the page deadline, which is the operation timeout capped at 5 minutes (15 s with the default DYNODB_OPERATION_TIMEOUT). Import publishes the backup in one final transaction. A replay after an unknown commit is accepted once.
Import failure The backup stays hidden. Import makes one cleanup attempt of at most 2 seconds; otherwise backup-staging-gc removes the staging after its heartbeat is 7 minutes old (what a failed job leaves).

Sources: backup_archive.go, backup_archive_fdb.go and cmd/dynodb/backup.go.

Repeatable copy and restore drill

scripts/dr-drill.sh runs this on one host with two private clusters. It checks that a corrupt archive is refused and a changed item is detected. See drill.json in its output directory.

FoundationDB-native backup drill

FoundationDB's fdbbackup and fdbrestore protect the whole database; fdyno does not run them for you. scripts/fdb-native-local-restore-drill.sh rehearses them on one host. It backs up to a file:// directory, restores into another cluster and checks every key and value. Then it checks a table, a large item, a GSI, TTL, tags, a stream image and token replay through the SDK. It needs fdbbackup, fdbrestore, backup_agent (or FDB_BACKUP_AGENT_BIN) and uv.

FDYNO_DRILL_ARTIFACT_DIR=/path/to/new-output-dir bash scripts/fdb-native-local-restore-drill.sh

It does not test off-host storage, site loss or FoundationDB TLS.

Measured at 5 TB on EC2

One EC2 run loaded 5 TB of FoundationDB key-value data through the API. It backed the data up with fdbbackup to S3. It restored the data into a new cluster in the same Region (pre-v0.1 build d0c0c7ae with default cluster version 3; run aws-20261118-c4w-stageB4). See the recorded load and restore events.

Step Result
Bulk load through the API Reached 5.0 TB in 2 h 22 min. Measured key-value growth to that sample was about 577 MB/s; first-hour growth was 594.12 MB/s.
fdbrestore into a new cluster 8.4 h; 11.5 h including validation
Acknowledged writes lost in the planned restore 0 of 164,680 after a backup-version fence and drain
Full check of the restored data 305,175,782 items in 32 tables in 2 h 41 min; every item matched
Export and import of a 1 GB table 336 s
Add storage hosts after the restore Not measured at 5 TB

Chart: the recorded 5 TB load, restore and audit durations, load rates and TLog payload pilots.

Setup: us-west-2, one AZ, triple, ssd-redwood-1, FoundationDB 7.3.51. Nine i4i.4xlarge storage hosts with eight storage processes each, at cache-memory = 7.75GiB of memory = 14.25GiB (memory per process). Three i4i.4xlarge log hosts with nine TLogs. Three c6in.2xlarge stateless hosts, three c7i.4xlarge API hosts and three c7i.4xlarge loaders.

TLog write bandwidth limited the load. The payload pilots measured about 252 MB/s with three TLogs, 436 MB/s with six, and 558 MB/s with nine. They used pre-v0.1 builds with default cluster version 3. Three and six ran on one fleet (aws-20261118-c4-pilot6-r2, build 8b4533f9), nine on the 5 TB fleet (aws-20261118-c4w-stageB4, build d0c0c7ae), with the same host shape. This was not a matched three-way comparison. One pilot each; not a guarantee.

For a large initial load, run more TLogs (configure logs=N) across the log hosts.

Writers in the acknowledged-write check stopped before the backup. The check proves recovery of the drained backup, not RPO 0 after sudden source loss. Multi-region scopes the separate primary-Region loss test and the reduced durability after promotion.

S3 destinations need a CA file

FoundationDB 7.3 release binaries ignore the system CA store. Without a CA bundle, fdbbackup start reports Could not create backup container: Operation timed out. Set it for fdbbackup, fdbrestore and every backup_agent:

export FDB_TLS_CA_FILE=/etc/pki/tls/certs/ca-bundle.crt   # Debian, Ubuntu: /etc/ssl/certs/ca-certificates.crt
fdbbackup list -b 'blobstore://@<bucket>.s3.<region>.amazonaws.com/?bucket=<bucket>&region=<region>'   # must exit 0

backup_agent also accepts --tls-ca-file <path>.

Validate before cutover

  1. The target is ACTIVE with the expected key schema.
  2. Item counts match, allowing for TTL and writes after the backup.
  3. Every index answers its queries with the expected projections.
  4. Large items and every attribute type you use read back correctly.
  5. Tags, TTL and overrides are as intended.
  6. A new stream and resource policy are in place, if needed.
  7. Application invariants hold on a read-only canary.
  8. The source and backup stay until rollback is no longer needed.

fdyno has no table rename or alias; switch traffic in your application.

Troubleshooting

  • A backup completed as ROLLING but you need one instant. Back up under lower load, or use FoundationDB-native backup.
  • fdbbackup to S3 times out. Set the CA file; see S3 destinations need a CA file.
  • A restore stays CREATING or returns HTTP 500 source is incomplete. Check the restore runbook before you retry. Verify the target before switching traffic or canceling the restore.
  • A failed import left a CREATING table. This happens when the target cleanup ended with TargetCleanupFailed. DescribeTable on that name shows the leftover table, and CreateTable with that name returns ResourceInUseException. One ListTables call returns at most 100 names; to find the table there, page with LastEvaluatedTableName. Once storage recovers, stop concurrent table creation and deletion for that name. Use DescribeTable to check that its TableId is the failed import's original target. TargetCleanupFailed includes that ID. If you can verify the target, use DeleteTable to remove it and free the name.

There is no progress API for backups or restores.

What a failed job leaves

Each job kind ends a failure in its own way. Some errors end the job; others leave it for the next worker pass. The table shows what stays in the cluster or the destination, and which name stays taken.

Job Ends the job Left behind Name What to run
CreateBackup Any error. There is no job record and no worker retry; the client retries. The hidden staging generation under the backup's ARN. The failed request makes one cleanup attempt of at most 2 seconds. Otherwise backup-staging-gc removes it once its last heartbeat is 7 minutes old (MaxOperationTimeout 5 minutes plus a 2-minute clock allowance). Each pass (DYNODB_BACKUP_STAGING_GC_INTERVAL, default 10m) examines a rotating window of up to 100 names across all backups, published ones included. With N backup names, a full rotation takes at least ceil(N / 100) passes; a pass ends early at a failing name or a throttle. The backup name. A new CreateBackup with it fails with ResourceInUseException until the staging is removed or its last heartbeat is 7 minutes old; after that, the new request reclaims it. DescribeBackup on the expected ARN, then retry.
RestoreTableFromBackup A page too large for one FoundationDB commit (2101, 2102, 2103); a corrupt or missing backup page; a changed backup generation; an item that does not fit the target schema; a deleted target. Nothing: the failing transaction deletes the job's own CREATING target, if it is still there, and releases the backup's pin. Free once the job is FAILED. DescribeTable on the target, then the runbook.
RestoreTableToPointInTime A batch too large for one commit; a corrupt job state; a changed target identity; a missing table; ValidationException, ResourceNotFoundException, ResourceInUseException, TableAlreadyExistsException, InvalidRestoreTimeException or PointInTimeRecoveryUnavailableException. Nothing: the failing transaction deletes the job's own CREATING target, if it is still there, and clears the job's staged map. Free once the job is FAILED. DescribeTable on the target name; retry when it is absent.
ExportTableToPointInTime Before publication, at once: a definite destination error (an S3 3xx or 4xx other than 429 and 408, or a file-destination permission or path error), TableNotFound, InvalidExportTime or a corrupt job state. Other errors count, S3 429, 408, 5xx and transport errors included; the fifth counted failure ends it with ExportFailed. So does a pinned destination that no worker that lists the bucket can verify for 24 hours, measured with the workers' wall clocks. During publication, every remaining error counts, a definite destination error included, and the fifth counted failure, or 24 hours of an unverifiable destination, ends it with PublishOutcomeUnknown. Data files in the destination; nothing deletes them. manifest-summary.json may exist with PublishOutcomeUnknown. None. The same ClientToken within 8 hours returns the failed export. DescribeExport for FailureCode; retry with a new ClientToken.
ImportTable A store or source error code at once (see the import failures), or ImportFailed after five counted failures. The job stays IN_PROGRESS while the worker deletes its CREATING target, then reports FAILED. After five counted cleanup failures the target stays, with TargetCleanupFailed. The target name, while the target exists. DescribeImport; for a leftover target, see Troubleshooting.

Any other error leaves the job for the next pass. That includes a restore error not listed above or in the table below. It also includes an export or import error before its fifth counted failure. FoundationDB throttling, an expired pass deadline, cancellation and a lease held by another process never count. Nor does a destination that this process does not list in DYNODB_EXPORT_DESTINATIONS or cannot match to the job: the process releases the job. An import, or an export whose bucket is in no process's DYNODB_EXPORT_DESTINATIONS, stays IN_PROGRESS until a process that lists and matches the destination runs it.

Three workers share DYNODB_RESTORE_RECOVERY_INTERVAL (default 15s):

  • restore-recovery resumes restores from the last committed batch or page;
  • export resumes exports from the last committed file;
  • import resumes imports.

A new import holder in the listing phase lists the source from the start. A PITR restore pass processes up to 128 pages over all its phases.

A backup restore error takes one of three paths. The request has already returned CREATING, so the error shows as the target going away:

RestoreTableFromBackup job error Result
Page too large (FDB 2101, 2102, 2103); a backup page missing, corrupt or of another generation; an item that does not fit the target key or index schema FAILED; its own CREATING target deleted and the pin released in the same commit.
An unreadable job record (for example, a version 1 job from an older build) FAILED; its own CREATING target deleted and the pin released.
Any other error Stays RUNNING; the next pass resumes it.

Admission errors return to the request and leave nothing: an invalid request, BackupNotFoundException, a taken name (TableAlreadyExistsException), or a limit. Recovery never retries a FAILED restore job.

Record retention differs by kind:

Record Kept
Backup or PITR restore, COMPLETED or FAILED 24 hours after it ends, so a retried request finds its admission.
Export, import 90 days after the last update.

Sources: backup_ops.go, backup_generations.go, restore_jobs.go, restore_cleanup.go, pitr_jobs.go, export_jobs.go and import_jobs.go.

Rehearse recovery

On your topology, rehearse:

  1. A stopped fdyno process under traffic.
  2. A dropped write response retried with the same ClientRequestToken.
  3. An interrupted GSI backfill and large restore, resumed by another process.
  4. A native restore into an isolated cluster, checked against application invariants, not only key counts.
  5. The loss of a FoundationDB process or fault domain your redundancy mode must survive.

scripts/fault-smoke.sh automates 1 and 2, the native backup drill 4, and the AWS failover campaign covers 5 for one AZ of three.