Skip to content
Wasim Rashid

Loading a million BINs without touching the hot path

Decoupling write and lookup paths so reference data can change while transactions keep flowing.

WRBy Wasim Rashid··3 min read

01The lookup every transaction makes

Before a card payment is routed, the gateway looks up its BIN: which issuer, which country, which scheme, which card type. Routing, fraud screening and reporting all depend on the answer. That lookup sits on the hot path, so anything that slows it slows every transaction.

BIN data changes constantly, and a full refresh is more than a million records. Loading that into the same table the live lookups read from is how a routine data update becomes an incident.

02Separate the write path from the read path

The design that works is to make sure the load and the lookup never contend. New data is ingested in chunks into a structure that live transactions do not read. It is validated there: record counts, range overlaps, required fields. Indexes are built there as well.

Only when the new set is complete and checked does the lookup switch to it, in a single quick step. Transactions see the old data, then the new data, and never a half-loaded table or a lock.

03The same idea, applied elsewhere

Bulk merchant exports have the same shape in reverse: a large read that must not disturb live writes. Those belong on queues, processed in the background and delivered when ready, so a merchant downloading a million rows never competes with a customer trying to pay.

Next article

Launching Apple Pay behind a white-label platform

Open to consulting engagements

Have a payment problem that needs tracing?

Tell me which providers are involved and what is going wrong, or what needs to go live. I will tell you plainly whether I can help.

Tell me
Which providers and markets are involved
Show me
What is failing, or what needs to go live
You get
A plain answer on whether I can help