Tutorial
Cratis Chronicle: event-sourcing database
Cratis Chronicle is an open-source event-sourcing database and runtime that keeps the changes your application records, builds queryable views from them, and runs reactions when events arrive. Use it when you need to explain how an order reached its current state or build a new view from its history, rather than keep only the latest row.
Cratis Chronicle
Store events. Declare read models.
Record a fact such as OrderPlaced, then declare how it changes the views your application reads. Chronicle processes the events and updates those views for you. Start with a local kernel and your client.
What Chronicle takes care of
Section titled “What Chronicle takes care of”An event log answers what happened. To show an order summary or a list of outstanding orders, you also need a read model: data shaped for a particular query. Chronicle’s declarative projections describe how events map onto those models. You define the mapping; the kernel processes events and writes the resulting changes to read-model storage. The same events can feed several views without duplicating the recorded history.
When a recorded change should send a notification or call another service, use a reactor. A reactor runs application code in response to events. It consumes the history alongside projections; it does not have to wait for a view to update.
How do you handle personal data in event history?
Section titled “How do you handle personal data in event history?”Keeping history also means planning for personal data. Chronicle can encrypt fields marked as personally identifiable information (PII) with a key tied to the person the data concerns. Erasing that key makes the encrypted values unreadable without removing the event’s place in the log. Start with compliance and PII before modeling personal data, and use regulatory responsibilities to separate these mechanisms from the obligations your application and deployment must meet.
Which clients and storage providers can you use?
Section titled “Which clients and storage providers can you use?”Chronicle’s .NET kernel, built on Microsoft Orleans, connects through gRPC, a language-neutral remote-call protocol, to clients for .NET, TypeScript, Kotlin, Java, and Elixir. It offers storage providers for MongoDB, PostgreSQL, Microsoft SQL Server, and SQLite. Architecture explains those boundaries. Client capabilities and provider behavior are not interchangeable; follow the setup and capability guidance for the client and storage you choose.
Start here
Section titled “Start here”Begin with Get started to run a local kernel, choose a client setup guide, and append your first event. If you are still deciding whether to adopt event sourcing, read when event sourcing pays off — and when it does not.
For a guided example, follow the library tutorial. The architecture and workbench guides help when you need to understand or inspect the running system.
Why Event Sourcing
Understand the architecture
Inspect with Workbench
Run Chronicle locally
Section titled “Run Chronicle locally”With Docker installed, you can start the kernel before writing application code. Use latest-development for this local evaluation: it bundles Chronicle and MongoDB and tracks the newest published development image. For a repeatable setup, pin a released version in your application or deployment configuration rather than copying an image digest into a getting-started command.
This command exposes only the kernel port, 35000; the bundled MongoDB stays
inside the container. For a setup that also exposes MongoDB on port 27017 so
local database tools can connect, see the two-port host quickstart.
-
Pull and start the current development image with Chronicle available only on this machine. MongoDB remains internal to the container.
Terminal window docker run --pull=always --rm -d --name chronicle \-p 127.0.0.1:35000:35000 \cratis/chronicle:latest-development -
Wait for the local health endpoint to report readiness. The development image uses a self-signed certificate, so this command disables certificate verification only for this local check.
Terminal window curl --insecure --fail --retry 30 --retry-all-errors --retry-delay 1 \https://localhost:35000/healthA successful response prints
Healthy. You can now connect an application or open the workbench athttps://localhost:35000. -
Stop and remove it when the evaluation is complete.
Terminal window docker rm -f chronicle
Independent-use boundary
Section titled “Independent-use boundary”You can run Chronicle and its bundled workbench without Studio, Arc, or Components. Start the kernel, connect your chosen client, and use the workbench to inspect it. Your application still needs packages, protocols, and configuration compatible with that Chronicle server.
Inspection surfaces
Section titled “Inspection surfaces”Open Chronicle Workbench to inspect the event stores and namespaces you are authorized to access, check observer state, or try the projection behavior supported by your running image. This browser tool is bundled with Chronicle; you do not need Studio to use it. For terminal inspection and diagnosis, use the Cratis CLI.
Permission to inspect does not grant permission to append, revise, redact, replay, or recover data. These tools do not promise complete administration or governed production mutations, nor do they establish client parity or federation. Self-hosted inspection is separate from a managed service, support, or a service-level agreement (SLA).
Continue
Section titled “Continue”Architecture
Workbench
Cratis CLI
Operating Chronicle
Chronicle source