Data synchronization between tables and vector indexes
DynamoDB keeps a vector index synchronized with its base table automatically. Understanding how synchronization works helps you predict when search results are complete and why an item might not appear in results.
Backfilling an index on an existing table
When you add a vector index to a table that already contains items, DynamoDB backfills
the index with the existing data. The index first transitions to
IndexStatus CREATING while DynamoDB sets up the index
infrastructure. It then moves to IndexStatus ACTIVE with
Backfilling set to true while DynamoDB populates the index
from existing base table data. New writes to the base table are replicated to the
index during this phase, but SearchVectors returns an error until
backfilling finishes. Use DescribeTable and wait until
IndexStatus is ACTIVE and Backfilling is
false before you search. See
Adding a vector index to an existing table.
Ongoing write synchronization
After the index is active, DynamoDB replicates each write to the base table into the vector index. The following behaviors affect whether and how a write reaches the index:
-
An item is replicated to the index only if it contains a valid vector attribute. If the index defines a partition key, the item must also contain that partition key attribute; otherwise the write succeeds on the base table but the item is not replicated to the index.
-
Vector values are stored in the base table as written, but are stored at 32-bit floating point (f32) precision in the index. Values with higher precision lose that precision when replicated to the index.
-
When you delete the vector attribute from an item, or delete the item, the corresponding entry is removed from the index.
For the complete set of write-validation rules, see Writing items with vector data.
Synchronization across Regions
When a table that has a vector index is a global table, DynamoDB replicates writes in
any replica Region to the other Regions and indexes them there. DynamoDB replicates data
to the vector index asynchronously. A vector that you write in one Region might not
immediately appear in SearchVectors results in another Region—even
if the table uses multi-Region strong consistency (MRSC). See Using vector indexes with global tables.