← All posts

Models and the base service

The first post explained why we built Dawnshard instead of accepting the usual CRUD scaffolding. This one is where that stops being abstract. The model system is the clearest expression of the whole idea, and one of the places where my background in games & simulation technology influenced how we approached the problem.

What we built

Coming from games and simulation technology, I tend to think about objects as things that should be defined clearly enough for the systems around them to understand how to work with them. Dawnshard carries some of that through the model definition design.

Each object in Dawnshard has an authoritative definition. The idea is nothing new: define enough about an object that the systems around it can understand how to work with it, rather than rebuilding that knowledge every time the object is used somewhere new.

That definition gives the engine enough information to handle common concerns like storage, validation, access control, relationships, and lifecycle consistently. The systems that need to understand an object work from the same definition, while anything specific to that domain remains free to build on top of it.

A new domain means a new definition. The engine does not change. We are trying to start with a strong foundation, not a bowl of jelly.

The problem it solves

The previous post described the drift problem: a batch defined on the backend, then defined again on the frontend, then a hack added to one side to reconcile them, until the truth about a batch lives in several places that quietly disagree. It is never done with intent. It is an infection that slowly spreads each tim new requirements appear.

That problem is not just about the frontend and backend diverging. It happens within the backend too. Persistence, validation, access control, and presentation each develop their own understanding of what an object is, and keeping them aligned is work that has to be done again every time anything changes.

One definition driving those common systems removes much of that duplication. Change the object definition and the systems that depend on it can respond to the same change.

The challenge

The interesting problem here is not object definition itself. That part is straightforward once you commit to the idea. The hard part is ownership boundaries. Poorly defined boundaries actually force spaghetti, not reduce it.

When the engine handles common behaviour on behalf of every object, ownership boundaries become critical. Those boundaries need to remain consistent across everything the engine does while keeping the backend authoritative without turning authorization into a performance bottleneck, particularly as operations become larger or involve multiple related objects.

Finding that balance became an important part of the architecture. Security could not be weakened for performance, and performance could not simply be sacrificed for security. The answer was to make ownership and responsibility explicit enough that the engine could enforce those boundaries consistently without every part of the system having to solve the problem independently.

What makes this different

The conventional approach separates these concerns by layer. You have a persistence model, a validation configuration, a set of permission checks, and a serializer. Each is owned by whoever writes that layer. Each is plausible on its own. And each accumulates its own assumptions over time, which means keeping them aligned becomes an ongoing responsibility.

Here, responsibility has a clear owner. Object characteristics are not re-described independently across the systems that need to understand that object. The boundaries between those systems are deliberate too, so security, performance, and extensibility can each be handled in the part of the architecture that owns them.

That is not a framework convention or a matter of discipline. It is a structural property of the design.

What this unlocks

Dawnshard can acquire new domains without rebuilding infrastructure or modifying its core systems. Each one arrives as a definition, and the engine provides the rest.

That is the capability this foundation creates. The next post is where we start using it. The identity and access layer is the first serious test of whether a system like this can carry real complexity without collapsing back into the bespoke machinery it was built to replace.

What's next

The next post covers identity and access: accounts, profiles, identities, memberships, invitations, and the RBAC system that governs what any of them can do. It is built entirely on the model system described here, and it is where the architecture either sinks or swims.

Liked this post? Tap the heart to let us know.

Get early access

Be the first to hear about early access, roadmap updates, and exclusive early adopter pricing.

Join the early access list