Integration & APIs
How to integrate legacy systems with modern APIs
Learn how to connect legacy systems to modern APIs using adapters, middleware, and messaging, without replacing business-critical software.
Legacy system integration connects older applications to newer software so they can exchange data and support the same business processes. It helps businesses reuse reliable systems for inventory, orders, or finance while giving tools such as a CRM or customer portal access to the information they need.
API integration is one way to make that connection. A modern application can call an API directly or use an adapter that wraps a supported legacy interface. Where the legacy system only provides file exports, database views, or change feeds, those interfaces can supply the data behind a modern API or support a separate synchronization flow.

What is legacy system integration?
To see where the boundary between systems matters, consider an inventory example.
For example, imagine a manufacturing company using an older ERP application to manage inventory and production.
The company introduces a modern e-commerce platform.
Customers need to see current product availability, but the inventory information exists only in the ERP.
An integration can retrieve inventory data from the legacy system and make it available to the online store.
The ERP remains responsible for inventory management, while the e-commerce platform provides the customer-facing experience.
This approach allows businesses to introduce new capabilities without immediately replacing existing systems.
Why are legacy systems difficult to integrate?
Older applications were often designed before modern API standards became common.
They may rely on technologies such as:
- Proprietary communication protocols.
- SOAP services.
- File-based data exchange.
- Direct database access.
- Remote procedure calls.
- Mainframe interfaces.
- Vendor-specific integration mechanisms.
Some applications don’t expose any external interface at all.
Other challenges include limited documentation, outdated security mechanisms, and developers who are no longer available.
The goal is to find a reliable way to communicate with the existing system without compromising its stability.
Five approaches to legacy system integration
There is no universal solution.
Start with the interfaces the vendor supports, how fresh the data must be, and what should happen if either system is offline. These approaches can work together. For example, middleware can fetch data through an API adapter and publish changes to a message queue.
1. API adapters and wrappers
An API adapter is a software component that translates between a legacy interface and a modern API.
For example, an older application might expose functionality through a proprietary protocol.
An adapter can communicate with that protocol and expose the functionality through a REST API.
A modern application can then send an HTTP request such as:
GET /api/customers/123
The adapter retrieves the customer information from the legacy system and returns it in a modern format such as JSON. A wrapper fits when another application needs a small set of on-demand operations and the legacy interface can meet the required response time.
Advantages:
- Modern applications don’t need to understand the legacy protocol.
- Existing functionality can be reused.
- Access can be controlled through a dedicated interface.
Considerations:
- The adapter needs maintenance.
- Legacy performance limitations still apply.
- Error handling and data transformation must be designed carefully.
2. Integration middleware
Integration middleware connects applications and coordinates communication between them.
Platforms such as MuleSoft provide capabilities for connecting enterprise systems, transforming data, and exposing APIs.
For example, an integration platform could connect an older ERP system with Salesforce.
The integration might:
- Retrieve customer records from the ERP.
- Transform the data into the required Salesforce format.
- Create or update records in Salesforce.
- Record successful and failed operations.
- Retry recoverable failures.
Middleware is particularly useful when multiple systems need to communicate and integration logic should be centrally managed.
However, it introduces platform costs and operational responsibilities. A software technical audit can help establish which interfaces are supported and where an existing integration is fragile before you choose an approach.
3. File-based integration
Some legacy applications can only export or import files.
Common formats include CSV, XML, and fixed-width text files.
For example, an older accounting application might export invoice data every night.
An integration service can retrieve the file, validate its contents, transform the records, and import them into another application.
File-based integration is often practical when real-time communication isn’t required.
However, it needs careful handling of incomplete files, duplicate records, failed imports, and processing schedules.
4. Database-level integration
Some systems provide no suitable API but allow controlled access to their database.
An integration service may be able to read information through approved database views or a read replica.
For example, a reporting application might retrieve product information from a legacy database without changing the source application. This can work for read-only reporting when the vendor supports it. Queries may still affect the source system, and schema changes can break consumers, so agree which views are stable and how to limit query load.
Business rules may be enforced by the application rather than the database.
Writing records directly can bypass validation, break relationships, or create inconsistent data.
Where possible, use supported application interfaces or vendor-approved integration mechanisms.
5. Event-driven integration
Event-driven integration allows systems to communicate when something important happens.
For example, when a new order is created, the system publishes an event.
Other applications can react to that event without requiring the original application to call them directly.
Message brokers such as RabbitMQ can support this approach.
However, legacy applications don’t always provide native events.
In those cases, an adapter may need to detect changes through polling, change data capture, or another supported mechanism.
Event-driven integration can reduce coupling between applications, but it also requires attention to duplicate messages, ordering, retries, and eventual consistency.
Choosing between real-time and scheduled integration
Not every integration needs to operate in real time.
Consider two examples.
Product availability: An online store may need current inventory information before confirming an order.
Financial reporting: A management dashboard may only need updated information once per day.
Real-time integration can provide fresher information but may introduce greater operational complexity.
Scheduled integration is often simpler when delays are acceptable.
The decision should be based on business requirements rather than a preference for a particular technology.
Example architecture: connecting a legacy ERP to a modern CRM
Hypothetical example. A manufacturer uses a legacy ERP as the source of truth for customer account IDs, billing details, and orders. Its sales team uses Salesforce for account activity. The integration copies selected ERP account fields into Salesforce and reads current order status on demand.
Synchronous order lookup
When a salesperson requests an order status, Salesforce calls an integration API. The API sends the request to an ERP adapter, which reads the order through a supported ERP interface and maps the legacy status code to a value Salesforce can display. Salesforce waits for the result. If the ERP does not respond within the agreed timeout, the API returns an unavailable result that Salesforce can show to the user.
Asynchronous account synchronization
An adapter polls for changed ERP accounts and puts the changes on a durable queue. A worker processes them separately, validates required fields, and maps the ERP account ID and billing fields to Salesforce. It creates or updates the Salesforce account using the ERP ID as a unique external identifier. Reprocessing the same change updates the same account, and a source version check prevents an older retry from overwriting newer data.
Retries and operational visibility
The worker retries temporary failures, such as timeouts and Salesforce rate limits, with backoff and a limit on attempts. It routes invalid data and exhausted retries to a review queue. An operator can correct the underlying issue and replay the record. A correlation ID connects processing logs across the adapter and worker. Alerts flag growing queue age, repeated failures, and missed synchronization runs, and a reconciliation report surfaces records that still differ between systems.
How to handle initial and incremental synchronization
Many integration projects need to synchronize existing data before processing ongoing changes.
Initial synchronization
The initial synchronization transfers existing records from the legacy system into the target application.
For example, the integration might import 50,000 customer records into Salesforce.
Large datasets should usually be processed in manageable batches.
The implementation should track progress and record failures so individual records can be investigated or reprocessed.
Incremental synchronization
After the initial load, the integration processes new or modified records.
Common approaches include:
- Querying records changed since a stored timestamp.
- Processing events generated by the source system.
- Using change data capture where supported.
- Comparing records when no reliable change mechanism exists.
The integration should store its synchronization state carefully and avoid missing records around processing boundaries.
It should also support idempotent operations so repeated processing doesn’t create duplicate records.
Legacy system integration best practices
Secure the interface
Legacy system integration can expose sensitive business information.
Important security measures include:
Authentication and authorization: Only approved applications and users should access integration endpoints.
Encryption: Protect data in transit using appropriate secure protocols.
Credential management: Store passwords, API keys, and certificates securely.
Network restrictions: Limit access to legacy systems and integration services.
Logging: Record operational events without unnecessarily exposing personal or confidential information.
Data minimization: Exchange only the information required for the business process.
Security controls should be designed around the capabilities and limitations of the existing system.
Define API contracts and data ownership
Document the request and response formats, required fields, errors, timeout expectations, and compatibility rules for changes. Agree which system owns each field and how the integration handles missing data, deletions, and conflicting updates. Define how much synchronization delay the business can tolerate and how you’ll reconcile source and target records.
Monitor failures and recovery
A reliable integration needs more than successful API requests.
Consider what happens when the legacy application becomes unavailable.
The integration should distinguish temporary failures from permanent data problems.
Temporary failures may be retried with appropriate delays.
Invalid records may require correction or manual review.
Useful monitoring information includes:
- Number of processed records.
- Successful and failed operations.
- Last successful synchronization.
- Processing duration.
- Pending retries.
- Error categories.
For business-critical integrations, a dashboard can help operations teams identify and resolve synchronization problems.
Test and roll out incrementally
Use representative test data to verify transformations and contracts, including duplicate or out-of-order updates, timeouts, invalid records, and recovery after an interruption. Start with a limited dataset or workflow, compare results in both systems, and expand only after the checks pass. Agree how to pause synchronization, recover from the last verified checkpoint, and reconcile changes made during a pause.
If you’re choosing an external team, these checks give you concrete questions to ask when comparing API integration partners.
Common mistakes in legacy system integration
Replacing a system before evaluating integration
A complete replacement may be unnecessary when the existing application still provides valuable functionality.
Using direct database writes
Bypassing application logic can compromise data integrity.
Ignoring duplicate processing
Network failures and retries can cause the same record or event to be processed multiple times.
Design idempotent operations wherever possible.
Building tightly coupled integrations
If every application communicates directly with every other application, future changes become difficult.
Reusable interfaces and clear responsibilities can reduce complexity.
Underestimating maintenance
Adapters, integrations, and external APIs require ongoing monitoring and updates.
Include these activities in the long-term operating budget.
When should you integrate instead of replace?
Integration is often the better option when:
- The legacy system remains reliable.
- Existing business logic is valuable.
- Replacement would disrupt operations.
- The main limitation is missing connectivity.
- The company wants to modernize incrementally.
Replacement becomes more attractive when the system is unsupported, insecure, prohibitively expensive to maintain, or fundamentally unable to meet business requirements.
In some cases, integration can also support a gradual migration to a replacement system.
Frequently asked questions
Can a legacy system work with REST APIs?
Yes. An adapter or integration service can expose legacy functionality through REST APIs, provided the underlying system offers a suitable way to access that functionality.
Do I need MuleSoft to integrate legacy applications?
Not necessarily. MuleSoft is one option for enterprise integration. Custom services, message brokers, and other integration platforms may also be appropriate.
Is database integration safe?
Read-only access through supported mechanisms can be appropriate in some situations. Direct database writes are generally discouraged unless explicitly supported by the application vendor and carefully controlled.
Can legacy integration support real-time data synchronization?
Yes, depending on the system’s capabilities. Events, APIs, polling, and change data capture can support different synchronization requirements.
Conclusion: modernize connectivity without unnecessary replacement
Legacy applications don’t always need to be replaced to support modern business requirements.
API adapters, middleware, file-based integration, and messaging can connect existing software to new applications.
The right architecture depends on the available interfaces, data requirements, reliability expectations, and long-term modernization strategy.
A well-designed integration can extend the useful life of existing software while creating a foundation for future improvements.
Connect your legacy systems.
Let’s review your existing interfaces and plan a reliable integration approach.


