101 words, 1 min read
    
  
  ⚠️ This post links to an external website. ⚠️
Phoenix.Sync is a library that adds real-time sync to Postgres-backed Phoenix applications. Use it to sync data into both LiveView and front-end web and mobile applications.
- integrates with
PlugandPhoenix.{Controller, LiveView, Router, Stream}- uses ElectricSQL for core sync, fan-out and data delivery
- maps
Ecto.Querys to Shapes for partial replicationThere are four key APIs for read-path sync out of Postgres:
Phoenix.Sync.Client.stream/2for low level usage in Elixir
Phoenix.Sync.LiveView.sync_stream/4to sync into a LiveView
Phoenix.Sync.Router.sync/2macro to expose a shape in your Router
Phoenix.Sync.Controller.sync_render/3to return shapes from a ControllerAnd a
Phoenix.Sync.Writermodule for handling write-path sync back into Postgres.
continue reading on hexdocs.pm
If this post was enjoyable or useful for you, please share it! If you have comments, questions, or feedback, you can email my personal email. To get new posts, subscribe use the RSS feed.
