pg2 and You: Getting Distributed with Elixir
summary
pg2 implements distributed process groups used by Phoenix PubSub; the talk shows a faithful Elixir translation called re_pg2, notes the original is 333 lines of Erlang, and demonstrates it actually works with tests across nodes. pg2 uses a gen_server plus ETS-backed membership, node and process monitors, and coordinates writes with global.trans locks and gen_server multicalls, so reads are cheap but modifications incur cluster round trips. pg2 behaves as an AP eventually consistent distributed database and suits one-process-per-node patterns (not thousands).
AI-written summary · about
chapters (13)
- 0:00Start
- 0:06Platinum
- 4:22What does pg2 let us do?
- 5:36Our Phoenix Chat App
- 6:34Our Distributed Phoenix Chat App
- 8:10Phoenix PubSub (simplified)
- 11:18pg2 example, cont.
- 14:55RePG2 Translation Principles
- 15:53RePG2 vs. pg2
- 17:52pg2's OTP Toolbox
- 21:39Node and Process Monitoring
- 22:58pg2 uses global locks
- 23:49pg2 is a distributed database
related talks
33mDiscovering distributed systems in Elixir
23mCracking the PubSub Code. Elixir's Key to Scalable Real-Time Systems
38mPostgreSQL as a distributed computing platform
39mAn adventure in distributed programming
46mpg paxos Table Replication through Distributed Consensus
53mElixir: a potion to mix complexity and concurrency in real‑time
03h 19mWorkshop - All Aboard The Elixir Express!
45mPhoenix a web framework for the new web
