Double Entry Transition Tables: How We Track State Changes At Shopify - Shopify
May 18, 2022

Summary
This post introduces and details the implementation of double-entry transition tables as a data modeling technique for tracking state changes of entities over time. It explains the concept, its advantages (additive net_change column, identifying cause of change, preserving timing, scalability), and provides a step-by-step guide on building the pipelines using PySpark. The example focuses on tracking Shopify account and Shopify Balance account statuses, demonstrating how to query active accounts and net changes over time. This technique is applied to reliably count merchants using Shopify Balance historically.
More from the Data Store Selection and Usage trail
- We replaced Redis with MySQL for inventory reservations—and it scaled (2026) - Shopify
- Mitigating Deadlocks in high concurrency environments - Shopify
- Safely Adding NOT NULL Columns to Your Database Tables - Shopify
- Shopify’s Unique Data Science Hierarchy Of Needs - Shopify
- Upgrading MySQL at Shopify - Shopify