System Integration · 29.08.2026

From spaghetti integrations to event-driven architecture

We explore strategies for modernizing legacy IT infrastructure by implementing an API layer and event-driven architecture to resolve point-to-point integration chaos.

Modern large enterprises are increasingly finding themselves trapped by their own IT infrastructure. Over years of business development, dozens of systems—from ERP and CRM to local databases—have become entangled with direct connections. This chaos of point-to-point (P2P) integrations, known as "spaghetti architecture," has become the primary barrier to digital transformation. Any attempt to update a single module triggers cascading failures in adjacent systems, turning infrastructure maintenance into a constant cycle of "firefighting."

For CTOs and architects, this presents a classic dilemma: replacing a mission-critical legacy core carries massive risks to business processes and requires significant investment, while maintaining the status quo blocks scaling and the deployment of new services. The way out of this deadlock is gradual modernization through the isolation of legacy systems using a modern API layer and a subsequent transition to event-driven architecture (EDA).

Anatomy of spaghetti integrations: why point-to-point architecture blocks business growth

When a system has only three components, connecting them requires three integration channels. But when there are ten, the number of potential connections grows according to the formula N*(N-1)/2, reaching 45. In a large corporation with hundreds of services, this network becomes completely unmanageable. Instead of structured data exchange, a chaotic web of direct connections emerges.

The main signs and problems of such an architecture include:

  • Direct database-to-database access: Instead of using an API, systems synchronize via shared tables or direct SQL queries. This violates data encapsulation—any schema change in one database can break the logic of another.
  • Tight coupling: The message sender must know the exact address of the receiver, its protocol, and data format. If the receiver is temporarily unavailable, the sender's transaction is blocked or lost.
  • Security vulnerabilities: According to the ENISA Threat Landscape 2025 report, the exploitation of legacy protocols and infrastructure remains a serious risk for digital systems. Legacy integrations often use plaintext protocols without proper authorization, creating holes in the security perimeter.
  • Lack of end-to-end auditing: It is practically impossible to record who changed a record in such a network, when, and why. Logs are scattered across different servers and often use incompatible formats.

Hohpe & Woolf patterns: theoretical foundation for untangling the chaos

To move from chaos to a managed system, architects use classic approaches described by Gregor Hohpe and Bobby Woolf in their fundamental work, Enterprise Integration Patterns (EIP). This methodology provides a formalized language for designing integrations through concepts of channels, routers, and translators to move away from point-to-point chaos.

Key EIP tools for solving the "spaghetti" problem include:

  • Message Translator: Allows systems to communicate in their own formats. The translator converts legacy formats into modern JSON, isolating business logic from the specifics of a particular interface.
  • Content-Based Router: Analyzes the content of a message and dynamically directs it to the required recipient without hardcoding IP addresses into the sender's code.
  • Message Channel: Abstracts the delivery method, ensuring that the sender interacts only with the channel rather than directly with the end service.

API gateway as the first step: wrapping legacy systems in modern REST API

Modernization is difficult to achieve in a single day. The first practical step is creating an abstraction layer over the legacy infrastructure. Instead of rewriting old code, interfaces of legacy systems are "wrapped" in modern REST API.

As Kong experts note in their API gateway architecture materials, centralizing critical functions—such as authentication, rate limiting, and traffic observability—at the gateway level significantly reduces integration fragility. The gateway takes on the responsibilities of token validation and traffic management, relieving the legacy system of inappropriate loads.

Building a domain metadata model based on UnityBase for rapid integration

To avoid lengthy manual writing of REST connectors for every legacy database table, it is advisable to apply a model-driven development approach. The instrumental foundation for this can be the UnityBase platform (a joint development by companies within the Intecracy Group alliance, where InBase is a key, but not the only, developer). It allows for the construction of a unified domain metadata model that describes the data structure and business entities of the systems.

UnityBase enables the use of a built-in DBMS-agnostic ORM over the domain metamodel. The platform automatically generates ready-to-use REST API based on these declarative descriptions. This allows data from various legacy sources to be combined into a single logical layer, minimizing the need for direct physical table migration. New services interact with the metamodel through the generated API, while the platform isolates the old core from direct, uncontrolled queries.

Transitioning to event-driven architecture: asynchrony, event replication, and auditing

Although REST API solves the problem of interface unification, interaction remains largely synchronous. To achieve true loose coupling, it is necessary to transition to an event-driven architecture.

In an event-driven architecture, systems publish events to a central message broker (e.g., Apache Kafka) rather than calling each other directly. Other systems subscribe to the relevant topics.

According to Confluent development documentation, using Apache Kafka ensures event streaming with the ability to replay events. This is critical for tasks such as:

  • State reconstruction: In the event of a failure, one can "replay" the event stream and restore the current data state.
  • Reliable audit trail: Each event is recorded as a fact of data change in legacy systems, allowing for end-to-end auditing.

Security and access control: RBAC, RLS, and requirements for enterprise/defense systems

When opening access to legacy data via API, it is crucial to implement granular control. Using the mechanisms of the UnityBase platform allows for the implementation of advanced security models directly at the abstraction level:

  • Role-Based Access Control (RBAC): Clear separation of access rights for users and external services to specific metamodel entities.
  • Row-Level Security (RLS): Restricting access to specific records based on context or role.

For high-load systems or infrastructure with heightened security requirements (e.g., in the public sector or defense), the platform's official documentation recommends using commercial Enterprise (EE) or Defence (DE) editions. These expand basic capabilities by adding integration with certificate authorities (CRL/OCSP), stricter authentication requirements, and module integrity verification, which helps securely integrate old systems into a modern, protected perimeter.

Maturity scale of enterprise integration architecture

The modernization process is an evolutionary path. The table below illustrates the stages of transitioning from chaos to a managed integration infrastructure.

Maturity LevelArchitecture Characteristics
Level 0: ChaoticPoint-to-point connections, direct access to legacy system databases, lack of API management.
Level 1: Centralized API layerImplementation of API Gateway, unification of protocols, authorization at the gateway level.
Level 2: Metamodel and abstractionUsing UnityBase to create a unified domain metadata model, isolation of the legacy core.
Level 3: Event-drivenImplementation of event-driven architecture, asynchronous exchange via message brokers, CDC.
Level 4: Optimized enterpriseFull transaction auditing, dynamic RBAC/RLS access control, readiness for high loads.

A step-by-step approach—from creating an API layer to implementing event-driven architecture—allows an enterprise to untangle spaghetti integrations, ensure end-to-end auditing, and scale the business without the need to immediately abandon mission-critical legacy systems.

FAQ

How can a legacy system be modernized without stopping core business processes?

Modernization should be conducted iteratively, isolating the legacy core. First, a modern API layer is created over the legacy system to handle new requests. External consumers begin interacting with the unified API, which remains stable, while internal legacy modules can be gradually replaced without interrupting business processes.

Which enterprise integration patterns (EIP) are best suited for replacing point-to-point connections?

The primary patterns for eliminating rigid point-to-point connections are Message Channel for abstracting delivery methods, Message Translator for converting formats between systems, and Content-Based Router for dynamically managing data flows.

How can security and access separation (RBAC/RLS) be ensured when exposing legacy data via API?

This is achieved by using an integration layer based on platforms with built-in security mechanisms, such as UnityBase. This allows for the centralized implementation of role-based access control (RBAC) and row-level security (RLS) policies, verifying permissions before a request ever reaches the vulnerable legacy database.

Data sources

← All materials