Build real-time search indexes with Postgres change data capture (CDC) and Meilisearch. Learn to keep your search collections in sync with your database.
In Meilisearch, each index contains documents with the same structure.Sequin recommends creating one sink per Postgres table. Each sink will stream changes from a single Postgres table to a single Meilisearch index. This ensures schema consistency across indexed documents. For large-scale applications, you may consider sharding indexes—e.g., sharding a
users
index by region into users_us
, users_eu
, users_asia
, etc.
You can use Sequin’s filters to accomplish this. For example, to shard users
by region, create a sink per region with filters to route the correct rows to the corresponding Meilisearch index.
Select source table or schema
Specify filters
insert
, update
, and/or delete
actions. For full sync, select all three.For example, if you uncheck deletes
, rows deleted from Postgres won’t be removed from the Meilisearch index.You can also use filters to only include certain rows—e.g., WHERE in_stock = true
for product availability or for sharding by tenant.Specify backfill
Transforms
id
:Specify message grouping
Specify batch size
/documents
endpoint. A good starting point is 100–1000 documents per batch. Very large batches (10k+) may impact memory or throughput depending on your instance size.Select the Meilisearch index you created
Create the sink
products
index and want to update view counts or inventory levels: