Forking writes between indexes
Background
Writes to one index should also be written to one or more other indexes
Process
- Collect the following information about each index that you want to write to (these can be found in index settings in the
prod-EcomIndexSettingsTablein the Controller account):system_account_id: System account ID. Defaults to the same as the source.index_name: Name of the aliased index.shop_id: Shop ID of the aliased index. This is the same as the “index ID” which is typically{system_account_id}-{index_name}.queue_url: SQS queue URL of the aliased index.s3_bucket: S3 bucket for docs to write to the aliased index. This is the same for all indexes.s3_prefix: S3 prefix for docs to write to the aliased index. This is just{shop_id}/.
- Edit ecommerce index settings, specifically
add_docs_config, to add index_write_aliases- ⚠️ Note that when using write aliases, only write aliases are considered at runtime. If you want a write to
footo be written to bothfooandbar, you need two write aliases, for bothfooandbar.
- ⚠️ Note that when using write aliases, only write aliases are considered at runtime. If you want a write to
- Once updated, you should see activity on the target (alias) index queues in SQS or the ecom dashboard, and jobs in the jobs list (e.g. on the Admin UI for the index).