Skip to content

ERP · 11 min read

ERP System Architecture: A Practical Guide

Abidhusain ChidiFounder and CEO

ERP system architecture sketched in chalk as interface and workflow bands over four module boxes, with posting arrows into one ledger

Key takeaways

  • An ERP has five layers: data, domain modules, workflow, integration and the interface people use.
  • For most custom ERPs built for one company, a modular monolith beats microservices, because one posting touches several modules.
  • Give every table exactly one module allowed to write to it, and let the others read through that module's interface.
  • Post each document in one database transaction, lock it afterwards, and correct mistakes by reversal, never by edit.
  • Put the legal entity on every document and ledger row from day one, even with one company.
  • Split a part into its own service only when its load, its team or its release clock differs from the rest.

ERP system architecture is how an ERP is divided into five layers: the data, the domain modules, the workflow rules, the integrations and the interface. For most custom builds the right shape is a modular monolith, meaning one application and one database with hard walls between the modules. A posting model then keeps stock and accounts in step. This guide takes each layer in turn, shows where module boundaries go, and says when splitting into services is worth the cost.

ERP system architecture sketched in chalk as interface and workflow bands over four module boxes, with posting arrows into one ledger

It is written for owners weighing a custom build and for the developers they hire. If you need the module list first, read our guide to what each ERP module does. ERP architecture and data design is a phase of its own in our custom ERP development process. It takes two to four weeks and ends with an approved data model before any module is built, because these choices are the hardest to undo.

ERP system architecture in five layers

Every ERP, packaged or custom, has the same five layers. What differs is where each one draws its lines. The diagram below stacks them in the order a request travels, from the screen down to the database, with integrations along the side.

ERP system architecture diagram with interface, workflow, six domain modules and the data layer stacked, and an integration layer linking accounting, e-invoicing, banks and an online shop
Five layers in one application and one database, with integration along the side
LayerWhat it holdsThe rule that keeps it cheap to change
InterfaceScreens, lists, dashboards, barcode flowsNo business rule exists only in a screen
WorkflowDocument states, approvals, alertsRules sit in one place
Domain modulesInventory, purchase, sales, production, finance, HREach table has one module that may write to it
IntegrationAccounting sync, e-invoicing, banks, online shopOne component owns every external call
DataMasters, documents and ledgersThe database enforces what must always be true

The data layer: masters, documents and ledgers

Three kinds of record live here. Masters change slowly: items, customers, suppliers, locations, accounts. Documents record events, such as a goods receipt or an invoice. Ledgers record the effect of each event as rows that are only ever added. Keep the three apart and most reports become plain queries. Mix them, however, and every report turns into a reconciliation.

The database itself should guard what must always hold. A stock movement needs an item and a location, and a journal must balance. The stack on our ERP page pairs PostgreSQL or MySQL with strict constraints for stock and money. A rule kept only in application code is one bug away from being broken.

Domain modules: each record has one owner

A module is a slice of the business with its own tables, documents and rules. Inventory owns stock movements, purchase owns purchase orders, and finance owns the journals. The test of a boundary is simple: for any table, you can name the one module allowed to write to it.

Other modules still read that data, but they go through the owner. Sales never inserts rows into the stock ledger. Instead, it asks inventory to reserve or issue stock, and inventory decides. In code this is a published interface per module, a short list of commands and queries. Everything behind it stays private, so you can rewrite the costing logic without touching sales.

The workflow layer: states and approvals

Workflow decides what may happen next. A purchase order moves from draft to approved to received, and above a set value it needs a second approver. Rules like these change more often than anything else, so they belong in one place rather than spread across screens. Workflow says who may act and when, while the module decides what the action means. Even so, resist turning every rule into a setting, because each setting adds a screen that someone must build, test and document.

The integration layer of an ERP system

An ERP seldom replaces the accounting package. Finance and the auditors already rely on it, so the new system connects to it instead. Add e-invoicing, banks, payment gateways and an online shop, and the edge of the system gets crowded. So let one component own every external call. It holds the credentials, queues requests, retries failures and records what went out and what came back.

How hard that is depends on the other side. Products such as Xero, Zoho Books and QuickBooks Online expose REST APIs and webhooks, so a two-way sync is routine. TallyPrime, by contrast, has no webhooks, so the ERP polls it on a schedule and checks that both sides agree. Requests go over HTTP as XML or, from release 7.0, JSON, according to Tally’s JSON integration guide (updated 20 May 2026). It is the same craft as any backend development work: written contracts, one auth pattern and one log of every exchange.

The interface layer: screens for each role

People judge the system by its interface, yet this layer should hold the least logic. Office staff want keyboard-first entry, stores want barcode scanning on a phone, and owners want a dashboard. When all three call the same module interfaces, a rule fixed once is fixed everywhere. A mobile app added in year three then needs no second copy of the logic.

Modular monolith vs microservices in ERP architecture

A modular monolith is one deployable application with one database, divided inside into modules that keep to their own tables. Microservices split those modules into separate applications, each with its own database, talking over the network. Our general post on monoliths and microservices covers the trade-off for any kind of system. For ERP system architecture, one difference outweighs the rest: a single business event usually touches several modules at once.

Take a delivery note. Posting it takes stock out of a location, moves cost into the accounts and closes part of a sales order. In a monolith those writes commit together or not at all. Across services each one commits on its own, so you need extra machinery to undo the first write when the third fails.

QuestionModular monolithMicroservices
Posting one documentOne database transactionSeveral commits, with compensating steps
Reports across modulesA query on one databaseData copied to a reporting store first
Moving a boundaryA refactor in one codebaseNew APIs and a data migration
Team it suitsOne team, or a fewSeveral teams releasing separately
HostingOne app and one databaseA platform that runs many services

Martin Fowler put the rule bluntly in Microservice Premium, dated 13 May 2015: “don’t even consider microservices unless you have a system that’s too complex to manage as a monolith.” Most custom ERPs built for one company are not that complex. When we built Bloomford, a hiring portal rather than an ERP, we judged a modular monolith the right answer. It gave the client a single deployable to host wherever it chose, with clean seams for later integrations.

Where module boundaries go

Draw boundaries around documents and the decisions they carry, not around screens or departments. List every document the business produces, then name the module that creates it and the ledger it posts to. No document should need two modules to create it. Wherever one does, the boundary sits in the wrong place.

Shared masters need an owner too. Almost every module uses items and parties, so give them a small master-data module and let the others read from it. Otherwise each module grows its own item list, and the copies drift apart. Expect to move a few lines once the system is in use, which is cheap inside one codebase. In Monolith First, dated 3 June 2015, Fowler wrote: “Any refactoring of functionality between services is much harder than it is in a monolith.”

When splitting an ERP into services pays

Pulling a part out into its own service is worth it when that part has needs the rest does not share:

  • Different load. A stock lookup that an online shop calls far more often than the back office does.
  • A separate team. Another team owns the part and releases it on its own schedule.
  • An outside clock. An e-invoicing connector that must change when a tax authority changes its format.

Fowler’s list in Microservice Premium is close: large teams, multi-tenancy, many user interaction models, functions that evolve independently and scaling, with sheer size the biggest factor. In practice the first split comes at the edge, such as an integration hub, while the posting core stays in one database. Our ERP page names Laravel for modular backends and NestJS where events and integrations dominate.

The posting model that keeps ERP modules consistent

The posting model is the part of ERP system architecture that keeps every module honest. A document starts as a draft that anyone with the right role can edit. Posting is a single step. It checks the rules, gives the document its final number and writes its effects to the ledgers. After that the document is locked, and its effects are facts.

The figure below follows one delivery note through that step. All of its writes sit in one database transaction, which the PostgreSQL documentation on transactions (read 25 November 2026) says “bundles multiple steps into a single, all-or-nothing operation”. So if the journal fails to balance, the stock rows go with it.

Posting a delivery note in one database transaction: the status moves to posted, a stock ledger row of minus 12 and a balanced 300.00 journal are written, then the document is locked
One transaction writes the stock and journal rows together, or writes nothing
Code
BEGIN;
-- post delivery note DN-1042 (draft to posted)
UPDATE delivery_note SET status = 'posted'
 WHERE id = 1042 AND status = 'draft';
INSERT INTO stock_ledger (item_id, location_id, qty, doc)
 VALUES (77, 3, -12, 'DN-1042');
INSERT INTO journal_line (account, debit, credit, doc) VALUES
 ('Cost of goods sold', 300.00, 0, 'DN-1042'),
 ('Inventory', 0, 300.00, 'DN-1042');
COMMIT;

The values are only an example. The application aborts if the status update touches no row, so a document cannot post twice. Ledger rows are inserts, never updates, and the journal balances before the commit.

Correct by reversal, never by edit

Nobody edits a posted document. If a delivery note was wrong, you post a reversal that cancels its rows, then a corrected document, and the history keeps both. Auditors expect exactly this. It also means stock on any date comes from adding up the stock ledger rows to that date, so any figure traces back to its documents. Balances can sit in a cache for speed, but the cache is rebuilt from the ledger and never typed in.

Tenancy and hosting in ERP system architecture

Two choices sit outside the modules but shape all of them: who shares the installation, and where it runs.

Single-tenant, multi-entity or multi-tenant

ModelWhat it meansWho it suits
Single-tenantOne company, its own application and databaseA business commissioning its own ERP
Multi-entitySeveral legal entities in one installation, each with its own booksA group with subsidiaries or free-zone companies
Multi-tenantMany unrelated customers in one installation, walled offA company selling an ERP as a product

A business building its own ERP nearly always wants single-tenant with multi-entity support. Put the legal entity on every document and ledger row from day one, even with one company today, because adding it later touches every table and report. Multi-tenancy, on the other hand, is a product decision. It earns its cost only for a vendor that will sell the system to others.

Cloud or on-premise ERP system

For a modular monolith this is a hosting question more than an architecture one. One application and one database run on a cloud account or on your own server. Cloud suits most businesses, because automated backups and disaster recovery are simpler there. On-premise still fits a site with a weak connection or a policy that keeps data in-house.

Either way, the code and the hosting accounts should be yours. Our ERP terms hand you the full source, with documentation, in a repository you control, so moving hosting later is your call alone. The awkward case is a cloud ERP that must reach an accounting package on an office PC. That usually needs a small connector inside the office network, so plan it early.

ERP architecture mistakes that are expensive to change

These ERP system architecture mistakes look harmless in the first month. Each one, however, costs more with every module built on top of it:

  • Editable posted documents. Fix an invoice in place and the ledger no longer explains the balance.
  • Modules writing each other’s tables. A shortcut that lets sales change stock directly works once. After a year of them, no module can change without breaking another.
  • Rules that live in screens. A discount limit checked only on the order form is skipped by the import and the API.
  • Permissions added at the end. Roles limited to certain locations reach into every query. Bolted on late, they leak.
  • One-off integration scripts. Each has its own credentials and retries, and each fails quietly at night.
  • Microservices before the boundaries are known. Every wrong guess becomes an API to version and data to move.
  • Heavy reports on live tables. Month-end reports compete with the warehouse for the same database. A read replica solves it.

Who should not commission a custom ERP architecture

All of this assumes that building custom makes sense, and often it does not. Our ERP page is plain about when to buy a package instead. That applies when your processes are ordinary and you must go live within eight weeks. It also applies with under fifteen users and no odd workflows. The same goes when nobody on your side will own the system after launch. In those cases the ERP system architecture a package ships with is good enough, and a design of your own spends money a package would have saved.

A software company planning to sell an ERP to many customers should also pause, since it needs a SaaS product design with tenancy and billing at its centre. Likewise, a team that wants microservices because the system might grow should reread the delivery note example. The cost arrives on day one, while the benefit may never come.

How to review an ERP system design before the build

Whoever builds your ERP, ask to see the ERP system architecture before the first module is coded. Six questions cover the essentials:

  1. For each main table, which module may write to it?
  2. What happens, row by row, when a goods receipt is posted, and is it one transaction?
  3. How does a user correct a posted document?
  4. Where do approval rules live, and who can change them?
  5. Which component makes each external call, and where are failures logged?
  6. Is the legal entity on every document and ledger row?

Clear answers usually mean the system will still be easy to change in its fifth year. That matters, because an ERP tends to outlive the team that built it. As our ERP page puts it, these systems stay in service for ten years or longer, which is why the stack should be proven technology a future team can maintain.

TagsArchitecturecustom erpCustom ERP DevelopmentMicroservicesModular Architecture

Written by

Abidhusain Chidi

Founder and CEO

Founder of QalbIT Infotech and the engineer who still scopes most of its projects. Writes about what custom software really costs, how build-versus-buy decisions play out two years in, and the delivery habits that keep a product shipping, drawn from CRM, ERP, SaaS and MVP work Abid has been building since 2014 and the products QalbIT runs itself today.

FAQ


Frequently asked questions

It is how an ERP is divided into layers and modules: a data layer of masters, documents and ledgers, domain modules such as inventory and finance, workflow rules, an integration layer and the interface. Good architecture keeps each module's data and rules behind a clear boundary.
Usually not at the start. Posting one document, such as a delivery note, writes to stock and to the accounts at once, and a single database transaction handles that cleanly. Start with a modular monolith and split out a part only when its load, team or release schedule differs from the rest.
One deployable application with one database, divided inside into modules that keep to their own tables and talk only through published interfaces. It keeps transactions simple and leaves clean seams if a module later needs to become a separate service.
Only if you plan to sell it to other companies. A business building its own ERP normally wants single-tenant with multi-entity support, so each legal entity keeps its own books inside one installation.
Yes. A modular monolith is one application and one database, so it can run in a cloud account or on your own server. Cloud makes backups and disaster recovery simpler to automate; on-premise suits sites with weak connections or a policy that keeps data on your own servers.
In our process it is a phase of two to four weeks after discovery. It closes once the data model is approved, the screens are designed and the integrations are planned, before any module is built. Each phase is set out on the ERP service page.
Posted documents that can be edited, modules writing each other's tables, balances kept as plain fields, rules that live only in screens, permissions added at the end and one-off integration scripts. Each one costs more with every module built on top of it.

Newsletter

Join 1,000+ smart readers

One email a month on building software that ships. Unsubscribe anytime.

Next step


Want the same clarity for your product?

A short call. A written range. No obligation.