When designing a database for an expense tracker, normalization is usually the first instinct of any software engineer.
You create a transactions table. A transaction has a merchant. So you immediately create a normalized merchants table with an auto-incrementing primary key ( id , name , category_id ), and add a foreign key column to your transaction table: merchant_id REFERENCES merchants(id) .
It feels like textbook database design.
Then real users start typing real-world merchant names into your application, and that relational foreign key constraint quickly turns into an engineering nightmare.
Here is why FinLedger deliberately decoupled merchant auto-suggestions from relational foreign keys, and how we built an on-device merchant intelligence engine without database pollution.
The Normalization Trap: Why Foreign Keys Fail for Merchants
In the real world, merchant names are noisy, erratic, and constantly shifting:
A user buys coffee at "Blue Tokai Coffee Roasters" .
Next week, their credit card…