Acerca de
Modern Reactive CQRS Architecture Microservice development framework based on DDD and EventSourcing | 基于 DDD & EventSourcing 的现代响应式 CQRS 架构微服务开发框架
Desarrollo web y de aplicacionesCrecimiento de estrellas medido
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- 0
- in 1 month
- Recopilando historial
Cambios netos en períodos que se solapan, no totales diarios. Los datos no disponibles se dejan en blanco. Las estrellas indican interés, no calidad.
README.md
Original
Wow
Wow 10.0 is in pre-release on this branch. The stable 9.x line lives on the
v9branch.
Domain Model as a Service
Write only the domain model, and get a system you can run: its API, its contract, its clients and its read models.
What you write, and what you get
You write an aggregate: it takes a command, looks at its state, and decides the events.
fun onCommand(command: Withdraw): Withdrawn {
if (command.amount > state.balance) {
reject(Rejections.INSUFFICIENT_BALANCE, "The balance is ${state.balance}.")
}
return Withdrawn(command.amount)
}
and you test it in the same terms:
@Test
fun `a withdrawal the balance does not cover is rejected`() = aggregateSpec(model, id = "alice") {
given(AccountOpened("Alice"), Deposited(100))
whenCommand(Withdraw(150)) { expectRejected(Account.Rejections.INSUFFICIENT_BALANCE) }
whenCommand(Withdraw(30)) {
expectEvents(Withdrawn(30))
expectState { balance.assert().isEqualTo(70) }
}
}
From that, Wow gives you an HTTP route for every command, a state read and queries for every aggregate, an OpenAPI document, a typed TypeScript client, retries and parking for every handler, and a contract that the build checks for compatibility.
Why Wow
- The log is the bus. Every commit is appended to the log, and everything else (snapshots, read models, other contexts, the warehouse) follows it from there. Nothing is lost between a write and its consequences.
- You write decisions, not plumbing. Aggregates decide; sagas derive commands; projections and reactors follow events. Routes, persistence, delivery and retries are the framework's.
- Failures are data. A handler that keeps failing parks one aggregate, recorded in a ledger; it never skips an event or stops a subscription.
- One contract. Routes, OpenAPI, typed clients, views and compatibility checks all come from one Manifest the compiler writes.
- Read models are disposable. Every read model is rebuilt from the log, so changing one needs no migration.
- Measured on stated hardware. Performance gives one node's sustainable and peak rates on a 4-core cloud runner and an 18-core workstation, and the comparison with Axon Framework 4, each figure with its build, CPU and JDK.
Quickstart
- Apply the Gradle plugin
me.ahoo.wow.service, which brings the BOMme.ahoo.wow:wow-bomof its version. - Write a command, an event, a state and an aggregate.
./gradlew run, then send a command withcurl.
The Quickstart walks through it in about thirty minutes.
Architecture
flowchart LR
C[Clients] -->|commands| N[Service nodes]
N -->|decide| L[(Log)]
L --> S[Snapshots]
L --> P[Projections and reactors]
L --> G[Sagas]
G -->|commands| N
L -->|published streams| K[(Kafka)]
K --> O[Other contexts]
L --> W[(Warehouse)]
A service runs as one or more nodes over PostgreSQL or MongoDB; they split the log's partitions through leases in the same store. Contexts talk over Kafka. Concepts explains the model.
Modules
| Artifact | Holds |
|---|---|
me.ahoo.wow:wow-bom |
The versions of every module |
me.ahoo.wow:wow-api |
The annotations and types domain code uses |
me.ahoo.wow:wow-kernel |
The kernel the generated models build on |
me.ahoo.wow:wow-spring-boot |
The Spring Boot host |
me.ahoo.wow:wow-test |
The test DSL |
me.ahoo.wow:wow-postgres, wow-mongo |
The backends |
me.ahoo.wow:wow-kafka, wow-clickhouse, wow-elasticsearch |
The transport, the warehouse, search |
TypeScript
| Package | Does |
|---|---|
@ahoo-wang/wow-client |
Commands with their waits, state reads and queries |
@ahoo-wang/wow-generator |
Typed clients generated from a service's Manifest |
@ahoo-wang/wow-react |
React hooks for queries |
@ahoo-wang/wow-view-engine |
Configurable data views: records, analyses and dashboards |
@ahoo-wang/wow-view-store |
Saved views on a Wow server |
Platform services and examples
- The ops service and console: the parked aggregates of every service in one place.
- The view store: saved views and dashboards.
- The analytics catalog: datasets across services (incubating).
- The eShop: five services on PostgreSQL, Kafka and ClickHouse, with a web UI.
- The quickstart: the service of the Quickstart page.
Requirements
| Component | Version |
|---|---|
| Java | 21 |
| Kotlin | 2.4.21 |
| KSP | 2.3.14 |
| Spring Boot | 4.2.0 |
From 9.x
Migrating from 9.x covers the source, the data and the cut-over. The 9.x line is maintained on the v9 branch.
Agent Skills
Six Skills help an agent write, migrate and query Wow applications: install the plugin ahoo-wow-skills from the Ahoo Skills Hub, or copy the skills of an exact Wow tag into the agent's Skills directory.
Community
- Read Contributing, the Code of Conduct and the Security Policy.
- Wow received the KaiCode’26 Excellent Award.
- Related projects: CosId, CoSec, Simba and FluentAssert.
License
Wow is released under the Apache 2.0 License.
Explorar proyectos relacionados
Cargando…