4 ms·
If you want to listen to database changes in Elixir you can also get really good stuff done by using Cainophile (https://github.com/cainophile/cainophile https:
by lawik 3y ago
If you want to listen to database changes in Elixir you can also get really good stuff done by using Cainophile (https://github.com/cainophile/cainophile https://github.com/cainophile/cainophile). Same mechanism. I don't know the details of Debezium so I can't say if you are leaving fantastic things on the table. But I've had good fun with Cainophile. For example I've used it in my videos on Electric SQL to react to changes in a Postgres database. It matches nicely with realtime-ish UI via LiveView. So meshes really good with the current Elixir stack.
- cpursley 3y agoThat library is great but pretty dated. I put together WalEx which borrowed a good bit from Cainophole but uses the new WAL listening logic in Postgrex: https://github.com/cpursley/walex https://github.com/cpursley/walex
- Dowwie 3y agoWhat is dated? WalEx is still using logical replication slots, right? Trying to bring myself up to speed. Currently am using cainophile and would like to understand what WalEx is offering above and beyond. Cainophile isn't actively maintained but I think that's because it is feature complete, at least according to the author's concerns.
- cpursley 3y agohttps://hexdocs.pm/postgrex/Postgrex.ReplicationConnection.html https://hexdocs.pm/postgrex/Postgrex.ReplicationConnection.h...
- lawik 3y agoThat is interesting. So this would mean using what I already have when using Ecto instead of the other postgres client I think cainophile uses.sounds good to me.
- cpursley 3y agoYeah, originally I used cainophile's logic then switched to this: https://hexdocs.pm/postgrex/Postgrex.ReplicationConnection.html https://hexdocs.pm/postgrex/Postgrex.ReplicationConnection.h... Here's a great talk on Postgrex Relication: https://www.youtube.com/watch?v=QubB19Dnxh0 https://www.youtube.com/watch?v=QubB19Dnxh0