magecopilot / module-edge-sync
Enterprise Headless CDC Data Pipeline and In-Memory Typesense Indexer for Adobe Commerce & Mage-OS
Package info
github.com/MageCopilot/module-edge-sync
Type:magento2-module
pkg:composer/magecopilot/module-edge-sync
Requires
- php: ~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0
- magento/framework: ^103.0
- magento/module-backend: ^102.0
- magento/module-bundle: ^101.0
- magento/module-catalog: ^104.0
- magento/module-catalog-inventory: ^100.4
- magento/module-catalog-rule: ^101.0
- magento/module-config: ^101.2
- magento/module-configurable-product: ^100.4
- magento/module-cron: ^100.4
- magento/module-customer: ^103.0
- magento/module-directory: ^100.4
- magento/module-grouped-product: ^100.4
- magento/module-inventory-api: ^1.2
- magento/module-inventory-sales-api: ^1.2
- magento/module-store: ^101.1
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
Enterprise catalog synchronization and change data capture (CDC) engine for Magento 2, Adobe Commerce, and Mage-OS, designed to feed in-memory Typesense clusters with minimal database overhead.
Overview
MageCopilot_EdgeSync continuously replicates catalog data from Magento into Typesense. Rather than running slow full reindexes or issuing locking table queries, EdgeSync uses Magento MView changelogs, targeted EAV plugins, and RabbitMQ message queues to capture mutations in real time.
All catalog documents are denormalized and structured for sub-millisecond facet navigation and instant search.
Key Features
- Real-Time CDC: Captures product saves, stock reservations, deletions, and indirect EAV mutations through MView subscriptions and targeted service plugins.
- Complex Product Resolution: Full support for Simple, Configurable (with swatches and child variants), Bundle (with dynamic salable option calculations), and Grouped products.
- Multi-Website MSI Support: Resolves salable quantity and availability per website sales channel using Magento Inventory Sales APIs (
StockResolverInterface). - B2B & Tier Pricing: Indexes customer group specific prices, active catalog rules (
catalogrule_product_price), and tiered quantity breaks. - RabbitMQ Topology with DLQ: Uses AMQP message routing with an isolated Dead Letter Exchange (
magecopilot.dlx) and Dead Letter Queue (magecopilot_typesense_sync_dlq) for unprocessable messages. - Concurrency Protection: Every document tracks
updated_at_mstimestamps to ensure older queue messages cannot overwrite newer catalog states. - Clean Purging: Automatically deletes documents from Typesense when products are removed, disabled, or set to not visible individually.
Architecture
Magento Admin / API / Cron
|
v
MView & Plugins (CDC)
|
v
RabbitMQ Exchange
|
+--> magecopilot_typesense_product_sync
+--> magecopilot_typesense_stock_sync
|
v
EdgeSync Consumer
|
v
Typesense Cluster (RAM)
Requirements
- PHP 8.1, 8.2, 8.3, 8.4, or 8.5
- Magento Open Source / Adobe Commerce 2.4.4+ or Mage-OS 1.0+
- RabbitMQ 3.9+
- Typesense 27.0+ or 30.2+
Installation
Install via Composer:
composer require magecopilot/module-edge-sync bin/magento module:enable MageCopilot_EdgeSync bin/magento setup:upgrade bin/magento setup:di:compile
Configuration
In the Magento Admin Panel, go to: Stores > Configuration > MageCopilot > EdgeSync
-
General Settings:
- Enable EdgeSync: Set to Yes.
- Typesense Host: The URL of your Typesense cluster (for example,
http://127.0.0.1:8108). - Typesense API Key: Admin API key for Typesense (stored encrypted using Magento AES-256).
- Collection Name: Target collection name (defaults to
products). - Batch Size: Number of records per bulk import batch (default:
250).
-
Vector Embedding (Optional):
- Configure external providers (OpenAI or custom endpoints) if semantic search or hybrid search is needed.
CLI Commands
Reindex the catalog into Typesense:
# Full reindex of all enabled and visible products bin/magento indexer:reindex typesense_products # Check indexer status bin/magento indexer:status typesense_products
Start the queue consumers for background delta synchronization:
bin/magento queue:consumers:start magecopilot_typesense_product_sync bin/magento queue:consumers:start magecopilot_typesense_stock_sync
Testing
Run unit tests via PHPUnit:
vendor/bin/phpunit -c dev/tests/unit/phpunit.xml app/code/MageCopilot/EdgeSync/Test/Unit
Run static analysis:
vendor/bin/phpstan analyse --level 1 app/code/MageCopilot/EdgeSync vendor/bin/phpcs --standard=Magento2 app/code/MageCopilot/EdgeSync
License
Open Software License v3.0 (OSL-3.0).