Software Architecture: Patterns, Types and How to Choose
Software architecture is the set of big structural decisions about a system: its main parts, how they talk to each other, where the data lives and how it can change later. For a business app the real choice is rarely which famous pattern to use. It is one application or several, given your team and your stage.
- Common patterns covered
- 7
- Questions before you choose
- 6
- Integration shapes with an ERP
- 3
- Mistakes to avoid
- 10
The definition
What is software architecture?
In short
Software architecture is the set of important structural decisions about a system: its main parts, how they communicate, where data lives and how the system can change. It is the part that is costly to reverse, so it deserves attention early.
Martin Fowler notes that people use the word for "a hazily defined notion of the most important aspects of the internal design of a software system". He quotes Ralph Johnson's blunt version: architecture is "the important stuff, whatever that is" (Fowler, Software Architecture Guide). That is a useful lens for a buyer. Skip the textbook definition and ask which decisions would hurt badly and take long to undo if they were wrong.
Codebase
Data
Connections
Architects also talk about quality attributes: speed, security, availability, ease of change. This is where business and technology meet. If an owner says "month-end close must finish in minutes", that is an architectural requirement, even though it sounds like a wish.
Why pay attention early? Fowler argues that poor internal quality builds up "cruft", and software full of cruft is slower and costlier to change. A messy design doesn't show on demo day. It shows in month eight, when every small change takes three weeks. And it is not a one-time document: Capicua calls it "a continuous cycle" (Capicua). The right shape at 10 users and one team is rarely right at 200 users and four teams.
Three levels
What is the difference between architecture, design and code?
Architecture decides the shape of the whole system. Design decides how one part is built. Code is the instructions themselves. The line is blurry, and the most useful test is: how costly is this to reverse?
| Level | Invoicing app example | Cost to change |
|---|---|---|
| Architecture | One deployable application with clear modules, one relational database, a REST link to the ERP | A quarter, if you move from one database to five |
| Design | How the Invoice module is organised and which functions handle tax | Days to weeks |
| Code | The tax function itself | An afternoon |
You will also meet "system design". One popular page contrasts the two: system design looks at the big picture including infrastructure and networks, while software architecture looks at how the software is structured (InfoTechHub). They overlap in practice. For a business reader the split doesn't matter, because both are decisions to make before the build and to revisit as it grows.
Fowler says good architecture "supports its own evolution and is deeply intertwined with programming". So be wary of a vendor whose "architect" never writes code, and of a design document nobody checks against the real repository. A mistake we see: buying a solution architecture document from one firm and the build from another, with nobody owning the link. Within a few releases the document no longer matches what was built.
Patterns
What are the main types of software architecture?
There is no single official list of "four types", and sources group them differently. For a business app these seven matter. Most real systems combine two or three. Descriptions follow Capicua and Fowler's guide.
Layered
Client-server
Monolith
Microservices
Event-driven
Microkernel
Serverless
Pipe-and-filter and peer-to-peer exist too, but they are rare in business software.
| Pattern | Fits when | Main cost |
|---|---|---|
| Layered monolith | One team, one product, clear rules | Layers get tangled if nobody polices them |
| Modular monolith | Growing team, one deployment | Needs discipline on module borders |
| Microservices | Many teams, parts that scale or release separately | Operations load, data consistency, network failures |
| Event-driven | Many systems must react to the same change | Harder debugging and testing |
| Plug-in (microkernel) | One core, many optional extras | The core's interface must stay stable |
| Serverless | Spiky, small, event-style jobs | Vendor lock-in, cold starts, limits |
Patterns are not exclusive. A healthy shape for a company is a layered modular monolith for the main app, a queue for background work, a few events for integration, and one or two separate services where load truly differs. Don't pick a pattern because it sounds modern. The pattern should follow the business need, not the other way round.
Monolith
Is a monolith the old-fashioned choice?
No. With clear internal modules it is the right answer for most business software. Fowler's own guidance: "The majority of software systems should be built as a single monolithic application. Do pay attention to good modularity within that monolith" (Microservice Premium).
What it does well
One codebase, one deployment, one database transaction. A sales order, its stock reservation and its ledger entry either all save or none do. In ERP work, where accounts and stock must agree, that all-or-nothing save is the whole point. It is also the simplest to run, test and back up.
What modular adds
One deployment, but firm borders inside it. Each module owns its data and exposes a small interface. Fowler describes it as designing "a monolith carefully, paying attention to modularity within the software, both at the API boundaries and how the data is stored" (Monolith First).
The honest weakness: in theory a monolith can have well-defined borders, but "in practice it seems too easy for module boundaries to be breached and monoliths to get tangled as well as large". The fix is checks, not a new architecture. Use code review rules, a test that fails when module A reaches into module B's internals, and a senior person who looks at long-term damage, not only whether the feature works.
ERPNext itself is a good example. Apps such as ERPNext, HRMS and India Compliance install on one site, share one database and extend each other through hooks. Frappe's docs describe a bench as a setup where "each frappe-bench setup spawns its own web, redis and node processes" (Frappe architecture docs).
It is a modular system on one platform, not a swarm of microservices, and it runs real businesses.

A monolith is wrong when separate teams must release on separate schedules, when one part must scale far more than the rest, or when the deployment has grown so big that every release is a risk. Those are the real triggers. "We want to look modern" isn't one.
Microservices
Do I need microservices?
Probably not at first. Microservices solve problems of size and team coordination, and they bring their own costs. Fowler calls this the "microservice premium": "don't even consider microservices unless you have a system that's too complex to manage as a monolith" (Microservice Premium).
What you take on
"Automated deployment, monitoring, dealing with failure, eventual consistency, and other factors that a distributed system introduces." Lewis and Fowler add that remote calls cost more than in-process calls, APIs must be coarser, and moving behaviour between services is harder than inside one process (Microservices).
What you get
Services deploy and scale independently, give a firm module boundary, can use different languages and can be owned by separate teams. Login, payments, inventory and order fulfilment as separate services is the typical example. The gains are real once you have many teams or sharply different load.
Monolith first
Fowler noticed two patterns. Almost all successful microservice stories began as a monolith that grew too big. Almost all systems built as microservices from scratch "ended up in serious trouble" (Monolith First). Two reasons: you don't yet know if the product is useful, and you can't yet draw stable service borders, which is hard even for experienced architects.
Be fair to the evidence. Fowler calls it "sparse" and his advice "tentative", and the pieces date from 2014 and 2015. Tooling has improved since then. The trade-offs have not gone away. He also gives the other side: starting with services gets everyone used to small separate teams, and it can work when you replace an existing system whose borders you already know.
When a vendor proposes microservices, ask who on the team has run them in production, by name and by system, not by brochure. And remember Conway's Law, quoted by Lewis and Fowler: any organisation that designs a system will produce a design whose structure copies the organisation's communication structure. One small team can't sensibly run twenty services. Services follow teams, not the reverse. Fowler says he has seen setups from 60 people with 20 services to 4 people with 200 services, and that it is unclear how service size affects the premium.
His colleagues' technology radar even gave the habit a name: "Microservice Envy". A business with one product team and an ERP that already holds accounts and stock doesn't have a size problem. Start simple.
The decision guide
How do you choose by team size and product stage?
Choose by stage and team, not by trend. Default to a modular monolith on top of a platform you already trust, and split a part out only when a named, measurable pain justifies it.
Six questions to ask first
- 1Teams
How many teams will work on this in the next 18 months?
- 2Proof
Do we already know the product is useful, or are we still testing it?
- 3Numbers that must agree
Which numbers must always agree: stock and ledger, order and invoice?
- 4Scale and release timing
Which parts really need different scaling or release timing?
- 5The 2 a.m. question
Who will run it at 2 a.m., and have they run this style before?
- 6The ERP
What does the ERP already do? Define "done" before the timeline, then choose the shape.
| Stage and team | Recommended shape | Why |
|---|---|---|
| Idea or first release, 1 small team | One layered application, simple modules | Fastest feedback; borders not known yet |
| Live product, 1-2 teams | Modular monolith with module owners | Keeps one transaction, adds discipline |
| Growing, 3+ teams stepping on each other | Modular monolith plus a few separate services at the edges | Split only the parts that hurt |
| Large, many teams, different release or scale needs | Services where borders are stable, plus a core | The premium is now worth paying |
| Replacing a known system | Coarse services or modules from day one is possible | Borders are better known |
Business apps are not consumer platforms. Most business software has tens or hundreds of users, not millions, so load rarely forces a split. The reasons to split are organisational: teams and release timing.
Before designing anything, check what the ERP already does. A platform such as ERPNext covers most standard business flows. Our rule is standard first, then customise the last 5-10 percent that is specific to the business. Build that slice as modules next to the platform, not as a second system that repeats accounts, stock or customers. A standalone service with its own customer and item masters creates two truths, and someone will reconcile them in Excel.
When not to follow the table: if the team already runs a mature platform with deployment automation, monitoring and on-call, and the borders are known, splitting earlier can be fine. If compliance forces isolation of one function, such as payments, isolate that one part. The table is a default, not a law.
Cost of change
What does changing the architecture later cost?
A small decision is cheap to change. A structural one is expensive, and the cost grows with the number of dependencies and the amount of live data. That is the reason to think early, without over-engineering early. We give no money or time figures here, because none could be verified. The costs show up in this order:
- 1Re-draw the borders
Module or service borders move, and every caller changes with them.
- 2Move the data
Splitting one database into several means migrating live records and re-checking reports that joined across them.
- 3Keep totals consistent
What was one transaction becomes several steps that can fail halfway.
- 4Run more things
More deployments, more monitoring, more failure cases.
- 5Retrain people
Team structure has to match the new shape.
Why are boundaries the expensive part? Fowler warns that you can't assume any system can be broken into microservices. Most systems "acquire too many dependencies between their modules, and thus can't be sensibly broken apart", and attempts to decompose a monolith "quickly ended up in a mess" unless the modular design was already good (Monolith First). So the cost of a later split depends mostly on how clean your modules were. Build clean modules now and the option stays open.
He describes three common routes: peel services off at the edges and leave a quiet monolith at the core; replace the monolith and treat it as a "sacrificial architecture" you are happy to discard once it got you to market; or start with a few coarse services and split later. Replacement often turns into a cycle of half-finished moves, so break it into parts, deliver in increments and treat change as normal (Fowler's guide).
Upgrades are a smaller version of the same problem. On Frappe and ERPNext, a yearly major version means some customisations will need rework, so budget a maintenance slot. The lesson for architecture: customise through hooks and standard extension points, not by editing core files, so upgrades stay predictable.
ERP integration
How does architecture affect ERP integration?
Keep the ERP as the system of record for money, stock, parties and documents. Everything custom sits around it and talks through its API, webhooks and background jobs, never around its permissions. This is what Frappe and ERPNext give you out of the box.
REST API with token auth
Authorization: token api_key:api_secret. Create a dedicated integration user with only the roles it needs, not an Administrator key (token authentication docs).Webhooks
X-Frappe-Webhook-Signature header, a base64 HMAC-SHA256 of the payload, so the receiver can verify the sender (webhooks docs).Background jobs
Hooks
hooks.py in each app extends or overrides framework behaviour. When hooks conflict, the last installed app wins, and you can change the order under Installed Applications > Update Hooks Resolution Order (hooks docs).A webhook is the simplest way to push a change out of the ERP. You choose the DocType, say Quotation, the event, say on_update, and the URL that should be called.
Each successful call leaves a Webhook Request Log entry, so you can check what was sent.


Three integration shapes
Inside the platform
A custom Frappe app. Best for logic that needs the same transaction and permissions as the ERP, such as a custom check on Sales Order. Lowest latency, one deployment, one backup.
Beside it, over the API
A small separate app or service that reads and writes ERP records through REST with a scoped API user. Best for portals, mobile apps and tools with a different life cycle.
Event-style, via webhooks
The ERP pushes changes to another system. Best for notifications and syncing a downstream tool. Plan for retries, duplicates and the receiver being down.
Where this goes wrong: a separate app that keeps its own copy of customers or items; one all-powerful key, so nobody can tell who changed what; a synchronous call from the ERP to a slow outside service inside a save, so the save hangs (push it to a background job); and overriding core files instead of using hooks. Also be plain about limits. ERPNext does not ship ready-made connectors for every outside system, and some industry modules are still maturing. Partner and community apps cover many, but they aren't plug-and-play without a developer. The same rule holds for an AI assistant on ERP data: the ERP decides who may see what, and the assistant works through the user's permissions, not around them.
Who decides
Who decides the architecture, and what does an architect do?
The people who build and run the system decide it, with the business owner setting the constraints. A software architect is accountable for the important structural choices and for keeping them in good condition.
What an architect does
What the owner decides
Central or local
What do architects actually use? No special tool. Simple diagrams, written decision records, a repository that enforces module rules, and conversations with the people who run the system. One caution: be careful with a vendor who proposes the architecture and also bills by the number of components. Ask who benefits from a more complicated design, and keep a senior reviewer on your side of the table.
Documentation
How do you document it?
Write short decision records, keep them in the repository, and review them when the context changes. An architecture decision record (ADR) "captures a single architectural decision and its rationale". Together they form a decision log that explains the reasons, trade-offs and consequences (ADR GitHub organisation). A good one is half a page: context, decision, options considered, consequences, date, owner.
Keep five things written down
- 1Context diagram
One page: our system, the ERP, other systems, who uses what.
- 2Data ownership
Which module or system owns which master data.
- 3Integration list
Each integration, its method (REST, webhook, file), the API user and its roles.
- 4Decision log
The why behind each major choice.
- 5Run notes
How to deploy, back up and roll back.
Keep them in the same repository as the code so they change with it. TLVTech also lists documentation among the habits of good architecture.
Mistakes
Which architecture mistakes are most common?
These are the ones we see most when we review custom software and ERP-linked builds.
- Choosing microservices for a small team.
- Building a second source of truth beside the ERP.
- No named module owners, so borders erode.
- Designing for a scale you will never reach while ignoring the change you can see coming.
- Skipping the 2 a.m. question: nobody on the team has run this style in production.
- Customising core instead of using hooks, so every upgrade is a rescue job.
- Architecture on paper only, never checked against the code.
- One integration key with full rights.
- Not writing down why.
- Treating it as a one-time decision instead of revisiting it at each stage.
Next step
What should you do next?
In short
Pick the simplest shape that fits the stage, keep modules clean so you can split later, let the ERP stay the system of record, and write down why.
Custom builds
How we build
Wider choices
Since 2016 we have delivered 200+ projects across 15+ countries with a 50+ in-house team. Talk to us about the right architecture for your next build.
Sources
- Martin Fowler, Software Architecture Guide, 1 Aug 2019, checked 30 Nov 2026
- Martin Fowler, Monolith First, 3 Jun 2015, checked 30 Nov 2026
- Martin Fowler, Microservice Premium, 13 May 2015, checked 30 Nov 2026
- James Lewis and Martin Fowler, Microservices, 25 Mar 2014, checked 30 Nov 2026
- Frappe Framework docs: Architecture, checked 30 Nov 2026
- Frappe Framework docs: Webhooks, checked 30 Nov 2026
- Frappe Framework docs: Token Based Authentication, checked 30 Nov 2026
- Frappe Framework docs: Hooks, checked 30 Nov 2026
- Frappe Framework docs: Running Background Jobs, checked 30 Nov 2026
- Architectural Decision Records, checked 30 Nov 2026
- Capicua, Introduction to Software Development Architecture
- TLVTech, The Fundamentals of Software Architecture
- InfoTechHub, System Design vs Software Architecture




