FinWPS Architecture Operation-based accounting and the REA model

Accounting System Architecture: Why Substance Matters More Than Form

How FinWPS implements the REA model in RAM

Accounting and ERP systems can be designed around two different ideas of what constitutes the basic unit of accounting. This choice determines whether the system helps a business develop or forces real processes to fit rigid software structures and slow disk-based databases.

The FinWPS (Finance Without Problems) platform is based on accounting from the business operation, with calculations performed in RAM (In-Memory Computing). This article explains how this approach differs from the document-centric model and how it relates to REA.

1. The document-centric trap: form over substance

Most modern commercial systems use a document-centric architecture. The central entity in the database is an electronic equivalent of a paper form, such as a goods receipt note, a certificate of completion, an expense report, or an invoice.

The usual workflow is straightforward: the user fills in a screen form and clicks Post. An algorithm tied to that document type generates movements in disk-based register tables and creates accounting entries.

The main drawback is that business logic is tightly bound to the document form. If a real transaction or manufacturing process does not fit the standard template, the company has two options: ask developers to create another document type or use manual entries, which undermines the consistency of automation. Virtual paper ends up dictating rules to the real business.

2. Operation-based accounting and William McCarthy's REA model

The alternative approach puts the completed economic fact, or event, at the center rather than the accompanying paperwork. Source documents, delivery notes, certificates, and receipts serve as visual representations, consequences, or printable attachments to the recorded substance of the operation.

The theoretical foundation for this concept was developed by American accounting scholar William E. McCarthy. In 1982, he published an article in The Accounting Review introducing the REA (Resources, Events, Agents) model. McCarthy showed that Luca Pacioli's double-entry bookkeeping, with debits and credits, is not a law of nature. It is a 15th-century technique for checking records kept manually on paper.

McCarthy proposed building computerized accounting systems as a description of the real business using three basic elements:

Economic Duality instead of debits and credits

A pure REA model does not use artificial accounting accounts at the data storage level. Instead, it applies the principle of Economic Duality: every meaningful business action is an exchange in which a company gives up one resource to obtain another.

When materials are purchased, the database records two real historical facts instead of an abstract accounting entry:

  1. Decrement event: the cashier pays 100,000 rubles to the supplier.
  2. Increment event: the storekeeper receives 2 metric tons of metal from the supplier.

These events are connected by a Duality relationship: Event 1 occurred in exchange for Event 2. With this approach, balances are not stored in static tables. They are calculated as needed from the complete history of recorded events.

3. FinWPS: the REA model in practice

One of the first implementations of the operation-based approach in Russian software practice was created by Arkady Vodyanik, the author of the original Finance Without Problems architecture. The modern FinWPS platform develops these ideas by combining McCarthy's model with its own engineering solutions.

Theoretical REA models implement duality through relationships in a relational database graph. FinWPS uses programmatic encapsulation instead. Its primary entity is the Business Operation, a single algorithmic container that includes economic duality.

4. In-memory performance

A database architect familiar with REA may reasonably ask: If balances and reports are calculated dynamically from primary events, will performance degrade after hundreds of thousands of operations accumulate?

This problem does arise in conventional systems that store and process data in disk-based DBMS platforms. Constant disk I/O, index reads, and table locks during concurrent work can cause significant delays.

The Finance Without Problems architecture uses In-Memory Computing. This principle was adopted long before it became widespread in expensive corporate ERP systems:

5. The Operation Tree as a description of the enterprise

An important part of FinWPS is the Operation Tree, a hierarchical structure that describes events possible within an organization. The database records what happened, while the Operation Tree shows what can happen in the company's business and other activities.

When designed by a specialist who understands how the company works, the tree becomes a map of its processes:

6. Inventory accounting and analytical properties

Standard accounting and the main reporting forms for most types of business have long been reliably implemented in this architecture. Equally important is how the financial side connects with operational and inventory accounting within a single in-memory database.

In many accounting systems, the warehouse and the accounting department work separately. The storekeeper works with item names, packages, and storage locations, while the accountant sees an aggregated amount on an inventory account. In FinWPS, analytical inventory records are connected directly to accounting.

Any resource can be assigned arbitrary analytical properties (extra parameters): dimensions, grades, batches, serial numbers, characteristics, or links to specific objects. Accounts and extra parameter indexes share the same memory space. When an operation is executed, the system updates physical inventory balances across all analytical properties and monetary valuations on accounting accounts within a fraction of a second. This prevents discrepancies between warehouse and accounting data at the architectural level.

7. Industry solutions without external modules

The combination of the in-memory core, Operation Tree, and analytical properties allows complex manufacturing and industry-specific tasks to be handled in one database. A traditional approach might require separate MES, WMS, or TMS applications and their integration.

Example 1: Multi-stage furniture manufacturing

In conventional systems, the physical movement of parts between workshops is tracked in a production application, while cost and payroll calculations are performed in accounting. In FinWPS, the entire factory cycle is described by a single Operation Tree.

Each product has its own hierarchical routing chain through production areas:

  1. Raw material procurement and incoming quality control;
  2. Transfer of materials between production areas;
  3. Part processing and staged assembly of intermediate units;
  4. Final product assembly, shipment to the customer, and receipt of revenue.

At each step, the operation algorithm changes the physical state of resources in the workshop and simultaneously creates its financial representation. The cost of consumed materials is included in the assembled unit, while piece-rate wages are accrued to workers in the relevant production area according to predefined rates. By the time the finished product leaves the assembly line, its cost, taxes, and the company's accounting balance have already been calculated in RAM.

Example 2: Fleet and garage accounting

Another example is managing a company vehicle fleet, where technical operations are closely connected with finance. A single FinWPS Operation Tree describes garage processes:

Every event, whether closing a trip ticket or replacing a part in the garage, is reflected in the parallel accounting records. Fuel and materials are written off, wages are accrued to drivers and mechanics, the cost per ton-kilometer is calculated, and statutory accounting reports are generated.

Conclusion

The Finance Without Problems (FinWPS) architecture combines two features: its approach to describing accounting and its computing technology.

The REA model and the hierarchical Operation Tree provide a universal language for managing states. It can describe a furniture factory, a vehicle fleet, a warehouse, or engineering systems. Keeping data and algorithms directly in RAM provides high performance compared with conventional systems tied to disk storage and paper document forms.

← Back to the architecture overview

Back to the top ↑