Menu

How I Store Merchant Suggestions Without Polluting Relational Database Keys
📰

How I Store Merchant Suggestions Without Polluting Relational Database Keys

DEV Community: android·DEVANSHU PATIL·12 days ago
#KuXHSVvW
#devtoandroid#devto#dev#merchant#transaction
Reading 0:00
15s threshold

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…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.