Mercari's Balance team extended their double-entry bookkeeping system from JPY-only to multi-currency support. Key challenges included deciding where to store exchange rates (API at header level, database at source level for future flexibility), implementing flexible validation that accepts different rounding methods within reasonable margins, and designing reversal operations to use output-only exchange rates to prevent ledger imbalances. The team also recognized the importance of tracking both region and currency as separate dimensions, since currency codes alone don't uniquely identify legal jurisdictions.
Table of contents
BackgroundPrerequisites: The "Exchange" Data ModelChallenge 1: Data Modeling for Exchange RatesChallenge 2: Precision and Validation LogicChallenge 3: Designing the Reversal InterfaceFuture Issues: The Attribution ProblemExtra: The Regional ConstraintConclusionSort: