Postgresql db to Algolia index

I want to sync a set of Postgres database columns to an Algolia index. What’s the best way to sync the index on every UPDATE/INSERT/DELETE operation?

You could roll-your-own using something like Postgres triggers, or you can use a 3rd party integration tool like Census or Meroxa.

You could also consider doing the indexing in the application layer at the same time you update the database, depending on your application.

Thanks for the suggestions @chuck.meyer!

Rolling my own seems to be the way to go. 3rd party services like Census are pretty expensive for this purpose only.

My plan is to set up Postgres INSERT/UPDATE/DELETE triggers to populate a task queue table and use an external program together with Postgres NOTIFY / LISTEN commands to read the queue table and update Algolia’s index accordingly.

If someone has suggestions or a better idea, I’d love to hear about it!

1 Like

I get it.That sounds like a really solid postgres-centric way of handling it. Once you have it all working, I’d love to work with you to turn it into an awesome blog post to help others in the community.