The CTO Podcast with Fexingo · 2026-06-29 · 12 min
Key moments - from our scoring
Substance score
72 / 100
Five dimensions, 20 points each
Stripe's shift from batch-based to real-time tax processing represents a critical architectural challenge for payments infrastructure at scale. The EU's 2025 VAT in the Digital Age reforms triggered a multi-quarter redesign: moving from relational ledgers to event-sourced Kafka streams, where tax rules execute through a purpose-built finite state machine rather than external API calls. The engine maintains 47,000 individual rules compiled into a precomputed decision tree, eliminating runtime database lookups and achieving 12-millisecond latency - compared to 50-100 milliseconds from vendors like Vertex or Avalara. A dedicated tax content team of 15 people (former accountants and lawyers) writes rules in a custom domain-specific language that compiles to binary. Stripe tested the new engine by replaying six months of historical transaction data, found 0.3% discrepancies, then deployed via 30-day shadow mode before full cutover. The p99 latency sits at 45 milliseconds. Beyond tax, Stripe is generalizing this compliance infrastructure for income withholding, insurance premium tax, and other rules-based domains, positioning it as a platform layer through the beta Tax Engine API - turning a compliance burden into a potential revenue stream and competitive moat.
Off-the-shelf tax engines require API calls that take 50-100 milliseconds, which is unacceptable for high-volume marketplaces. Stripe's custom FSM achieves 12-millisecond end-to-end latency by precompiling rules into a binary decision tree evaluated entirely in memory.
Stripe uses blue-green deployment to hold two rule set versions simultaneously. Transactions are tagged with a timestamp, and the FSM applies the rule set that was active at that transaction's time rather than the current rules, preventing retroactive changes.
A dedicated tax content team of 15 people (former accountants and lawyers) writes rules in a domain-specific language that engineers review for performance. The DSL compiles to binary format for runtime execution without database lookups.
Stripe replayed six months of historical transaction data through both old and new engines, compared results line-by-line, and ran 30 days of shadow mode where the new engine computed tax but didn't post to the ledger before switching off the batch job.
Stripe is rolling out a beta Tax Engine API that lets marketplace platforms get real-time tax breakdowns, positioning compliance infrastructure as a platform layer that other fintechs will eventually need.
Our reviewer’s read on each dimension, with quotes from the episode.
The episode is packed with concrete technical details - event sourcing, finite state machines, 47,000 rules, 12ms latency, blue-green deployments, shadow mode cutover, p99 latency of 45ms. Most claims are substantive and non-obvious (e.g., why they couldn't use Avalara, the replay framework methodology, the FSM state-machine design for tax). Some padding appears in the opening framing and the sponsor mentions, but the core content is dense with actionable engineering insight.
Every transaction becomes a stream of events - checkout started, payment authorized, tax calculated, settlement completed.
Off-the-shelf tax engines typically require an API call that takes 50 to 100 milliseconds. For Stripe, adding 50 milliseconds to every checkout flow was unacceptable.
The episode applies event sourcing and FSMs to tax compliance - neither novel in isolation, but the specific architecture (rules-as-code DSL, blue-green rule deployment, FSM state buffering for out-of-order Kafka events, zero runtime DB lookups) shows original problem-solving. However, the framing (compliance as a moat, build vs. buy for fintechs) is familiar. The insights are solid but not contrarian or deeply counterintuitive.
Incoming transactions are tagged with a timestamp. For any transaction, the FSM uses the rule set that was active at the transaction timestamp, not the current one.
The only database query during a tax event is to verify the customer's tax exemption status, which is cached. Everything else - rate lookups, nexus rules, product taxability - is encoded in the compiled decision tree.
Lucas appears to be a knowledgeable technical analyst or engineer with credible inside knowledge of Stripe's architecture - he cites specifics like team size (15 tax people), the 0.3% discrepancy rate, and the three-week replay timeline. However, the transcript offers no explicit credential or seniority marker, and he functions more as a well-informed commentator than as someone who built the system. The conversation quality suggests competence, but not necessarily hands-on architect-level experience.
The team told me they maintain around 47,000 individual rules across 130 jurisdictions.
The team shared that the p99 is around 45 milliseconds.
The episode is exceptionally specific: $1 trillion in annual payments, 47,000 rules, 130 jurisdictions, 12ms average latency, 45ms p99, 15-person tax team, 0.3% discrepancy rate, 6 months of replay data, 3 weeks of wall-clock time, 30-day shadow mode, 50 - 100ms vendor latency. Named vendors (Vertex, Avalara), specific regulations (EU 2025 VAT in the Digital Age), and concrete metrics throughout. Very few hand-wavy claims.
Stripe processes well over a trillion dollars in payments every year
The team maintain around 47,000 individual rules across 130 jurisdictions. And on an average transaction, the engine evaluates a subset of those rules in about 12 milliseconds.
Luna asks clarifying follow-ups ("How do you maintain audit-grade accuracy?", "Who writes those rules?", "What happens when a rule changes?") and productively challenges assumptions ("Why not buy from Avalara?", latency trade-offs, whether to expose as an API). However, there are missed opportunities: no pushback on the 0.3% discrepancy rate or whether 45ms p99 is actually acceptable under load. The host also delivers a sponsor pitch mid-episode that breaks flow. Overall competent but not sharp enough to be exceptional.
Why not buy an off-the-shelf tax engine from a company like Vertex or Avalara?
And that's exactly where the real value lies. Not in saving milliseconds on tax lookup, but in creating a platform that every fintech will eventually need.
Computed from the transcript - who did the talking, and the words that came up most.
In this episode, Lucas and Luna dive into Stripe's latest architectural overhaul: rebuilding its core accounting and tax-computation engine to handle real-time sales-tax, VAT, and GST across more than 130 jurisdictions. They trace the engineering decisions behind moving from a batch nightly ledger to a streaming event-sourced system capable of recalculating tax lines mid-transaction without blocking checkout. Key numbers: Stripe processes over $1 trillion in payments annually, and the new engine runs 47,000 tax rules on average per transaction in under 12 milliseconds. Lucas explains the trade-off between eventual consistency and audit-grade accuracy, and why they chose Apache Kafka plus a custom FSM over off-the-shelf ERP middleware. Luna pushes back on the cost of maintaining 130+ rule sets and asks whether Stripe should have opened a public tax-engine API earlier. The episode ends with a reflection on whether tax compliance is the next infrastructure layer that every fintech will need to build or buy.
Transcribed and scored by The B2B Podcast Index.
Lucas: Stripe processes well over a trillion dollars in payments every year, and every single one of those payments has a tax question attached to it - sales tax, VAT, GST, you name it. Luna: Right, and the rules aren't just different per country. They change at the state level in the US, and even at the city level in some cases. Lucas: Exactly.
Stripe's old system handled that by running a nightly batch job. After a payment settled, a cron job would wake up, pull the transaction, apply the correct tax rule, and update the ledger. That worked when Stripe was processing millions of payments. But when you're at a trillion dollars and growing, a nightly batch means you're always a day late on your tax liability.
Luna: So they decided to rebuild the entire accounting engine to be real-time. What was the trigger? A specific compliance issue? Lucas: The trigger was the EU's 2025 VAT in the Digital Age reforms.
That regulation requires digital platforms to report transaction-level tax data within 24 hours, not days. Stripe's batch system couldn't meet that without a major redesign. So the engineering team started a multi-quarter project to build a streaming tax engine. Lucas: The core decision was to move from a relational ledger to an event-sourced system built on Apache Kafka.
Every transaction becomes a stream of events - checkout started, payment authorized, tax calculated, settlement completed. Tax rules are applied as events flow through a state machine. Luna: That sounds like a massive architectural shift. How do you maintain audit-grade accuracy when you're processing events asynchronously?
Lucas: That's the fascinating part. Stripe built a custom finite state machine, or FSM, specifically for tax events. Each transaction goes through a defined set of states - pending tax calculation, tax computed, tax reconciled. The FSM enforces that no state transition can happen unless the previous one was logged and confirmed.
So even if Kafka delivers events out of order, the FSM buffers them and replays in sequence. Luna: So it's like a deterministic workflow engine but purpose-built for tax. How many distinct tax rules does this engine actually run? Lucas: The team told me they maintain around 47,000 individual rules across 130 jurisdictions.
And on an average transaction, the engine evaluates a subset of those rules in about 12 milliseconds. The trick is that they precompile the rules into a decision tree at deployment time, so each transaction only traverses the branches that are relevant to its geography and product type. Luna: 47,000 rules is a lot. Who writes those?
Is it Stripe's tax team or engineers? Lucas: Both. There's a dedicated tax content team of around 15 people - former tax accountants and lawyers - who write the rules in a domain-specific language that Stripe built. Then engineers review the DSL for performance and deploy it.
The DSL compiles down to a binary format that the FSM can evaluate without any database lookups. Luna: No database lookups at runtime? That's impressive. So the entire tax decision is embedded in the compiled code?
Lucas: Yes. The only database query during a tax event is to verify the customer's tax exemption status, which is cached. Everything else - rate lookups, nexus rules, product taxability - is encoded in the compiled decision tree. The FSM just traverses the tree in memory.
Luna: What happens when a rule changes? Say a city raises its sales tax rate overnight. How do they roll that out without pausing transactions? Lucas: They use a blue-green deployment strategy for the rule set.
The FSM can hold two versions of the decision tree at the same time. Incoming transactions are tagged with a timestamp. For any transaction, the FSM uses the rule set that was active at the transaction timestamp, not the current one. That way, a rule change doesn't retroactively affect older transactions.
Luna: That's clever. So the event sourcing approach actually makes retroactive tax adjustments cleaner, not harder. Lucas: Exactly. And the audit trail becomes a first-class citizen.
Every tax event is logged to a separate immutable Kafka topic. Auditors can replay the entire tax history of any transaction by reading the event stream from the beginning. No more reconciling spreadsheets. Luna: I want to push back on the cost here.
Maintaining 47,000 rules, a DSL, a custom FSM - that's a huge engineering investment. Why not buy an off-the-shelf tax engine from a company like Vertex or Avalara? Lucas: Great question. Stripe actually evaluated those vendors.
The problem was latency. Off-the-shelf tax engines typically require an API call that takes 50 to 100 milliseconds. For Stripe, adding 50 milliseconds to every checkout flow was unacceptable - especially for large marketplaces where a single checkout can involve dozens of sub-transactions. The custom FSM does it in 12 milliseconds end to end.
Luna: So the latency budget forced them to build. But once you have that engine, why not expose it as a separate product? Stripe Tax already exists, but it's more of a reporting layer. Do you think they'll open up the real-time engine as an API?
Lucas: I think it's inevitable. In fact, Stripe has already started rolling out a new API called Tax Engine that lets marketplace platforms pass transaction data and get real-time tax breakdowns. It's in beta with a few large customers. If they can abstract the complexity, they could turn this compliance burden into a revenue stream.
Luna: And that's exactly the kind of infrastructure play that makes Stripe more than a payments company. Lucas: It's a pattern we're seeing more broadly. The companies that treat compliance as a first-class engineering problem - not just a legal checkbox - end up building moats. Tax, identity verification, fraud detection - these are all becoming platform layers.
Luna: Before we go further, I wanted to touch on something related to how we do this show. We deliberately keep these episodes ad-free. No sponsors, no mid-roll interruptions. It's a choice we made because we want the conversation to be as dense and uninterrupted as possible.
If you find value in that, and you want to support it, there's a simple way - buy me a coffee dot com slash fexingo. No obligations, just a way to keep this model sustainable. Lucas: Yeah, that's exactly right. And it's not about asking for much - it's just that the ad-free format lets us go deep on topics like this without worrying about cramming in a commercial break.
If the episodes help you think about your own architecture, that's the goal. Luna: Alright, back to Stripe. One thing I haven't asked is how they tested this new engine. You can't exactly A/B test tax compliance - if the old system says you owe $100 in VAT and the new one says $95, which one is right?
Lucas: They built a replay framework. They took six months of historical transaction data and ran it through both the old batch engine and the new streaming engine. Then they compared the output line by line. Any discrepancy was flagged and investigated.
They found about 0.3 percent of transactions had differences, mostly due to rounding or timing edge cases. Each discrepancy got a manual review by the tax team. Luna: Six months of data.
That's a lot of compute. Did they have to build a special infrastructure for that replay? Lucas: They spun up a separate Kafka cluster and ran the replay in parallel. The whole process took about three weeks of wall-clock time.
And they published the results internally - every discrepancy was documented in a shared spreadsheet with a root cause. That level of transparency helped get the engineering and tax teams aligned. Luna: So after the replay, they cut over. How did they handle the transition?
Did they run both systems in parallel for a while? Lucas: For the first month, they ran a shadow mode. The new engine computed tax in real-time but didn't actually post to the ledger. The old batch job still ran at night.
Every morning, the compliance team compared the two outputs. After 30 days with zero material differences, they flipped the switch and turned off the batch job. Luna: That's a textbook cutover strategy. I'm curious about one more thing: the latency distribution.
You said 12 milliseconds average. What's the p99? Lucas: The team shared that the p99 is around 45 milliseconds. The tail latency comes from transactions that involve multiple line items with different tax treatments - like a bundle of goods where some are taxable and some aren't.
The FSM has to traverse multiple branches for each line item. But 45 milliseconds is still well under the 50-millisecond threshold that Stripe set as acceptable. Luna: Last question: do they plan to extend this engine to other compliance domains? Like income tax withholding for gig economy platforms?
Lucas: That's exactly the roadmap I've heard. The FSM and event-sourcing pattern are general enough to handle any rules-based computation. Income tax withholding, insurance premium tax, even carbon offset calculations - the same architecture applies. Stripe is positioning this as a compliance infrastructure layer, not just a tax engine.
Luna: And that's where the real value lies. Not in saving milliseconds on tax lookup, but in creating a platform that every fintech will eventually need. Lucas: Exactly. The companies that build the pipes for regulation - those are the ones that become indispensable.
Stripe is doing it for payments and now for tax. I wouldn't be surprised if in five years, every major fintech runs some version of this architecture. Luna: Which raises the question: should other companies build or buy? We've seen a few startups trying to offer a Stripe-like tax engine as a service.
Do you think the market is big enough for a standalone player? Lucas: I think there's room for both. Large enterprises with complex product catalogs will likely build, because tax is too close to their core revenue. But small and mid-sized businesses will buy.
The key is whether the standalone engines can hit that 12-millisecond latency point. If they can't, they'll be relegated to batch processing for smaller players. And the winner in real-time compliance will be whoever can combine low latency with broad jurisdictional coverage. Luna: Well, it's a space to watch.
Thanks for breaking down how Stripe rebuilt the engine. I learned something. Lucas: Always a pleasure. Next time, we'll look at how a completely different industry is tackling real-time compliance: healthcare billing.
Other episodes covering the same guests and topics, from across The B2B Podcast Index.