Why System Design Matters More Now That AI Writes Code

AI tools can now write a working CRUD endpoint, a form and a test faster than I can type the function name. I use them every day, and I'm not going back. But the longer I use them, the more convinced I am that the skill that matters most for a developer right now is not writing code. It's deciding what the code should be shaped like.
Code got cheap. Mistakes didn't.
When writing code was slow, a bad design decision slowed you down early. You felt the pain while building. Now you can generate a thousand lines on top of a bad decision in an afternoon, and you only feel it months later, when it's expensive to undo.
A few examples from systems I've worked on, where the important decision had nothing to do with typing speed:
- Where does the truth live? In the SGS pharmacy module, stock quantity isn't a field you update. It's the sum of an append-only ledger of movements. That one decision makes concurrent updates safe and gives a full audit trail. An AI tool would happily generate the classic "read quantity, subtract, save" for you. It works in a demo and oversells in production.
- Who is allowed to see this? In a multi-tenant product like StaffVertex, every query has to be scoped to an organization, and permissions have scope (own, team, project, organization). If that isn't part of the architecture, it becomes a filter someone forgets to add.
- What happens when the network is gone? For the SalezFlow POS and Kisaan Hisaab, "works offline" wasn't a feature. It decided the database, the sync model and the licensing model.
None of those are hard to code once decided. All of them are very expensive to change later.
What I mean by system design
People hear "system design" and think of interview diagrams with load balancers and Kafka. That's a small part of it. For most products I build, system design means answering a handful of boring, critical questions before writing much code:
- What are the core entities and which one is the source of truth for each fact?
- What must never be wrong? (Money, time, stock, permissions.)
- What happens when each dependency fails: the database, email, payment provider, network?
- Who are the clients, and which ones can't be updated on demand? (Desktop and mobile apps, mostly.)
- Where will this grow first: users, data, features or teams?
If I can answer these on one page, the rest is mostly implementation. And implementation is exactly the part AI is good at.
AI makes architecture more important, not less
Here's the uncomfortable part. AI generates code that is locally correct. It answers the prompt in front of it. It doesn't know that your desktop clients from three months ago still call the old endpoint, or that a "small" schema change will break the payroll report, unless you tell it.
So the developer's job moves up a level:
- Set boundaries clearly enough that generated code lands in the right place.
- Define invariants (rules that must always hold) and check them in review and in tests.
- Review for system-level effects, not just syntax: tenancy, failure modes, backward compatibility, cost.
In practice, a clear design is also the best prompt. When the boundaries and rules are written down, the tools produce much better code, because they're filling in a well-defined shape instead of inventing one.
Design for failure on day one
The habit that has saved me the most is asking "what if this fails halfway?" for every write that matters.
On my agency site, a contact form submission is saved to the database before any email is sent. If email fails, the lead still exists. In SGS, a multi-pharmacy checkout commits inside a single transaction and re-checks stock inside it, so a race between two customers can't oversell. In the StaffVertex desktop app, a record that can't be accepted is kept and explained, never silently altered.
Those are all small decisions. Together they're the difference between a system you trust and one you babysit.
Don't over-design either
The opposite mistake is real too. I've seen projects start with microservices, queues and three databases for a product with fifty users. That's not system design, that's cosplay.
Good design is proportional. Start with the simplest structure that protects the things that must never be wrong, keep clear boundaries inside it, and leave room to split later. I wrote a separate post about when splitting actually makes sense.
How I practise it
- Before a feature, I write a short note: entities, source of truth, failure cases, and what must never break.
- I read code for invariants, not style.
- When something goes wrong in production, I ask which design decision allowed it, not just which line caused it.
- I read how other teams solved problems I have, especially around time, money and multi-tenancy.
I'm moving towards AI engineering, and that has made this even clearer to me. LLM features add new failure modes: non-deterministic output, cost per request, latency, data you shouldn't send to a third party. The teams that do well with AI won't be the ones that generate the most code. They'll be the ones that design systems where that code can be trusted.