Skip to content
CAI
Software that uses CAICheck a score

phoenixframework/phoenix_pubsub

69.3

Adequate · 15 November 2026

2.5k

lines of production code

Elixir

primary language

5

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

This system is a distributed PubSub and Presence platform for the Phoenix Framework, providing realtime messaging and user tracking capabilities across clustered nodes. It supports multiple transport adapters, including Erlang's PG and Redis, and utilizes causal vector clocks with delta replication to efficiently synchronize state between nodes. The system manages process subscriptions, broadcasts messages to subscribers, and tracks online presence information with configurable sharding and heartbeat-based health checks.

How it got here

2015 — Phoenix.PubSub initial release

6 changes.

The project was rebranded from Phoenix.Presence to Phoenix.PubSub, introducing a distributed PubSub and Presence platform with a simplified, extensible API. This initial release involved removing the legacy Phoenix Presence module and configuration, while updating dependencies to require Elixir 1.13+ and adding ExDoc for documentation.

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

Initial release of Phoenix.PubSub

The repository has been rebranded from PhoenixPresence to Phoenix.PubSub, introducing a distributed PubSub and Presence platform for the Phoenix Framework. This initial release (v2.0.0) provides a simpler, more extensible, and more performant API, including the use of Erlang's :pg module where available. The package is now installed as :phoenix\_pubsub and includes a new .formatter.exs for code formatting, a comprehensive CHANGELOG.md detailing version history and migration paths for custom dispatchers, and updated documentation in README.md.

(repo-wide) · 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 cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Score

  • CAI 69 → 69 (-0.1)
  • Rubric changed (rubric-2026.10.5 → rubric-2026.11.4) — scores are not directly comparable.

Lenses

  • Code Health 98 → 97 (-0.4)
  • Architecture 98 → 97 (-0.6)
  • Maturity 53 → 53 (+0.0)
  • Readiness 70 → 70 (+0.0)
  • Security 100 → 100 (+0.0)

New (1)

  • Edited copy of a member (10 corresponding lines) (lib/phoenix/tracker/shard.ex)

Written by cca.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 15 November 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit 79d97f0bb040b4e77a04efbe5b140d81faba7a39 — the exact code this score is about.
  • Scored under rubric-2026.11.4 — the same rubric and the same method as every other entry in this index.
  • Measured by Canine Code Analyzer (cca.canine.dev) using cca measure-2026.11.65+preprod-3c33c1882dc1.