The persistence boundary
We still use Sequelize. I like Sequelize. The issue was never the ORM. The issue was that Sequelize had become part of Dawnshard's core architecture, and every time it changed, we felt it.
What we built
Dawnshard's persistence layer has three parts. A BaseAdapter contract that defines every database operation the core needs: create, find, update, delete, transactions, associations, schema definition. An OrmAssembler that the rest of the system talks to, which holds no ORM-specific knowledge and delegates everything through the adapter. And a concrete Sequelize adapter that implements the contract and owns all the Sequelize-specific translation.
Above the boundary, code speaks Dawnshard's own DSL: queries described as plain objects, schema defined in terms of types Dawnshard understands, associations expressed as names. Below the boundary, the Sequelize adapter translates that DSL into Sequelize operations. Sequelize words like `paranoid`, `Op.iLike`, and `belongsToMany` exist only in the adapter.
The problem it solves
Originally, the core worked directly with Sequelize models. That was fine until it started costing us. Library updates that required changes across core code. Performance issues that forced us to understand Sequelize internals deeply enough to work around them. The kind of maintenance debt where you spend a meaningful chunk of development time managing a dependency rather than building the product.
None of that is unusual. It is what happens when a third-party library gets load-bearing. The fix is a seam. We did not replace Sequelize. We stopped letting it into the core.
What the boundary actually means
The OrmAssembler does not reach into the adapter's internals. The comment on `syncDatabase` makes this explicit: the assembler delegates to the adapter contract and keeps the seam intact. When the core needs the database to do something, it describes what it wants in DSL terms and the adapter handles it.
The DSL covers the full set of operations the core actually uses: standard CRUD, bulk operations, associations, transactions, soft deletes, includes. The adapter owns all the decisions about how those translate into Sequelize. For example, `softDelete` in the DSL becomes `paranoid` in Sequelize, and that translation exists in exactly one place.
Some of those translations carry behaviour beyond the query itself, including error handling, case sensitivity, and soft-delete semantics. Keeping those decisions inside the adapter means the rest of Dawnshard does not need to understand how Sequelize implements them.
What this is not
This is not an argument that every application should build an ORM abstraction. For most projects, working directly with Sequelize or Prisma or whatever you have chosen is the right call. The seam here exists because Dawnshard carries multiple products and its own development trajectory. The maintenance cost that motivated it was real and had already been paid.
Database independence is a side effect, not the goal. The goal was to stop absorbing Sequelize's rate of change into the core.
What this unlocks
Core development no longer has Sequelize as an ambient concern. Changes to how queries are built, how associations work, or how schema types are handled are contained to the adapter.
It also means the pattern is consistent. The channel system, the realtime transport, and now persistence all follow the same shape: a contract the core depends on, a concrete plugin that implements it, and a boundary the core does not cross. That consistency makes the system easier to reason about as it grows.
What's next
The next post covers the routing and middleware layer: how requests get from an HTTP endpoint into the service layer, and what Dawnshard does to keep that path consistent across every domain.
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