phoenixframework/phoenix_pubsub
64.6
Adequate · 3 October 2026
2.3k
lines of production code
Elixir
primary language
2
measurements over time
What this system is
This system is a distributed real-time communication library that provides PubSub messaging and presence tracking capabilities. It enables applications to broadcast messages across clustered nodes and track the state of connected clients using causal vector clocks and delta replication for efficient synchronization. The implementation relies on Erlang's Registry and PG modules for process management and includes comprehensive tooling for testing distributed behaviors.
How it got here
2015 — Phoenix.Presence removal and PubSub rename
5 changes.
The project removed the Phoenix.Presence module and its associated tests, while renaming the package to Phoenix.PubSub and upgrading to version 2.3.0. This period involved migrating to a newer configuration system, raising the minimum Elixir requirement to 1.13, and adding ExDoc tooling for documentation generation.
2016–2019 — PubSub and Tracker distributed architecture
8 changes.
This period focused on introducing and refining Phoenix.PubSub and Phoenix.Tracker to support distributed real-time communication and presence tracking. The work involved refactoring the PubSub backend to use Erlang's Registry and redesigning the Tracker internals with causal clocks and delta replication for improved consistency and performance. Comprehensive test suites and benchmarking tools were added to validate the new distributed protocols and ensure reliable behavior across cluster nodes.
Features
Added benchmark script for merge operations
A new \script/bench.exs\ script has been added to allow users to run simple benchmarks for merge operations. The script measures performance for creating sets, extracting state, merging sets, retrieving data by topic or PID, compacting state, and handling replica down events, with configurable set and delta sizes via command-line arguments.
script · high confidence
Introduce Phoenix.PubSub and Phoenix.Tracker modules
Added the Phoenix.PubSub module as a realtime publisher/subscriber service with support for PG2 and Redis adapters, including safe pool size migration and configurable dispatching. Added the Phoenix.Tracker module to provide distributed presence tracking using a heartbeat protocol and CRDTs, allowing applications to track and replicate presence information across a cluster with configurable callbacks for handling diffs and info messages.
lib/phoenix · high confidence
Removals
Removal of the Phoenix Presence module and its internal components
The \Phoenix.Presence\ application, along with all its supporting modules (\Adapter\, \NodeChecker\, \Registry\, \Server\, \Spawner\, and \Tracker\), has been removed from the codebase. This eliminates the existing presence tracking functionality, including node monitoring, state transfer, and pubsub-based presence events, meaning applications can no longer use this module to track connected users or devices.
_lib/phoenix\presence · high confidence
Behavioural changes
PubSub backend refactored to use Registry with configurable sharding and PG/PG2 fallback
The Phoenix PubSub implementation has been restructured to rely on Erlang's Registry for process tracking, replacing the previous internal mechanism. This change introduces a new \:group\_by\ option (\:pid\ or \:key\) to control Registry sharding strategies and supports both the modern \:pg\ module and the legacy \:pg2\ module depending on availability. The PG2 adapter now supports separate \:pool\_size\ and \:broadcast\_pool\_size\ configurations to allow safe migration, and the system enforces that \:pool\_size\ is greater than or equal to \:broadcast\_pool\_size\. Additionally, the adapter protocol now requires implementing a \child\_spec\ callback, and the supervisor ensures the required Erlang/OTP version (21.3+) is present.
lib/phoenix/pubsub · high confidence
Redesigned distributed presence tracking with causal clocks and delta replication
The \Phoenix.Tracker\ internals have been rewritten to improve consistency and performance in distributed environments. The system now uses a shard-pool architecture (\Phoenix.Tracker.Shard\) to manage state, replacing the previous monolithic design. Replication between nodes is handled via causal vector clocks (\Phoenix.Tracker.Clock\) and incremental delta generations (\Phoenix.Tracker.DeltaGeneration\), allowing nodes to sync only the changes since their last known state rather than transferring full state. Replica health is tracked with heartbeat-based status updates (\Phoenix.Tracker.Replica\), including support for permanent down detection to prune stale data. Additionally, a new \Phoenix.Tracker.ShutdownHandler\ ensures graceful state replication during node shutdown, and new API functions \get\_by\_key\ and \dirty\_list\ provide more granular access to tracked presences.
lib/phoenix/tracker · high confidence
Removal of legacy config/config.exs file
The project has removed the \config/config.exs\ file, which previously handled application configuration using the deprecated \Mix.Config\ module. This change eliminates the legacy configuration mechanism, likely as part of a migration to a newer configuration system or to clean up unused configuration files.
config · high confidence
Test coverage
Added comprehensive test suite for Phoenix.Tracker internals; Added distributed test support helpers; Added shared PubSub adapter test suite; Added tests for PubSub and Tracker components; Removed adapter tests for Phoenix.Presence; Test suite now spawns clustered Phoenix PubSub nodes.
Dependencies
Upgrade to Phoenix.PubSub v2.3.0 with Elixir 1.13+ and ExDoc tooling
The project has been renamed from Phoenix.Presence to Phoenix.PubSub and bumped to version 2.3.0. This update raises the minimum Elixir requirement to 1.13, removes the dependency on the Phoenix web framework, and adds ExDoc (along with its dependencies like Earmark and Makeup) for documentation generation. The application module has also been updated to Phoenix.PubSub.Application, and the package metadata now includes source URLs and maintainer information.
(dependencies) · high confidence
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Score
- CAI 64 → 65 (+0.6)
- Rubric changed (rubric-2026.09.15 → rubric-2026.10.1) — scores are not directly comparable.
Lenses
- Code Health 98 → 98 (+0.0)
- Architecture 99 → 99 (+0.2)
- Maturity 43 → 43 (+0.0)
- Readiness 67 → 69 (+2.4)
- Security 100 → 100 (+0.0)
Resolved (2)
- Documentation: no architecture or design documentation (README.md)
- Documentation: no usage examples (README.md)
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
phoenixframework/phoenix_pubsub was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 3 October 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit 01cf8ed2d71f9f7798314fe79a766214131238ad — the exact code this score is about.
- Scored under rubric-2026.10.1 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer preprod-8fe32cd45d00.