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.

A building of tightly fitted modular blocks on a wide base slab, with one block slid half out on a rail and linked back by cables
Published 17 min read
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

One codebase or several, and how the parts are split.

Data

One database or many, and which part owns which table.

Connections

How it links to the ERP and other systems, and how users sign in.

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?

LevelInvoicing app exampleCost to change
ArchitectureOne deployable application with clear modules, one relational database, a REST link to the ERPA quarter, if you move from one database to five
DesignHow the Invoice module is organised and which functions handle taxDays to weeks
CodeThe tax function itselfAn 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

Screens, business rules, data access and a database, each as a layer. The default for business software and CRMs.

Client-server

A client asks, a server answers, over HTTP. Every web app is this at the outer level.

Monolith

One codebase deployed as one unit. Any change means rebuilding the whole server-side application (Lewis and Fowler).

Microservices

Small services, each in its own process, built around business capabilities and deployed independently.

Event-driven

Parts react to events like "invoice submitted" instead of being called directly. Good for alerts, harder to trace.

Microkernel

A small core plus add-ons, like browsers and CMS tools. Frappe's app model is close to this idea.

Serverless

Third-party backend services and short-lived functions replace an always-on server. Less to run, more reliance on vendors.

Pipe-and-filter and peer-to-peer exist too, but they are rare in business software.

PatternFits whenMain cost
Layered monolithOne team, one product, clear rulesLayers get tangled if nobody polices them
Modular monolithGrowing team, one deploymentNeeds discipline on module borders
MicroservicesMany teams, parts that scale or release separatelyOperations load, data consistency, network failures
Event-drivenMany systems must react to the same changeHarder debugging and testing
Plug-in (microkernel)One core, many optional extrasThe core's interface must stay stable
ServerlessSpiky, small, event-style jobsVendor 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).

1

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.

2

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.

Frappe bench directory structure showing how apps connect to web, redis, node and the database
Screenshot: the Frappe bench structure. Source: ERPNext documentation (Frappe)

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).

1

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).

2

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

  1. 1
    Teams

    How many teams will work on this in the next 18 months?

  2. 2
    Proof

    Do we already know the product is useful, or are we still testing it?

  3. 3
    Numbers that must agree

    Which numbers must always agree: stock and ledger, order and invoice?

  4. 4
    Scale and release timing

    Which parts really need different scaling or release timing?

  5. 5
    The 2 a.m. question

    Who will run it at 2 a.m., and have they run this style before?

  6. 6
    The ERP

    What does the ERP already do? Define "done" before the timeline, then choose the shape.

Stage and teamRecommended shapeWhy
Idea or first release, 1 small teamOne layered application, simple modulesFastest feedback; borders not known yet
Live product, 1-2 teamsModular monolith with module ownersKeeps one transaction, adds discipline
Growing, 3+ teams stepping on each otherModular monolith plus a few separate services at the edgesSplit only the parts that hurt
Large, many teams, different release or scale needsServices where borders are stable, plus a coreThe premium is now worth paying
Replacing a known systemCoarse services or modules from day one is possibleBorders 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:

  1. 1
    Re-draw the borders

    Module or service borders move, and every caller changes with them.

  2. 2
    Move the data

    Splitting one database into several means migrating live records and re-checking reports that joined across them.

  3. 3
    Keep totals consistent

    What was one transaction becomes several steps that can fail halfway.

  4. 4
    Run more things

    More deployments, more monitoring, more failure cases.

  5. 5
    Retrain 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

A user generates an API key and secret under User > Settings > API Access, and each request is authenticated as that user, so "roles will be checked against this user". The header is 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

Under Integrations > Webhook pick a DocType, a doc event, optional conditions and a request URL. An optional secret adds an X-Frappe-Webhook-Signature header, a base64 HMAC-SHA256 of the payload, so the receiver can verify the sender (webhooks docs).

Background jobs

Frappe uses Python RQ with short, default and long queues, so heavy work doesn't hold up web workers (running 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.

ERPNext Webhook Request Log entry for a successful call
Screenshot: a Webhook Request Log entry. Source: ERPNext documentation (Frappe)
ERPNext Webhook form with DocType, doc event and request URL fields
Screenshot: the Webhook form under Integrations. Source: ERPNext documentation (Frappe)

Three integration shapes

1

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.

2

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.

3

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

Fowler says a developer acting as architect needs "to recognize what elements are important" and which ones will cause serious problems if left uncontrolled, then keep them in good condition (guide). In a small team this is a hat a senior developer wears, not a separate job title.

What the owner decides

What must never go down, which numbers must always agree, how many users and teams to expect in two years, the budget and date, and who will maintain it. The owner does not choose between patterns.

Central or local

Fowler warns of a central group that approves everything and of no coordination at all. For a mid-size company: one named technical owner per system, a short list of shared rules (sign-in, ERP integration, logging), freedom inside that.

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

  1. 1
    Context diagram

    One page: our system, the ERP, other systems, who uses what.

  2. 2
    Data ownership

    Which module or system owns which master data.

  3. 3
    Integration list

    Each integration, its method (REST, webhook, file), the API user and its roles.

  4. 4
    Decision log

    The why behind each major choice.

  5. 5
    Run 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

We do custom software development on Frappe and Python.

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.

Talk to our Experts

Ready to Scale with Smart Tech? Let's Talk.

Transform your business processes with AI-powered automation and expert implementation.

200+ projects since 2016
Questions buyers ask

Frequently Asked Questions

Find answers to common questions about our services

What is software architecture?

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 is worth deciding deliberately. For a business app that usually means one application or several, one database or many, and how it connects to the ERP.

What are the main types of software architecture?

Sources group them differently, but the common ones are layered, client-server, monolithic (plain or modular), microservices, event-driven, microkernel (plug-in) and serverless. Most real systems mix two or three. A typical business app is a layered, modular monolith with a queue for background work and a few integrations.

What is the difference between architecture and design?

Architecture covers the structure of the whole system and decisions that are costly to reverse, such as one database or many. Design covers how one part is built, such as how a tax module is organised. A practical test is reversal cost: a design choice can change in days, an architecture choice may take months.

Do I need microservices?

Usually not at the start. Martin Fowler's advice is not to consider microservices unless the system is too complex to manage as a monolith, because they add deployment, monitoring and consistency work. They make sense with many teams, parts that must release or scale separately, and stable service boundaries. Most business apps are better as a modular monolith.

What is a modular monolith?

A modular monolith is one application deployed as one unit, with firm internal borders: each module owns its data and exposes a small interface. You keep simple deployment and single transactions, and you keep the option to split a module out later. It needs discipline, such as review rules and tests that fail when borders are crossed.

Who decides the software architecture?

The team that builds and runs the system decides, led by a senior developer or architect, with the business owner setting constraints such as budget, uptime, number of users and deadlines. The owner should not pick patterns, but should ask for the reasons in writing and require a reviewer who checks the architecture against the real code.

What does a software architect do?

A software architect is accountable for the important structural choices and for keeping them healthy as the system grows. They decide module borders, integration methods and data ownership, record the reasons, and review the code for long-term damage. In small teams a senior developer does this alongside programming, rather than as a separate role.

How does architecture affect ERP integration?

It decides where custom logic lives and how it talks to the ERP. A good shape keeps the ERP as the system of record and connects through its API, webhooks and background jobs, with a scoped API user per integration. A bad shape duplicates masters in a second system, so numbers drift apart and someone reconciles them in Excel.

How hard is it to change architecture later?

It depends on how clean the modules are. Moving a boundary or splitting a database is far harder than changing code inside a module, and systems with tangled dependencies often cannot be sensibly broken apart. Clean modules, scoped integrations and written decision records keep later change affordable.