Skip to content

Ahoo-Wang/Wow

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3,710 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Wow

Wow

Domain Model as a Service

Modern Reactive CQRS Architecture Microservice Development Framework
Based on DDD & Event Sourcing

License GitHub release Maven Central Codacy Codecov CI Awesome Kotlin DeepWiki

Domain-Driven · Event-Driven · Test-Driven · Declarative Design · Reactive · CQRS · Event Sourcing

English · 中文


Quick Start

Use this template

Click the button above to create a new repository from Wow Project Template, then clone it and start writing your domain model.

Wow 8.x supports Spring Boot 4.x, Java 17+

Wow 6.x supports Spring Boot 3.x, Java 17+

Why Wow?

As business complexity grows, traditional CRUD architectures hit bottlenecks — tangled database schemas, painful sharding, and fragile distributed transactions. Domain-Driven Design and Event Sourcing address these problems, but often come with steep learning curves and implementation overhead.

Wow was built to change that. After years of production validation, it distills DDD + ES into a developer-friendly framework where you focus on the domain model, and Wow handles the rest.

For developers:

  • Focus on business, not infrastructure — Write only the domain model; Wow auto-generates OpenAPI interfaces
  • Effortless testing — The Given→When→Expect pattern makes 85%+ unit test coverage the norm, not the exception
  • Elegant read-write separation — Wait for the PROJECTED signal instead of guessing sync delays; no more "wait 1 second and refresh"
  • Scale without code changes — Horizontal scaling without sharding rules or database relationship refactoring

For enterprises:

  • Business Intelligence — State events and commands serve as rich, real-time data sources, reducing ETL to simple SQL scripts
  • Operation Audit — Every command and its resulting domain events are recorded with clear business semantics
  • Engineering Quality — In API testing, Wow-based projects showed only 1/3 the bug count of traditional-architecture projects at the same skill level

Features

Wow Features

Feature Description
Domain Model as a Service Just write the domain model, Wow auto-generates OpenAPI interfaces — no controller boilerplate needed
Test Suite Given→When→Expect pattern (AggregateSpec / SagaSpec), 80%+ coverage made easy
High Performance AppendOnly writes to event store, query-oriented search engines for reads — 59k+ TPS in stress tests
Horizontal Scalability No sharding rules needed, business code unchanged when scaling out
Distributed Transactions Saga orchestration pattern for carefully managed multi-service transactions
Event Compensation Visual dashboard + automatic retry with configurable RetrySpec for eventual consistency
Read-Write Separation SENT / PROCESSED / PROJECTED wait strategies eliminate sync-delay guesswork
Observability End-to-end OpenTelemetry integration for tracing, metrics, and debugging
Reactive Non-blocking async messaging with Project Reactor throughout the entire stack
Event Sourcing Full state history via event replay, enabling powerful audit and time-travel debugging
Business Intelligence Rich event-sourced data with real-time sync to data warehouses, minimal ETL cost

Architecture

Architecture

Command Processing Propagation Chain

Command Processing Chain

Performance

Stress test of the example application (2 min):

Operation Wait Strategy Avg TPS Peak TPS Avg Latency
Add To Cart SENT 59,625 82,312 29 ms
Add To Cart PROCESSED 18,696 24,141 239 ms
Create Order SENT 47,838 86,200 217 ms
Create Order PROCESSED 18,230 25,506 268 ms
Performance Details & Deployment

AddCartItem-SENT

CreateOrder-SENT

Test Suite

Given → When → Expect

CI Flow

Aggregate Test (AggregateVerifier)

class CartSpec : AggregateSpec<Cart, CartState>({
  on {
    whenCommand(AddCartItem(productId = "productId", quantity = 1)) {
      expectNoError()
      expectEventType(CartItemAdded::class)
      expectState {
        items.assert().hasSize(1)
      }
    }
  }
})

Saga Test (SagaVerifier)

class CartSagaSpec : SagaSpec<CartSaga>({
  on {
    whenEvent(event = mockk<OrderCreated> {
      every { items } returns listOf(orderItem)
      every { fromCart } returns true
    }, ownerId = ownerId) {
      expectCommandType(RemoveCartItem::class)
    }
  }
})

Design

Modeling Patterns

Single Class Inheritance Aggregation
Single Class Inheritance Aggregation

Core Flows

Command And Event Flow

Event Sourcing

More Design Diagrams

Load Aggregate

Load Aggregate

Aggregate State Flow

Aggregate State Flow

Send Command

Send Command

Observability

Observability

Event Compensation

Compensation Dashboard

Compensation Details

Compensation Use Case

Compensation Sequence

Apply Retry Spec

Compensation Succeeded

Ecosystem

Project Description
CosId Universal, flexible, high-performance distributed ID generator
CoSec Multi-tenant reactive security framework based on RBAC and policies
CoCache Distributed consistent secondary cache framework
Simba Easy-to-use, flexible distributed lock service
CoSky High-performance, low-cost microservice governance platform
CoApi Zero-boilerplate HTTP client auto-configuration for Spring 6
FluentAssert Kotlin fluent assertion library for readable and expressive tests

Examples

Example Language Description
Order Service Kotlin Aggregates, sagas, projections — full DDD demo
Bank Transfer Java Simple event sourcing demo

License

Wow is released under the Apache 2.0 License.

About

Modern Reactive CQRS Architecture Microservice development framework based on DDD and EventSourcing | 基于 DDD & EventSourcing 的现代响应式 CQRS 架构微服务开发框架

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors