> For the complete documentation index, see [llms.txt](https://docs.ecotone.tech/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ecotone.tech/solutions/php-for-enterprise-architecture.md).

# PHP for Enterprise Architecture

Enterprise architecture patterns in PHP - comparing Ecotone to Spring, Axon, NServiceBus

## The Problem You Recognize

You're a technical lead or architect evaluating whether PHP can handle enterprise-grade architecture. Your team knows PHP well, but the business is growing — you need CQRS, Event Sourcing, distributed messaging, multi-tenancy, and production resilience.

The alternative is migrating to Java (Spring + Axon) or .NET (NServiceBus, MassTransit). That means retraining your team, rewriting your application, and losing PHP's development speed.

## PHP Has Grown Up

PHP is no longer just for simple web applications. Modern PHP (8.1+) has union types, enums, fibers, readonly properties, and first-class attributes. Frameworks like Laravel and Symfony provide the web layer. What was missing was the **architecture layer** that lets a system grow from first command handler to event-sourced microservices without rewrites — the equivalent of what Spring Integration and NServiceBus provide in their ecosystems.

Ecotone fills that gap. Built on the same [Enterprise Integration Patterns](https://www.enterpriseintegrationpatterns.com/) that underpin Spring Integration, NServiceBus, and Apache Camel, Ecotone brings decades-proven architectural patterns to PHP as attribute-driven code on your existing Laravel or Symfony application.

## How Ecotone Compares

| Capability                                | Java (Axon)           | .NET (NServiceBus)    | PHP (Ecotone)               |
| ----------------------------------------- | --------------------- | --------------------- | --------------------------- |
| CQRS                                      | Yes                   | Yes                   | Yes                         |
| Event Sourcing                            | Yes                   | Manual                | Yes                         |
| Sagas                                     | Yes                   | Yes                   | Yes                         |
| Workflow Orchestration                    | Manual                | Yes                   | Yes                         |
| Resiliency (Retries, Dead Letter, Outbox) | Yes                   | Yes                   | Yes                         |
| Distributed Messaging                     | Yes                   | Yes                   | Yes                         |
| Multi-Tenancy                             | Manual                | Manual                | Built-in                    |
| Message Broker Support                    | Kafka, RabbitMQ, etc. | RabbitMQ, Azure, etc. | RabbitMQ, Kafka, SQS, Redis |
| Observability                             | Micrometer            | OpenTelemetry         | OpenTelemetry               |
| Testing Support                           | Axon Test Fixtures    | NServiceBus Testing   | Built-in Test Support       |

## What You Get With Ecotone

* **Enterprise Integration Patterns** as the foundation — not a custom abstraction
* **Framework integration** — works on top of Laravel and Symfony, not replacing them
* **Attribute-driven configuration** — PHP 8 attributes instead of XML or YAML
* **Production resilience** — retries, error channels, dead letter, outbox, deduplication
* **Full testing support** — test message flows, aggregates, sagas, and event sourcing in isolation
* **Observability** — OpenTelemetry integration for tracing and metrics
* **Multi-tenancy** — built-in support for tenant-isolated processing

## Next Steps

* [Why Ecotone?](/why-ecotone.md) — Detailed positioning and integration story
* [Installation](/install-php-service-bus.md) — Get started in 5 minutes
* [Enterprise Features](/enterprise.md) — Advanced capabilities for scaling teams
* [Tutorial](/tutorial-php-ddd-cqrs-event-sourcing.md) — Hands-on learning path


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.ecotone.tech/solutions/php-for-enterprise-architecture.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
