Skip to content
TBH
Back to blog
January 15, 20264 min read

How AI Changes Software Architecture (Not How You Think)

Everyone talks about how AI can write code. Fewer talk about how AI fundamentally changes the way we design software.

It's not about generating boilerplate faster. It's about discovering problems before they hit production.

The Classic Software Trap

Traditionally, the process looked like this:

  1. You start building what you think you need
  2. You hit an edge case in production
  3. You fix it with a hotfix
  4. Repeat 50 times
  5. Now you have technical debt

That's how most systems come to be. Not because developers are bad, but because it's impossible to foresee all edge cases alone.

AI as Architecture Sparring Partner

A concrete example: We recently designed a billing system. The starting point was simple - multi-tenant with seat-based pricing.

But we know from experience that simple quickly becomes complex. So we used AI to stress-test the design:

  • "What happens if two users accept the last invitation simultaneously?" → FOR UPDATE locking
  • "How do we ensure files are deleted before user on GDPR erasure?" → Queue system with order guarantee
  • "What if Stripe sends the same webhook twice?" → Idempotency keys and claim-based processing

Result: An architecture spec we would normally have spent weeks maturing - ready in hours.

It's not that we couldn't design it ourselves. It's that AI accelerates the critical thinking that normally requires hitting the problems first.

What AI Actually Does

AI doesn't write your code for you. It:

  1. Asks the right questions - "What happens if two users do X simultaneously?"
  2. Remembers patterns you've forgotten - "You should probably use SECURITY DEFINER here"
  3. Forces you to think through edge cases - Before they cost you customers

It's an accelerator for the critical thinking we would have done anyway - just faster and with fewer blind spots.

Toyota vs Rolls Royce

With AI, you now have a choice:

Before AI:

  • You built what you could manage
  • Edge cases discovered in production
  • Technical debt was unavoidable

With AI:

  • You can design enterprise-grade architecture in hours
  • You know what a Rolls Royce looks like
  • You choose whether to build a Toyota (and that's okay!)

What matters is that the choice is conscious. You can say "I know I'm not handling race conditions on seats - I'll fix that when I have 100+ customers". Before, you didn't even know the problem existed.

Practical Example: RPC vs REST

A classic architecture discussion. With AI you can now:

Prompt: "I'm considering RPC vs REST for my billing system. 
What are the trade-offs for security and race conditions?"

AI will explain:

  • Why REVOKE INSERT, UPDATE, DELETE FROM authenticated is smart
  • How FOR UPDATE locking prevents seat overselling
  • When REST is still the right choice

It doesn't replace experience - but it compresses the research and discussion that normally takes days.

Limitations

AI isn't perfect for architecture:

  • It hallucinates - Always verify critical patterns
  • It lacks context - It doesn't know how your organization works
  • It can overkill - Not all systems need enterprise-grade security

Use AI as a sparring partner, not as truth.

Concrete Workflow

Here's how we use AI for architecture:

  1. Start with the problem - "I need multi-tenant billing"
  2. Ask about edge cases - "What can go wrong?"
  3. Discuss trade-offs - "What's the difference between Toyota and Rolls Royce version?"
  4. Generate spec - Let AI write the detailed plan
  5. Review critically - You make the decisions, not AI

The result is architecture that would have taken months to design - in hours.

Conclusion

AI doesn't change software by writing code faster. It changes software by compressing the maturation process that normally takes months.

We use AI to stress-test our designs before they hit production. It's not a crutch - it's a professional tool, on par with linters, type systems, and code review.

The difference is that now we can deliver architecture that's battle-tested from day one.

See what we have built

Nordvec, nævn.dk, Matematik i Måneby in the browser, Semantika and open source.

See the projects