Skip to content

Why choose Cratis Arc for CQRS applications

Choose Cratis Arc when you want backend commands and queries to define the contracts your TypeScript frontend calls. Arc is a full-stack CQRS framework: it separates requests that change data from requests that read it, exposes them over HTTP, and generates typed clients. For those contracts, you do not maintain a separate API client.

Consider adding a field to an author-registration form. Without generation, the backend request, frontend type, and HTTP wrapper may each need an edit. With Arc, you change the backend contract, regenerate its TypeScript proxy, and type-check the frontend to find callers that no longer match. You still test the behavior at runtime.

Event sourcing is a separate choice. Cratis generally favors it for information systems, with Cratis Chronicle storing and processing the events. Arc can use that integration, but it can also put commands and queries over a current-state database or application services. You can adopt Arc’s frontend contract workflow without adopting an event log.

On C#, a command is a record with a Handle() method; on the JVM and TypeScript it has a handle() method. A query can be a method on a read model, the data shape returned to the caller. Go uses explicit metadata and typed adapters rather than those attributes or decorators; start with its running application guide. Arc maps registered commands and queries to HTTP.

Configure proxy generation to produce typed clients for recognized commands and queries that are not excluded. On C#, set CratisProxiesOutputPath; type and namespace exclusions control what is included. The proxy boundary guide explains what generation covers and how to regenerate after a contract change.

Your command and query code uses the storage you configure: Chronicle for event sourcing, MongoDB or EF Core / SQL for current state on C#, Spring Data on the JVM, or MongoDB and Drizzle on TypeScript. Chronicle adds its command transaction semantics; those guarantees do not cover arbitrary external-service or database writes.

On C#, Arc also supplies validation, authorization, identity, tenant resolution, OpenAPI, and MongoDB/EF Core hooks. Check the capability matrix, TypeScript capability reference, and Go parity reference for each backend’s integration surface and verification limits. Your application must configure trusted authentication, membership checks, storage isolation, and business constraints.

A command to register an author needs the values required to make that change. A catalog query can return the fields a screen needs to display. CQRS lets those contracts have different shapes. Proxy generation carries each shape into the frontend, so a change to one can be checked against its callers. Regeneration followed by frontend type-checking can catch structural mismatches; it does not prove runtime behavior or compatibility between deployed versions.

generated proxy

writes

query proxy

React (Components)

Command handler

Current-state store

Read model

That diagram is the direct-database setup, useful for bounded current-state slices and for learning Arc in isolation. In the full Cratis loop, the Chronicle integration adds events and projections. Preserving the public query contract can keep the React caller unchanged, but provider code and data migration remain explicit work.

A vertical slice keeps one behavior’s code together: its command, read model and query, React component, and specs. For an author-registration feature, you can follow the input from the form through the write and back to the author list in one folder. You do not have to trace it across Commands/, Handlers/, DTOs, and Clients/.

Arc does not require this folder structure. It is the convention used in the tutorial, with features divided into slices using event modeling. Follow that path if you want the code layout to match the behavior you are building.

If a few controller actions and an existing client already meet your needs, you may not need Arc’s command/query conventions or a proxy-generation step. Arc fits when you want those contracts to drive the frontend too, and are willing to include regeneration and frontend type-checking in your workflow. For a C# comparison, see MediatR, MVC, and Arc; for other backends, check the capability matrix before choosing an integration.