---
title: "Ingress is not the owner of the invariant"
url: https://daily.dev/posts/ingress-is-not-the-owner-of-the-invariant-uvprn2asu
source_url: https://blog.arkency.com/ingress-is-not-the-owner-of-the-invariant
type: article
source: "arkency"
published: 2026-06-18T08:25:58.537Z
updated: 2026-06-18T08:26:21.822Z
tags: ["architecture", "rails", "domain-driven-design"]
reading_time: 13
upvotes: 0
comments: 0
language: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Ingress is not the owner of the invariant

**[arkency](https://daily.dev/sources/arkency)** · 13 min read · 0 upvotes · 0 comments

## Summary

A polemic response to Brandon Weaver's 'Callbacks Are Not Invariants' post, agreeing on the diagnosis (Rails callbacks are problematic) but disputing the cure. The author argues that Weaver's Command/Transaction Script pattern still spreads the invariant across multiple layers (runtime check, row lock, DB constraint) rather than giving it a single owner. The proposed alternative uses an aggregate model where the domain object owns the invariant, produces a typed domain event (past tense, result payload), and persists that event atomically in the same transaction as the state change — making effects always replayable. The author also critiques Weaver's naming: calling a Transaction Script a 'command' and ActiveSupport::Notifications a 'domain event' installs a misleading mental model for large teams. The post demonstrates both a bare ActiveRecord implementation and a RailsEventStore version, and argues that persisting domain facts from day one is record-path hygiene, not event sourcing overkill.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://blog.arkency.com/ingress-is-not-the-owner-of-the-invariant>

## Similar posts on daily.dev

- [What Invariants Are \(and Why a Domain Model Is the Best Place to Enforce Them\)](https://daily.dev/posts/what-invariants-are-and-why-a-domain-model-is-the-best-place-to-enforce-them--jqweafvd0) · Milan Jovanović · 12 upvotes · 0 comments
- [Ozymandias on Rails. The Pedestal Inscription](https://daily.dev/posts/ozymandias-on-rails-the-pedestal-inscription-tccgx4jqk) · Ruby Flow · 4 upvotes · 0 comments
- [The Rails Way in 2026](https://daily.dev/posts/the-rails-way-in-2026-lwaqok4v6) · arkency · 0 upvotes · 0 comments

---

Tags: [#architecture](https://daily.dev/tags/architecture), [#rails](https://daily.dev/tags/rails), [#domain-driven-design](https://daily.dev/tags/domain-driven-design)

[View this post on daily.dev](https://daily.dev/posts/ingress-is-not-the-owner-of-the-invariant-uvprn2asu)
