Monolith vs Microservices for an AI-Built App
Most AI-built apps should stay a monolith. Here is the one metric, deploy frequency and blast radius, that actually tells you when to split.
If an AI coding agent or an app builder generated your product, the monolith vs microservices question for an AI-built app has a short answer: stay a monolith until something specific breaks, and that something is almost never team size. Nearly every early-stage AI-built app runs better as one deployable unit, one database, one build pipeline, one codebase an agent can hold in its context window at once. The reason people jump to microservices anyway is usually secondhand advice, having read that "real" companies run dozens of services so their app should too. Real companies split under specific pressure. Below is the metric that actually signals when to split, a worked example of the day a booking app crossed that line, and what fragmenting a codebase early costs once an AI agent is the one maintaining it.
Why "real companies do it" is the wrong reason to split
Companies running microservices usually got there because hundreds of engineers needed to ship independently without stepping on each other, because one part of the product needed to scale ten times faster than the rest, or because a regulator required a hard isolation boundary around one specific kind of data. None of those conditions exist for a solo founder or a small team shipping with an AI coding agent. What does exist the moment you split anyway is a fixed set of new costs, paid immediately: network calls where a function call used to work, serialization and versioning between services, a way for services to find each other, separate deploy pipelines to maintain, and distributed failure modes a single process never had to think about. The coordination problem microservices solve does not show up until multiple independent workstreams are shipping fast enough to collide, and for most AI-built apps that day never arrives, or arrives much later than the architecture diagrams people copy from blog posts suggest. This is one slice of a bigger question worth understanding across AI coding tools as a whole, and how much structure each stage of a project actually needs versus how much structure feels reassuring to add.
The real trigger: deploy frequency and blast radius, not team size
Team size is a bad proxy because a solo founder using an AI coding agent can ship faster than a five-person human team, and a five-person team can coordinate fine inside one codebase if they are not touching the same files. The metric that actually matters is blast radius: how much of the app can a single deploy break, and how often does deploying one part block or endanger an unrelated part. Before any of this, it is worth settling whether your app needs a dedicated backend at all, since some AI-built apps can skip this entire debate. For the ones that do need one, watch for these four signals instead of counting people on a team:
Two distinct areas of the app are being changed and deployed multiple times a day, by different people or different agent sessions, and they are now waiting on each other's CI runs.
A bug in one feature, say PDF export, has taken down or degraded an unrelated feature, say checkout, more than once because they share a process or a resource.
One piece of the app needs to scale at ten times the rate of the rest, for example a public API compared to an internal admin panel.
A specific slice of data needs a hard compliance boundary, such as payment card data needing to stay inside a narrow, audited scope.
If none of these are true yet, splitting buys you distributed systems problems in exchange for an org chart problem you do not have.
A worked example: a booking app that stayed a monolith until it didn't
Take a typical case. A solo founder builds a scheduling and booking app for boutique fitness studios, using an AI coding agent, as one Next.js application backed by one Postgres database. For the first year, every feature, scheduling, client accounts, email reminders, a basic admin dashboard, deploys together, several times a day, and nothing about that is a problem because one person and one agent session review every change. Growth brings a second workstream: a marketplace feature that lets studios sell class packs and process payments directly, built by a second contractor working with their own agent session. For months this still lives in the monolith just fine, both workstreams deploy independently by being careful about timing.
The trigger arrives the day a routine deploy of a scheduling UI change briefly takes the payment webhook handler down with it, because both run in the same process and the scheduling deploy needs a restart. That is the blast radius signal: an unrelated, compliance-scoped piece of the app went down because of a change that had nothing to do with it. That week, payments get extracted into their own service with their own deploy pipeline and their own database, a decision covered in more depth in how to choose a database for an AI-built app. Scheduling, accounts, and the admin dashboard stay exactly where they were, one monolith, because nothing about them ever crossed the trigger.
What happens to an AI coding agent when a codebase splits too early
A coding agent working inside a monolith can read the whole call graph in one pass. It sees the function signature, the database schema, and every caller in the same context window, and a broken contract shows up as a type error or a failing test before the agent even proposes the change. Split the same app into services too early and the agent loses that. It now has to infer what a call to another service actually returns, because it cannot see that service's source in the same session unless it is explicitly fed in, and it starts guessing at field names, status codes, and error shapes instead of reading them.
That guessing is where hallucinated interfaces come from: a plausible-looking request body that almost matches what the other service expects, a field the agent invented because it fit the pattern, an assumption about ordering or retries that only fails in production. Every new service boundary is a new place for that specific failure mode to happen, and a codebase split for organizational reasons that do not exist yet just multiplies the number of boundaries an agent can get wrong. Splitting also changes the bill you pay to run the thing, sometimes more than founders expect, which is worth reading up on separately in how much it costs to run an AI-built app before treating a split as free.
Monolith vs microservices at a glance
Deploy complexity
Monolith: one build, one pipeline, one thing to roll back if something breaks.
Microservices: a pipeline per service, plus a way to know which version of each service is compatible with which.
Debugging a production bug
Monolith: one log stream, one stack trace, usually one process to attach a debugger to.
Microservices: a trace has to be stitched across services, and the bug might be a mismatch between two services that individually look correct.
What an AI coding agent can see at once
Monolith: the whole call graph and schema in one context window, so a broken change gets caught by the type system across the codebase.
Microservices: only the service it is currently working in, unless the others are deliberately fed in, so cross-service contracts have to be trusted rather than checked.
Best fit
Monolith: a solo founder, a small team, or several agent sessions working on features that do not yet share a failure domain.
Microservices: multiple independent teams shipping daily who are already blocking each other, or a component with a genuinely different scaling or compliance need.
Monolith-first AI app architecture: a simple framework for the split decision
Before splitting anything, write down whether any of the four signals from earlier are true today, not eventually. If the honest answer is no, the correct move is to keep building in the monolith and revisit the question in three months, not to pre-split for scale you do not have yet. If one signal is true, extract only the specific piece that triggered it, the way the booking app extracted payments and nothing else. A monolith with clean internal module boundaries, the kind of discipline covered in structuring a monorepo for AI coding agents, gets most of the organizational benefit people want from microservices without paying the network and coordination cost before it is actually owed.
Frequently asked questions
Should an AI-built app use microservices from the start? No, for almost every early-stage AI-built app a monolith is simpler to build, debug, and deploy, and microservices only pay off once a real coordination problem exists, not because a bigger company somewhere uses them.
What does monolith-first mean for an AI-built app? It means building and shipping as one deployable unit by default, and only extracting a service when a specific trigger, like blast radius or a compliance boundary, actually shows up.
When should I split an AI-built app into services? When two workstreams are deploying independently multiple times a day and now block each other, when a bug in one feature has taken down an unrelated one, when one part needs to scale far faster than the rest, or when a piece of data needs a hard compliance boundary.
Does an AI coding agent work better with microservices or a monolith? A monolith almost always, because the agent can see the whole call graph and schema in one context window and gets a compiler or test failure on a broken contract instead of guessing at another service's interface.
Can I go back to a monolith after splitting too early? Yes, though it takes deliberate work: merging codebases, consolidating databases, and rewriting whatever integration code grew up around the service boundary, which is why applying the framework above before splitting is cheaper than reversing it after.
How did this land?
About the author

Staff Engineer, Platform
Carlo works on the platform that turns prompts into running apps. He writes the engineering deep dives and the changelog notes worth reading.


