Binding Semantics to Infrastructure
The Domain defines structure and legal change. The Process layer defines coordination semantics. The Relations layer defines structured observation. The Presentation layer defines the external boundary.
Cohesive Host binds all of this to real infrastructure.
It is the composition root of a Cohesive system. Host does not introduce business meaning. It realizes semantic intent operationally.
Architectural Position
Cohesive Systems consists of five building blocks:
- Cohesive Entities & Transitions --- state semantics
- Cohesive Processes --- coordination semantics
- Cohesive Relations --- observation semantics
- Cohesive Presentation --- interface boundary
- Cohesive Host --- infrastructure binding (this page)
A core principle of the architecture is:
Semantics are stable. Infrastructure is replaceable.
Host exists to preserve that separation.
What Cohesive Host Does
Cohesive Host is responsible for:
- Wiring storage implementations
- Configuring runtime environments
- Connecting transports
- Registering effect handlers
- Binding projection targets
- Integrating observability
- Defining deployment topology
It does not:
- Define domain invariants
- Define transition semantics
- Define workflow logic
- Define projection semantics
Those belong to their respective semantic layers. Host configures how they are realized.
Binding, Not Defining
For example, the domain defines:
- Entity identity
- Field semantics
- Invariants
The process layer defines:
- Coordination boundaries
- Effect routing
- Retry and compensation semantics
The relations layer defines:
- Projection dependencies
- Join semantics
- Predicate algebra
The host configures:
- Which database stores entity state
- Whether state is event-sourced or stored directly
- Which runtime executes processes
- How partitions map to infrastructure
- How concurrency control is enforced
- Which index engine materializes projections
Policies originate in semantics. Host binds them to implementation.
Event Sourcing vs Outbox
Transitions produce deterministic effects. Host decides whether:
- State is derived from events (Event Sourcing)
- State is updated directly and effects are persisted alongside it (Outbox)
This is an infrastructure decision. The transition model does not change. Switching from outbox to event sourcing, or vice versa, does not require rewriting domain logic.
Runtime Configuration
Processes may execute:
- Inside a simple ASP.NET request
- Within a database transaction
- On DurableTask
- On Orleans
- On a distributed scheduler
- On serverless infrastructure
The Process layer defines orchestration semantics. Host selects and configures the runtime substrate. This allows the same coordination model to scale from monolith to distributed system.
Partitioning and Concurrency
Partition keys and coordination boundaries originate in the semantic model.
Host configures:
- How partitions map to database shards
- How entities map to actor grains or partitions
- Which concurrency model is used (optimistic, transactional, single-writer)
- How execution isolation is enforced operationally
Host does not invent these rules. It operationalizes them.
Projection and Query Bindings
Relations define projections declaratively. Host configures:
- Target storage engines (Elastic, Postgres, etc.)
- Materialization pipelines
- Change propagation mechanisms
- Rebuild and anti-entropy strategies
Observation semantics remain stable. Projection infrastructure remains replaceable.
Transport and Integration
Host integrates:
- HTTP endpoints
- Message queues
- Event streams
- Background workers
- Timers and schedulers
Presentation defines the interface boundary. Processes define coordination. Host connects those semantics to concrete transports.
Observability
Because transitions and effects are explicit, Host can attach:
- Structured logging
- Metrics
- Distributed tracing
- Audit streams
- Change-feed metrics
- Projection lag metrics
Instrumentation attaches to semantic boundaries rather than scattered call sites.
This significantly improves:
- Debuggability
- Operational clarity
- Incident analysis
- Performance tuning
Deployment Topology
Host defines deployment strategy:
- Single-region vs multi-region
- Active/active vs active/passive
- Projection per-region replication
- Background worker scaling
- Actor placement strategies
These decisions are operational. They do not alter semantic definitions.
Clear Separation from Presentation
It is important not to conflate:
Presentation
- Defines external boundary
- Maps transport to semantic intent
- Shapes API contracts
Host
- Configures storage engines
- Selects process runtime
- Wires effect handlers
- Configures projection targets
- Sets up observability
- Defines topology
Presentation handles protocol semantics. Host handles operational realization.
Why This Layer Matters
Without an explicit composition boundary:
- Domain logic leaks into controllers
- Workflow code leaks into infrastructure
- Persistence details bleed into services
- Execution assumptions infect semantics
- Storage decisions become permanent architectural constraints
Cohesive Host keeps infrastructure explicit and configurable.
Incremental Adoption
You can introduce Host gradually.
Minimal
- Register storage
- Register process invoker
- Wire presentation to transitions
Intermediate
- Add projection materialization
- Introduce background processing
- Add observability hooks
Advanced
- Introduce durable orchestration
- Add multi-region projection replication
- Partition entities across shards or actors
- Introduce ML feature pipelines with runtime bindings
The semantic layers remain untouched.
The Core Principle
Semantics declare intent. Processes declare coordination. Relations declare observation. Presentation declares interface. Host configures realization.
This separation allows systems to evolve operationally without rewriting core logic. That is the purpose of Cohesive Host.