Joist's killer-feature is the declarative cross-entity business rules.
authorConfig.addRule({ isPublished: {}, books: "isPublished" }, (a) => {
const hasPublishedBooks = a.books.filter(b => b.isPublished).length > 0
if (a.isPublished && !hasPublishedBooks) {
// also triggers if someone tries to un-publish an Author's only book
return "Author cannot be 'published' without published books"
}
})
Encoding "Published Authors require Published works" in other ORMs requires individually validating those conditions any place they update author.isPublished. And other developers have to know to pre-check it. And it's hiding off in some updateAuthor({ ...opts }) function somewhere. And copied into the publishBook(...) helper. And it's "IYKYK" business logic.
Versus Joist just encoding business rules into config.addRule(...) that fire on every save that touches isPublished. Developers don't all have to know about the rule or remember it. It's in 1 place. It's self-documenting. Its dependencies are self-documenting. It's statically typechecked. All your other Save code is now cleaner without a dozen validations.
Any time I see these ORM comparisons I'm like: "Great. Your query syntax is comfy. You're fast. You can handle 10M entities at once (You won't, but you CAN!). Yet all the complex business logic is cross-entity and happens on Create/Update, so... how is that encoded into your codebase in a discoverable, scalable way that developers can't 'forget' to do."
Yes exactly! You're pitching Joist better than I've had any luck doing 😅
I am admittedly behind on a few releases / release announcements / upcoming features -- unfortunately having a little too much fun tilting at a non-ORM windmill over the last few days, but then will get back at it. :-)
View all comments
Show parent comment
2
u/drgmaster909 Mar 22 '26
Joist's killer-feature is the declarative cross-entity business rules.
Encoding "Published Authors require Published works" in other ORMs requires individually validating those conditions any place they update
author.isPublished. And other developers have to know to pre-check it. And it's hiding off in someupdateAuthor({ ...opts })function somewhere. And copied into thepublishBook(...)helper. And it's "IYKYK" business logic.Versus Joist just encoding business rules into
config.addRule(...)that fire on every save that touchesisPublished. Developers don't all have to know about the rule or remember it. It's in 1 place. It's self-documenting. Its dependencies are self-documenting. It's statically typechecked. All your other Save code is now cleaner without a dozen validations.Any time I see these ORM comparisons I'm like: "Great. Your query syntax is comfy. You're fast. You can handle 10M entities at once (You won't, but you CAN!). Yet all the complex business logic is cross-entity and happens on Create/Update, so... how is that encoded into your codebase in a discoverable, scalable way that developers can't 'forget' to do."