{"repo":"cheerfulstoic/ecto_watch","free":true,"listed":false,"github":"https://github.com/cheerfulstoic/ecto_watch","clone":"git clone https://github.com/cheerfulstoic/ecto_watch.git","description":"EctoWatch allows you to easily get notifications about database changes directly from PostgreSQL.","language":"Elixir","stars":248,"topics":["ecto","elixir","postgresql"],"license":null,"category":"databases-storage","readme_excerpt":"EctoWatch (Thanks to Erlang Solutions for sponsoring this project) HexDocs documentation EctoWatch allows you to easily setup notifications of database changes directly from PostgreSQL. Often in Elixir applications a Phoenix.PubSub.broadcast is inserted into the application code to notify the rest of the application about inserts, updates, or deletions (e.g. Accounts.insert user / Accounts.update user / Accounts.delete user ). This has a few potential problems: Developers may forget to call these functions and make updates directly through MyApp.Repo. . Often different standards of PubSub messages are used. [^1] Often full records are used which can scale poorly since messages in Elixir are copied in memory when sent. Sometimes records are sent preloaded with different associations in different cases, requiring either careful coordination or sending all associations regardless of where they are needed. By getting updates directly from PostgreSQL, EctoWatch ensures that messages are sent for every change (even changes from other clients of the database). EctoWatch also establishes a simple, standardized set of messages for inserts, updates, and deletes so that there can be consistency across your application. By default only the id of the record is sent (making for smaller messages). Example use-cases for EctoWatch Updating LiveView in real-time Sending emails when a record is updated Updating a cache when a record is updated Sending a webhook request to inform another system ","default_branch":null,"files":null,"tree":[],"storefront":"/r/cheerfulstoic","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/cheerfulstoic/ecto_watch/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}